Text-to-Speech (SSE)
Stream audio with extra metadata from a complete transcript
Authorizations
Cartesia API key (sk_car_...). Get one at play.cartesia.ai/keys.
Headers
Body
The ID of the model to use for the generation. See Models all options.
sonic-3.6, sonic-3.5, sonic-3, sonic-latest "sonic-3.6"
The transcript's language or locale (for example en or en-GB). language and locale accept the same values. Set one or the other, never both; setting both returns a 400 error. See supported codes.
The transcript's language or locale (for example en or en-GB). locale and language accept the same values. Set one or the other, never both; setting both returns a 400 error. See supported codes.
Usually unnecessary: Cartesia picks the closest accent the voice supports for the requested language or locale. Set it only to make a multilingual voice sound accented (e.g. speak English with a French accent). Must come from the voice's Get Voice accents field. Learn more here.
Text normalization. auto (default) runs the locale-aware normalizer, off skips it, or pass a language or locale code (for example en or en-IN) to pin the normalizer independently of the generation language. See Text Normalization.
Configure the various attributes of the generated speech. Available on sonic-3 and newer models; not available on earlier models.
See Volume, Speed, and Emotion for a guide on this option.
This can be any string value you find useful. The server will echo back the same context_id in events that it sends.
Contexts on the TTS (WebSocket) endpoint are used for continuations. > The TTS (SSE) endpoint does not support continuations, so most users just ignore this property.
Response
Server-sent events stream. Each frame is data: <json>\n\n where the JSON payload matches TTSSSEEvent.
- TTSSSEChunkEvent
- TTSSSETimestampsEvent
- TTSSSEPhonemeTimestampsEvent
- TTSSSEDoneEvent
- TTSSSEErrorEvent
Audio data chunk.