This page documents client-to-server events for the Qwen-ASR Realtime WebSocket API. Each section covers an event type, its parameters, and server responses.
Send session.update to configure audio format, language, and VAD settings.
Send input_audio_buffer.append repeatedly to stream audio data.
In Manual mode, send input_audio_buffer.commit to trigger recognition for a complete utterance. In VAD mode, the server triggers recognition automatically.
Send session.finish to end the session, then disconnect after receiving the session.finished response.
Configures the session. Send this immediately after establishing the WebSocket connection to set the audio format, the language, and VAD parameters. If omitted, defaults apply.The server responds with a session.updated event on success.
Audio sampling rate in Hz. Valid values: 16000, 8000. Default: 16000. Setting 8000 causes server-side upsampling to 16,000 Hz (minor delay). Use 8000 only for natively 8,000 Hz audio like telephony.
input_audio_transcription
object
No
Speech recognition settings.
input_audio_transcription.language
string
No
Language of the audio. See the supported languages table below.
input_audio_transcription.corpus.text
string
No
Context text for contextual biasing -- background text, entity vocabularies, or reference material that improves recognition accuracy. Maximum: 10,000 tokens.
turn_detection
object
No
VAD configuration. Set to null for Manual mode. If present, VAD mode is enabled.
turn_detection.type
string
Required when turn_detection is set
Fixed value: server_vad.
turn_detection.threshold
float
No
VAD sensitivity threshold. Default: 0.2. Valid range: [-1, 1]. Lower values increase sensitivity (may trigger on background noise). Higher values reduce sensitivity and avoid false triggers in noisy environments. See recommended VAD presets below.
turn_detection.silence_duration_ms
integer
No
Silence duration in milliseconds marking utterance end. Default: 800. Valid range: [200, 6000]. Shorter durations (e.g., 300 ms) speed up responses but may split natural pauses. Longer durations (e.g., 1,200 ms) handle pauses better but increase latency. See recommended VAD presets below.
Triggers recognition for all audio in the buffer as a single utterance. Use in Manual mode when your application controls utterance boundaries (e.g., push-to-talk).Disabled in VAD mode.The server responds with an input_audio_buffer.committed event on success.
Ends the session. Server response depends on speech detection:
Speech detected: The server completes final recognition, sends a conversation.item.input_audio_transcription.completed event with the result, then sends a session.finished event.
No speech detected: The server sends session.finished directly.
After receiving session.finished, disconnect the WebSocket connection.