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.
talk service enableddo_live_* keyKeep your API key secure
Your API key grants access to your account. Never share it publicly or commit it to version control.
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.mp3const 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();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)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));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# 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# 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.mp3The API returns useful information in response headers:
| Header | Description |
|---|---|
X-Characters-Used | Number of characters processed |
X-Audio-Duration | Duration of generated audio (seconds) |