Skip to main content
Stream audio chunks as they’re generated for lower latency. One request per connection cycle — for token-by-token text input and multi-turn sessions, use Stream Input.

Connection

Connect with your API key:

Request Message

Send a JSON message to start generation. Fields share the meaning and defaults of the Generate Speech parameters:
boolean
default:"false"
Enable word-level timestamp alignment. When enabled, a word_timestamps message is sent after the audio chunks with per-word timing data.
number
default:"1.0"
Playback speed multiplier. Range: 0.8 (20% slower) to 1.2 (20% faster). Uses pitch-preserving WSOLA.
integer[]
Per-request dictionary selection. With project_id, omission applies all active project dictionaries filtered by language; without project_id, none are loaded. [] opts out. A non-empty list requires project_id and applies exactly those project dictionaries (including inactive ones), bypassing the language filter. Also accepted in the config of /ws/tts/stream and /ws/tts/multi, where both fields are sticky for the session.
boolean
default:"true"
Prepend an internal speaker prefix to the text for better voice consistency.
Text Normalization: Set normalize: true to convert numbers, dates, and symbols to spoken words. Always specify language to ensure correct normalization — auto-detection may produce incorrect results for short texts.
Spell Tags in Streaming: You can use <spell> tags even when streaming text token-by-token. The system automatically buffers text until spell tags are complete before generating audio. If a stream ends with an incomplete tag (e.g., connection drops), the tag is auto-closed.

Update Settings Message

This socket is reusable across requests. Send an update_settings message to set sticky generation-parameter defaults that fill any field a later request omits — a per-request value still wins. The server replies with settings_updated.
Only those six generation parameters are updatable; every field is optional. Identity, project, dictionary, and audio-format fields (voice_id, model_id, sample_rate, output_format, project_id, dictionary_ids) are not — include one and the message is rejected with a VALIDATION_ERROR frame (the socket stays open).

Cancel Message (barge-in)

Abandons the request that is currently generating: no further audio frames are emitted for it and no final — the server acknowledges with interrupted instead. The socket stays open, so the next request can be sent immediately. A cancel with nothing in flight is acknowledged the same way. See Barge-in.

Response Messages

Audio Chunk

Field-by-field reference: Audio formats.

Word Timestamps (when word_timestamps: true)

Settings Updated

Acknowledges an update_settings message; settings holds the sticky generation-parameter defaults now in effect:

Interrupted

Acknowledges a cancel. It replaces final for that request — a cancelled request never finalizes:

Final Message

On this endpoint, final is the request-complete message and carries the request’s stats and usage. (The streaming endpoints emit a lighter end-of-audio final without usage, followed by session_closed — see Turn lifecycle.)
The usage object reports what this request consumed and what it was charged, so you can bill your own customers per request:

Example

Errors

WebSocket error frames use the same JSON error shape as HTTP responses:
WebSocket close codes are separate from the JSON code. See Error Codes for the full lookup table.