WebSocket client reference
This topic describes the client events for the qwen3.5-livetranslate-flash-realtime API.
Establish a WebSocket connection to start a session. The server sends a
Full URL:
Updates the session configuration after you connect. The server validates parameters and returns the full configuration, or an error if any value is invalid.
Example with both the source and target languages set to English and text and audio output skipped:
Appends audio bytes to the input buffer. The server uses this buffer for speech detection and submission timing.
Commits the input audio buffer. This event only needs to be sent in Manual mode (
Clears uncommitted audio data from the input audio buffer.
Adds image data to the buffer from a local file or a real-time video stream.
Image limits:
Ends the session. The server responds based on whether it detected speech:
Reference: Speech translation.
Connect
Establish a WebSocket connection to start a session. The server sends a session.created event when the connection is ready.
| Configuration | Value |
|---|---|
| Endpoint | wss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime |
| Query parameter | model=qwen3.5-livetranslate-flash-realtime |
| Auth header | Authorization: Bearer $DASHSCOPE_API_KEY |
| Protocol | JSON text frames |
session.update
Updates the session configuration after you connect. The server validates parameters and returns the full configuration, or an error if any value is invalid.
Example
string
body
required
Always
"session.update".object
body
Session configuration.
input_audio_buffer.append
Appends audio bytes to the input buffer. The server uses this buffer for speech detection and submission timing.
Example
string
body
required
Always
"input_audio_buffer.append".string
body
required
Base64-encoded audio data.
input_audio_buffer.commit
Commits the input audio buffer. This event only needs to be sent in Manual mode (turn_detection set to null). In VAD mode, the server commits automatically and the client does not need to send this event.
Upon receiving this event, the server returns an input_audio_buffer.committed event as confirmation and automatically starts generating a translation response (no additional event is needed to trigger the response). If the audio buffer is empty, the server returns an error event.
Example
string
body
required
Event type. Must be set to
input_audio_buffer.commit.input_audio_buffer.clear
Clears uncommitted audio data from the input audio buffer.
Example
string
body
required
Event type. Must be set to
input_audio_buffer.clear.input_image_buffer.append
Adds image data to the buffer from a local file or a real-time video stream.
Image limits:
- Format: JPG or JPEG. Recommended resolution: 480p or 720p. Maximum: 1080p.
- Maximum size: 500 KB (before Base64 encoding).
- Must be Base64-encoded.
- Maximum rate: 2 images per second.
- You must send at least one
input_audio_buffer.appendevent first.
Example
string
body
required
Always
"input_image_buffer.append".string
body
required
Base64-encoded image data.
session.finish
Ends the session. The server responds based on whether it detected speech:
- Speech detected: The server finishes recognition and sends conversation.item.input_audio_transcription.completed with the result, then sends session.finished.
- No speech detected: The server sends session.finished directly.
session.finished.
Example
string
body
required
Always
"session.finish".