API guides

Text-to-speech API guide: ElevenLabs and Gemini TTS

Call ElevenLabs and Gemini TTS with one DreamTo API key: request bodies, preset voices, stability and style controls, limits, prices and which model to pick.

A vintage studio microphone with ribbons of coloured sound flowing across the dark
On this page

DreamTo serves five text-to-speech models through one asynchronous task API: three from ElevenLabs (Eleven v3 Text to Dialogue, Multilingual v2 and Turbo v2.5) and two from Google (Gemini 3.8 Flash TTS and Flash-Lite TTS). You send text and a voice, poll a task, and download an audio file.

The endpoints are shared, but the input object is not. Multilingual v2 takes one text, Eleven v3 takes a dialogue list, and the Gemini models take speakers plus dialogue_turns. Undeclared fields are rejected with code: 422, so a body written for one model fails on another. This guide covers each body, its limits, the prices, and how to choose.

The task flow all five models share#

The base URL is https://api.dreamto.ai, and the API key goes in an Authorization: Bearer header. The authentication page explains how to create a key.

  1. POST /api/v1/jobs/createTask with model and an input object. The body accepts only model, callBackUrl and input.
  2. Read data.taskId from the response.
  3. Poll GET /api/v1/jobs/recordInfo?taskId=... about every 5 seconds until data.state is success or fail, or pass a callBackUrl and let DreamTo call you.
  4. On success, download the file from data.response.resultUrls[0]. On failure, data.failCode and data.failMsg give the reason.

Both endpoints always answer with HTTP status 200. The code field in the body carries the outcome: 200 for success, 401 for a missing or invalid key, 402 for an insufficient balance, 422 for an invalid request, 429 for a rate limit and 500 for a server error. When code is not 200, msg holds the reason. A 422 creates no task and charges nothing.

Audio links work without an API key and support Range requests. They stay valid for about 14 days after the task is created, so copy the file to your own storage.

The Python samples in this article reuse one helper. Save it as tts.py and set DREAMTO_API_KEY in your environment:

python
import osimport timeimport requestsBASE_URL = "https://api.dreamto.ai"HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}def run_task(model: str, task_input: dict, out_path: str) -> None:    payload = {"model": model, "input": task_input}    created = requests.post(        f"{BASE_URL}/api/v1/jobs/createTask", headers=HEADERS, json=payload, timeout=60    ).json()    if created["code"] != 200:        raise SystemExit(f"{created['code']}: {created['msg']}")    task_id = created["data"]["taskId"]    while True:        record = requests.get(            f"{BASE_URL}/api/v1/jobs/recordInfo",            headers=HEADERS,            params={"taskId": task_id},            timeout=60,        ).json()["data"]        if record["state"] in ("success", "fail"):            break        time.sleep(5)    if record["state"] != "success":        raise SystemExit(f"{record['failCode']}: {record['failMsg']}")    audio = requests.get(record["response"]["resultUrls"][0], timeout=300)    with open(out_path, "wb") as f:        f.write(audio.content)    print("saved", out_path)

The ElevenLabs models return MP3 and the Gemini models WAV (16-bit PCM, 24 kHz, mono), so name the output file to match.

The five models at a glance#

ModelModel IDSpeakersOutputBilled by
Eleven v3 Text to Dialogueelevenlabs/text-to-dialogue-v3Several, one voice per lineMP3Characters
Eleven Multilingual v2elevenlabs/tts-multilingual-v2OneMP3Characters
Eleven Turbo v2.5elevenlabs/tts-turbo-2-5OneMP3Characters
Gemini 3.8 Flash TTSgemini-3.8-flash-tts1 or 2WAVTokens
Gemini 3.8 Flash-Lite TTSgemini-3.8-flash-lite-tts1 or 2WAVTokens

The catalog describes Turbo v2.5 as an earlier low-latency model that ElevenLabs has deprecated, so start new projects on one of the other four.

All five run in the playground without code, for example Eleven v3 dialogue, Multilingual v2 and Gemini 3.8 Flash TTS. The model pages for those three are Eleven v3 Text to Dialogue, Multilingual v2 and Gemini 3.8 Flash TTS.

ElevenLabs Multilingual v2: one voice, up to 5,000 characters#

Multilingual v2 has the simplest body: text holds the script, voice picks a preset, and four optional numbers shape the result. The model docs list the fields:

FieldRangeDefaultWhat it does
text1-5,000 charactersrequiredThe text to speak; blank text is invalid
voicepreset ID or namerequiredThe ID is case-sensitive, the name is not
stability0-10.5Lower is more expressive, higher more consistent
similarity_boost0-10.75How closely the output sticks to the original voice
style0-10Style exaggeration; higher values can cost stability
speed0.7-1.21Below 1 is slower, above 1 faster; values near either end may affect quality
language_codeISO 639-1autoOmit it or send an empty string to detect the language

A complete call with the helper:

python
from tts import run_taskrun_task(    "elevenlabs/tts-multilingual-v2",    {        "text": "Welcome to the show. Today we are looking at how one API key can reach models from many providers.",        "voice": "Lily",        "stability": 0.5,        "similarity_boost": 0.75,        "style": 0,        "speed": 1,        "language_code": "en",    },    "narration.mp3",)

Length is counted in Unicode characters, so one CJK character counts as one. Split scripts longer than 5,000 characters into several tasks and join the audio in your application. Generation is nondeterministic: the same request can come back with slightly different delivery and timing.

Turbo v2.5 (elevenlabs/tts-turbo-2-5) takes the same fields. Its docs recommend setting language_code for more accurate pronunciation.

The 20 preset voices#

ElevenLabs voices on DreamTo are presets; custom voices and voices outside the list are not supported. voice accepts the voice ID or the preset name, and the suggested default is pNInz6obpgDQGcFmaJgB (Adam). Three of the 20, as the docs describe them: Alice (clear, engaging educator), Daniel (steady broadcaster) and Lily (velvety actress). All three ElevenLabs models use the same 20 voices.

Eleven v3 Text to Dialogue: several voices in one file#

Eleven v3 Text to Dialogue replaces the single text with dialogue, an ordered list of lines, each with its own text and voice. The result is one MP3 of the whole conversation. The model docs give these rules:

  • dialogue needs at least one line, and the lines are spoken in order. One voice may speak several lines.
  • All text values together can hold at most 5,000 characters. ElevenLabs recommends keeping a dialogue to about 2,000 for reliable results and splitting longer scripts into several tasks.
  • stability accepts only three values: 0 (creative), 0.5 (natural, the default) and 1 (robust).
  • language_code is one of the ISO 639 codes listed in the docs, such as zh, en or ja; the catalog puts the coverage at 70+ languages. Omit it to detect the language.
  • similarity_boost, style and speed do not exist on this model.

Audio tags and the stability setting#

Square-bracket audio tags in a line change the delivery at that point or add a sound event. The docs use [giggling], [sigh], [whispering], [applause], [laughs] and [excited] as examples, and note that tags are still under active development, so results may vary. Dashes and ellipses also shape pauses.

stability decides how much the tags matter. At 0 the model is the most expressive and the most responsive to tags, but the delivery may be unstable or drift from the text. At 1 it is the steadiest, but less responsive to emotional direction and tags. If tags seem to be ignored, check stability before you rewrite the script. A three-line request:

bash
curl -X POST "https://api.dreamto.ai/api/v1/jobs/createTask" \  -H "Authorization: Bearer $DREAMTO_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "elevenlabs/text-to-dialogue-v3",    "input": {      "dialogue": [        {          "text": "Did you hear the news? They finally opened the new bakery downtown.",          "voice": "Adam"        },        {          "text": "[excited] Really? I have been waiting for months! Let us go this weekend.",          "voice": "Sarah"        },        {          "text": "Deal. [laughs] I will bring the coffee.",          "voice": "Adam"        }      ],      "stability": 0.5,      "language_code": "en"    }  }'

Gemini 3.8 Flash TTS and Flash-Lite TTS: speakers and per-line style#

The two Gemini models share one request shape. Speakers are declared once, and each line refers to a speaker and can carry its own style. The Flash TTS docs and the Flash-Lite TTS docs list the fields:

FieldValues
speakersRequired, 1-2 entries; speaker_id in the format Speaker N, no repeats
speakers[].voice_nameOptional, one of 70 preset voices, case-sensitive; default Fola
speakers[].replicaOptional voice clone, used instead of voice_name; see below
dialogue_turnsRequired, at least one line; each speaker_id must be declared in speakers
dialogue_turns[].textRequired, up to 10,000 characters per line; may contain audio tags
dialogue_turns[].styleOptional free-form tone, emotion and pace for that line
temperatureOptional, 0-2, default 1; higher values make the delivery more varied
filler_wordsOptional, false (default) or true; only takes effect with two speakers

text is read verbatim, so put tone, emotion and pace in style, not in the line. Non-verbal sounds go inside text as angle-bracket tags such as <laugh>, <sigh>, <gasp> and <short pause>. With two speakers, filler_words adds "um" and "uh" to the dialogue; with one speaker it does nothing. There is no language field: per the catalog, the model detects the input language.

A single narrator on Flash-Lite TTS, the cheaper of the two:

python
from tts import run_taskrun_task(    "gemini-3.8-flash-lite-tts",    {        "temperature": 1,        "speakers": [{"speaker_id": "Speaker 1", "voice_name": "Fola"}],        "dialogue_turns": [            {                "speaker_id": "Speaker 1",                "text": "Your order has shipped. It should arrive on Thursday.",                "style": "Warm, unhurried and clear, like a helpful store assistant.",            }        ],    },    "notification.wav",)

A two-speaker scene on Flash TTS, from the docs example:

bash
curl -X POST "https://api.dreamto.ai/api/v1/jobs/createTask" \  -H "Authorization: Bearer $DREAMTO_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "gemini-3.8-flash-tts",    "input": {      "temperature": 1,      "speakers": [        {"speaker_id": "Speaker 1", "voice_name": "Fola"},        {"speaker_id": "Speaker 2", "voice_name": "Zephyr"}      ],      "dialogue_turns": [        {          "speaker_id": "Speaker 1",          "text": "Hello there. <laugh> That works.",          "style": "Speak like a tired night-shift radio host, slow and dry."        },        {          "speaker_id": "Speaker 2",          "text": "Wait, did you hear that? <gasp> I think it actually worked.",          "style": "Bright and curious, slightly faster."        }      ]    }  }'

The 70 preset voices#

The docs group the 70 presets into ten use cases, among them tutor, commercial voiceover, podcast, storyteller, call center and tech support. For example, Kore and Zeno are listed under commercial voiceover, Alnilam and Rami under podcast, and Fola (the default) and Puck under call center. Voice names are case-sensitive.

One-off voice cloning#

Both Gemini models accept a clone through speakers[].replica in place of voice_name:

json
{  "speaker_id": "Speaker 1",  "replica": {    "source_audio_url": "https://example.com/voice-sample.wav",    "consent_audio_url": "https://example.com/voice-consent.wav"  }}

Both URLs are required and must point to directly downloadable WAV files of up to 10 MB each. The docs set these rules:

  • The clone applies to that task only and is not saved as a reusable voice.
  • Both recordings must be of the same adult, made with the same microphone in the same room. AI-generated audio is rejected.
  • The source recording should be 10-30 seconds of natural speech in a quiet room, in the language you will generate.
  • The consent recording must read the consent sentence from the docs verbatim.

Only clone voices you have the right to use. Every clip these models generate carries an imperceptible SynthID watermark. The docs give 130 languages for Flash TTS and 101 for Flash-Lite TTS.

Which model to pick#

  • Several voices in one file, with audio tags steering the delivery: Eleven v3 Text to Dialogue, ideally about 2,000 characters per task.
  • Two speakers with direction for each line, stable over long output: Gemini 3.8 Flash TTS, with style on every turn.
  • One narrator on long text, accents preserved: Multilingual v2, in chunks of up to 5,000 characters.
  • High-volume read-aloud and short clips such as app prompts: Gemini 3.8 Flash-Lite TTS.
  • A cloned voice, with consent: either Gemini model, with replica.
  • MP3 output: the ElevenLabs models. The Gemini models return WAV.

Before you build a pipeline, run one short script through two candidates in the playground and listen to both.

Prices as of December 2026#

These are the DreamTo prices as of December 2026. They change, so treat the prices page as the source of truth.

ModelUnitPrice
Eleven v3 Text to Dialogueper 1M characters$68
Eleven Multilingual v2per 1M characters$59.5
Eleven Turbo v2.5per 1M characters$29.75
Gemini 3.8 Flash TTSper 1M tokens$0.375 input, $6.75 audio output
Gemini 3.8 Flash-Lite TTSper 1M tokens$0.375 input, $4.5 audio output

The model docs quote the list prices before discount. The prices above include the current discount of 15% on the ElevenLabs models and 25% on the Gemini models.

ElevenLabs billing counts every character you send, with audio tags, spaces, punctuation and line breaks included. Gemini audio output is billed at 25 tokens per second of returned audio, which works out to about $0.0101 per minute on Flash TTS and $0.0068 on Flash-Lite TTS at these prices. Gemini input tokens are estimated from all lines and styles. The balance is checked when the task is created, and invalid requests and failed tasks are not charged.

Callbacks instead of polling#

In a service, pass callBackUrl, a public http or https URL, in the create request. DreamTo sends one POST there when the task succeeds or fails. The outer code is 200 on success or 501 on failure, and data is the same object the query endpoint returns. Answer with any 2xx within 10 seconds. Otherwise the delivery is retried after 1, 5 and 30 minutes, at most four deliveries in total, so handle the callback idempotently by data.taskId.

If you have generated a webhook signing secret on the API Key page of the console, each callback carries X-DreamTo-Signature: the hex HMAC-SHA256 of X-DreamTo-Timestamp, data.taskId and the status, joined with periods. That status is success or failed, not the fail of data.state. Verification code is in the task callback docs; the sample body there belongs to the video task API, so for these models read the task ID from data.taskId.

Suno music tasks are created through the same endpoint; see the Suno music guide. For video tasks and webhooks, see the image-to-video guide. Every available model is listed on /models.

FAQ#

Which text-to-speech models can I call through DreamTo?#

Five: ElevenLabs Eleven v3 Text to Dialogue, Multilingual v2 and Turbo v2.5, and Google's Gemini 3.8 Flash TTS and Flash-Lite TTS. All use POST /api/v1/jobs/createTask with a model and an input object whose fields differ per model.

How long can the text be?#

Multilingual v2 and Turbo v2.5 accept 1 to 5,000 characters per task. Eleven v3 Text to Dialogue takes at most 5,000 characters across all lines, and ElevenLabs recommends about 2,000 for reliable results. The Gemini models allow up to 10,000 characters per line. Split longer ElevenLabs scripts into several tasks and join the audio yourself.

Can I use my own cloned voice?#

Only with the Gemini models, and only for one task at a time. You pass replica with a WAV source recording and a WAV consent recording, each up to 10 MB, and the clone is not saved. The ElevenLabs models on DreamTo support preset voices only.

What audio format do I get back?#

MP3 from the ElevenLabs models, and WAV (16-bit PCM, 24 kHz, mono) from the Gemini models. The download link stays valid for about 14 days after the task is created.

How do I make a voice sound more emotional?#

On Eleven v3, add audio tags such as [excited] or [whispering] and keep stability at 0 or 0.5, because 1 is less responsive to tags. On Multilingual v2, lower stability or raise style, which can cost stability. On the Gemini models, write the direction into each turn's style and use tags like <sigh> in the text.

How is text-to-speech billed?#

The ElevenLabs models are billed per character of text sent. The Gemini models are billed per token, with text input and audio output priced separately. Failed tasks and invalid requests are not charged. The prices page has the current numbers; the table above is as of December 2026.

  • Text to Speech
  • ElevenLabs
  • Gemini TTS