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.Update Settings Message
This socket is reusable across requests. Send anupdate_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.
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)
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
Word Timestamps (when word_timestamps: true)
Settings Updated
Acknowledges anupdate_settings message; settings
holds the sticky generation-parameter defaults now in effect:
Interrupted
Acknowledges acancel. 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:code. See
Error Codes for the full lookup table.