Quick Start

Get up and running with the Talk API in minutes

This guide will help you generate your first text-to-speech audio in under 5 minutes.

Step 1: Get Your API Key

  1. Go to do.dev and sign up for an account
  2. Navigate to your Dashboard
  3. Create an API key with the talk service enabled
  4. Copy your do_live_* key

Keep your API key secure

Your API key grants access to your account. Never share it publicly or commit it to version control.

Step 2: Generate Your First Audio

Using cURL

curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello! Welcome to the Talk API.", "voice": "aria"}' \
  --output welcome.mp3

Using JavaScript (fetch)

const response = await fetch("https://api.do.dev/v1/talk/speech", {
  method: "POST",
  headers: {
    "Authorization": "Bearer do_live_your_key_here",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Hello! Welcome to the Talk API.",
    voice: "aria"
  })
});

// Get audio as blob
const audioBlob = await response.blob();

// Play in browser
const audioUrl = URL.createObjectURL(audioBlob);
const audio = new Audio(audioUrl);
audio.play();

Using Python

import requests

response = requests.post(
    "https://api.do.dev/v1/talk/speech",
    headers={
        "Authorization": "Bearer do_live_your_key_here",
        "Content-Type": "application/json"
    },
    json={
        "text": "Hello! Welcome to the Talk API.",
        "voice": "aria"
    }
)

# Save to file
with open("welcome.mp3", "wb") as f:
    f.write(response.content)

Using Node.js

import fs from "fs";

const response = await fetch("https://api.do.dev/v1/talk/speech", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.DO_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Hello! Welcome to the Talk API.",
    voice: "aria"
  })
});

const buffer = await response.arrayBuffer();
fs.writeFileSync("welcome.mp3", Buffer.from(buffer));

Step 3: Try Different Voices

The Talk API offers 17 unique voices. Try a few:

# Warm professional female voice (Claire)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is the aria voice!", "voice": "aria"}' \
  --output aria.mp3

# Deep authoritative male voice (Drake)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is the orion voice.", "voice": "orion"}' \
  --output orion.mp3

# British female voice (Victoria)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is the emma voice.", "voice": "emma"}' \
  --output emma.mp3

Step 4: Customize Output

Change Format

# WAV format (uncompressed, higher quality)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "High quality audio", "voice": "aria", "format": "wav"}' \
  --output audio.wav

Adjust Speed

# Slower speech (0.75x)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Speaking slowly and clearly.", "voice": "aria", "speed": 0.75}' \
  --output slow.mp3

# Faster speech (1.5x)
curl -X POST "https://api.do.dev/v1/talk/speech" \
  -H "Authorization: Bearer do_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Speaking quickly!", "voice": "aria", "speed": 1.5}' \
  --output fast.mp3

Response Headers

The API returns useful information in response headers:

HeaderDescription
X-Characters-UsedNumber of characters processed
X-Audio-DurationDuration of generated audio (seconds)

What's Next?