/ttsSynthesize text to a WAV file, or stream raw PCM chunks with `streaming: true`.
Synthesize Speech
Converts text to audio in a single request.WAV mode. The default. The response body is a complete audio/wav file. The header carries X-Sample-Rate: 24000.Streaming mode. Set streaming: true for real-time audio, ready to play as the model speaks it. The response is audio/pcm with Transfer-Encoding: chunked and X-Encoding: pcm16. The body is contiguous little-endian signed 16-bit PCM at 24 kHz, mono, with no header or framing. Read the chunks in order and feed them straight into a 24 kHz mono playback buffer.Output format. Audio is 24 kHz, 16-bit, mono. WAV mode returns RIFF-headered audio/wav; streaming mode returns raw audio/pcm. Other codecs and sample rates are not currently exposed.
Request body
4textstringrequiredText to synthesize. 1–650 characters per request; every character counts toward billing. Use
POST /tts/batchfor longer scripts.languagestringoptionalCurrently supports
english(default) andfrench; more languages are on the roadmap.voice_idstringoptionalVoice identifier from
GET /voices. Omit this field to use the deployment default voice; legacy clients may passdefaultwith the same effect.streamingbooleanoptionalSet
truefor chunked PCM16 streaming instead of a complete WAV file. Defaultfalse.
Errors
4The voice_id resolves but has no active TTS model bound to it. The server returns the detail string "Voice not linked to an active TTS model" verbatim — match on that string.
Check the ID with GET /voices, or omit voice_id to use the default.
The text is over the 650-character synchronous TTS safety cap. The request returns 413 before synthesis starts.
Use POST /tts/batch for long-form text, or split the text at sentence boundaries and synthesize shorter realtime chunks.
text is empty or longer than the schema ceiling, language is not english/french, or one word in text is too long to speak (a long code, token or URL with no spaces). The error field gives the reason.
Send 1–650 characters of text and a supported language code, and write long codes with spaces between groups. For longer copy, use POST /tts/batch.
The synthesis service is starting up or scaling.
Retry after a short delay. A freshly-deployed voice may take a minute or two to warm up.
