Client events are JSON messages sent over a WebSocket connection to control the Qwen-TTS Realtime API session -- configure voice settings, stream text for synthesis, and signal completion.
Configures the session. Send as the first message after the WebSocket connection is established. If omitted, all parameters use defaults. The server confirms with a session.updated event.
Note: Not supported by the Qwen-TTS-Realtime series. See Supported models.
pitch_rate
Type: float | Required: No | Default: 1.0 | Range: 0.5--2.0The pitch of the synthesized audio.
Note: Not supported by the Qwen-TTS-Realtime series. See Supported models.
bit_rate
Type: integer | Required: No | Default: 128 | Range: 6--510Audio bitrate in kbps. Higher values produce better quality but larger files. Only applies when response_format is opus.
Note: Not supported by the Qwen-TTS-Realtime series. See Supported models.
instructions
Type: string | Required: No | Default: None | Max length: 1600 tokensControls style and expressiveness of synthesized speech. For details, see Real-time speech synthesis - Qwen.Supported languages: Chinese and English only.
Note: Available for the Qwen3-TTS-Instruct-Flash-Realtime series only.
optimize_instructions
Type: boolean | Required: No | Default: falseWhen true, rewrites instructions to improve naturalness and expressiveness. Enable for use cases requiring fine-grained vocal control.Has no effect if instructions is empty.
Note: Available for the Qwen3-TTS-Instruct-Flash-Realtime series only.
Commits buffered text and creates a user message item. The server responds with an input_text_buffer.committed event.Returns an error if the buffer is empty.Behavior differs by mode:
server_commit mode: All buffered text is synthesized immediately. The server stops caching and processes everything at once.
commit mode: Creates user message item from buffered text.
Note: Committing the buffer triggers synthesis only -- it does not generate a model response.