Text to speech
ElevenLabs text to speech
Submit a script, follow the job and download the audio.
POST/api/v1/tts
Submit a text-to-speech job. Returns a task_id immediately. Poll the job with GET /api/v1/tts?task_id=.... Cost = 1 credit per character.
Request body
voice_settings object
Settings applied per model (extended model set) — each model applies only its own; other fields are ignored for it:
language works on both backends. On the standard backend stability / similarity / style / speaker boost have no effect — performance is driven by inline tags in text (see Performance tags below). Sending the fields is harmless.
Which model set is active
GET /api/tts/backend (no auth) reports it:
{ "elevenlabs": "backup", "models": [{ "id": "eleven_v4", "label": "v4", "settings": ["stability", "similarity_boost"] }, ...], "default_model": "eleven_v4", "speed_range": { "min": 0.7, "max": 1.2 } }elevenlabs is "primary" or "backup". A non-empty models array means the extended ElevenLabs model set is enabled and model_id is honoured, with each model's settings listing the voice settings it applies; an empty array means the standard backend (default_model is then eleven_multilingual_v2).
Performance tags (inline in text)
Drop these tags directly into the text — they steer pacing, pauses, emotion, sound effects, style and tone.
- Speed:
[speed_very_slow]·[speed_slow]·[speed_fast]·[speed_very_fast] - Pause:
[pause]·[long_pause] - Emotion (31):
[affection],[amusement],[anger],[awe],[confusion],[contentment],[curiosity],[disappointment],[doubt],[empathy],[envy],[excitement],[fear],[guilt],[happiness],[hesitation],[hope],[hurt],[interest],[joy],[love],[nostalgia],[pity],[pride],[relief],[sadness],[satisfaction],[shame],[surprise],[sympathy],[wonder] - Sound effects (onomatopoeia is part of the tag — keep it attached):
[cough]ahem·[laughter]haha·[crying]boohoo·[screaming]ahh·[burping]burp·[humming]hmm·[sigh]uh·[sniff]sniff·[sneeze]achoo - Style:
[whispering]·[shouting]·[singing]·[narrating]·[storytelling]·[announcing]·[reporting]·[conversational] - Tone:
[serious]·[playful]·[formal]·[casual]·[confident]·[warm]·[friendly]·[calm]·[authoritative]·[sarcastic]·[dramatic]·[mysterious]
Tags go between words or between sentences — never inside a word. The dashboard exposes a one-click tag picker plus an Enhance text with AI button that injects them automatically (via POST /api/tts/enhance).
Example
curl -X POST "https://www.dubvoice.ai/api/v1/tts" \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"text": "[warm] Hello there. [pause] [excitement] Today is going to be amazing!",
"voice_id": "LB3SchLS4lHotJg4GcZW",
"model_id": "eleven_multilingual_v2",
"language": "auto",
"voice_settings": { "speed": 1.0, "context_chaining": false }
}'Response (immediate)
{ "task_id": "550e8400-e29b-41d4-a716-446655440000", "status": "pending", "characters": 30 }GET/api/v1/tts?task_id=<id>
Poll a single job. Returns status, audio URL, progress %, and error if any.
{
"task_id": "...", "status": "completed",
"result": "https://your-storage.supabase.co/.../final.mp3",
"characters": 30, "progress": 100,
"created_at": "...", "completed_at": "..."
}Statuses: pending → processing → completed | failed. Recommended poll interval: 3-5 seconds.
GET/api/v1/tts
Paginated list of your jobs: ?page=1&limit=20 (max 100).
Limits
- Up to 30 jobs in progress per user.
- 240 requests / minute per API key.
- Max text length: 500,000 chars per job.