Stream text and receive base64-encoded 24 kHz PCM audio over an authenticated WebSocket.
{"text":" "} immediately after connecting. This initialization space is not billed.audio chunks. Set flush:true to finish a segment without closing the connection. Audio may arrive before a flush.{"text":""} to end input. Keep receiving until {"isFinal":true}, then the connection closes.Output streams automatically. Only automatic generation is supported. There is no public flush-completion event; isFinal completes the whole connection. See the TTS input streaming guide for a runnable example.
Select Standard (qwen3-tts) or Fast (qwen3-tts-fast).
Raw 24 kHz PCM16 mono audio; no WAV header.
Use auto or the selected voice’s language code.
Random seed used for each segment; defaults to 0.
Seconds without incoming messages before the connection closes; defaults to 20.
Omit or set to true; false is rejected.
Only false is supported; alignment is unavailable.
Only false is supported; SSML is unavailable.
Only off is supported.
Send {"text":" "} once to initialize the connection.
Append text. Set flush:true to finish the current segment and keep the connection open.
Send empty text and keep receiving until isFinal arrives.
Decode the base64 audio as raw PCM16 at 24 kHz. Chunks arrive in order.
The isFinal:true message confirms that all audio for the connection has been sent.
A terminal error may be followed by a non-1000 WebSocket close.