Qwen-LiveTranslate-Realtime WebSocket access
Scope of Application
This document is intended for Qwen-LiveTranslate-Realtime; the example model is qwen3.8-livetranslate-flash-realtime. The series of guides also covers qwen3.5-livetranslate-flash-realtime and the snapshot version qwen3.5-livetranslate-flash-realtime-2026-05-19. Configurations and event fields differ between 3.8 and 3.5; consult the event reference for the selected model.
- Use the API Key and Workspace ID corresponding to your selected region and workspace.
- Beijing domain:
{WorkspaceId}.cn-beijing.maas.aliyuncs.com; Singapore domain:{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com. - Long-term API keys are stored on the server and should not be placed in browsers or mobile applications.
Addresses and Authentication
Beijing: wss://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api-ws/v1/realtime?model=qwen3.8-livetranslate-flash-realtime
Singapore: wss://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api-ws/v1/realtime?model=qwen3.8-livetranslate-flash-realtime
For details on other domains, see Python SDK.
Set Authorization: Bearer <API_KEY> in the WebSocket handshake request header. Replace the workspace ID and the actual model name; do not place long-term API keys in browsers or mobile apps.
An optional user-agent request header is used to identify the client. General WebSocket integration documentation also lists X-DashScope-WorkSpace (workspace ID) and X-DashScope-DataInspection (data compliance check configuration), which are used as required by the model.
For instructions on generating temporary API keys and their permissions, see Generate Temporary API Key.
Session Configuration
Send session.update after establishing the connection and receiving session.created. Send input only after receiving session.updated confirmation; handle errors via error events.
The following examples apply to qwen3.8-livetranslate-flash-realtime; other versions use configurations from their respective event references—do not mix field levels. The example enables real-time voice cloning, where frequency: once extracts the input voice tone once at the start of the session and reuses it afterward, suitable for single-person scenarios. For details, see Voice Cloning.
qwen3.5-livetranslate-flash-realtime, the configuration and events differ from the above 3.8 example:
- Output mode uses
modalitiesinsession; the available values and default are the same asoutput_modalitiesin 3.8. - The source language can be specified via
languagein theinput_audio_transcriptionobject ofsession; if omitted, automatic recognition is used. - Incremental source text recognition uses
conversation.item.input_audio_transcription.text; 3.8 usesconversation.item.input_audio_transcription.delta. - For text-only output, 3.5 returns translation increments via
response.text.text, and 3.8 usesresponse.text.delta. For text and audio output, 3.5 returns translation increments viaresponse.audio_transcript.text, and 3.8 usesresponse.audio_transcript.delta.
Input, Results, and Termination
Audio is sent via input_audio_buffer.append; input formats, submission conditions, and image input restrictions are described in Client Events. Handle results, status, and errors in Server Events; do not consider connection establishment as completion of a business request.
Real-time translation uses this model’s translation configuration and events; do not apply Omni’s response.create dialogue flow. After input ends, send session.finish, keep the connection open, and continue receiving remaining results; close the WebSocket connection only after receiving session.finished. If full playback of the translated audio is required, finish local playback first. Specific event fields are detailed in Client Events and Server Events.
Error Handling
When a handshake fails, verify the domain name, region, workspace, API Key, model name, and model activation status and permissions. After the connection is established, locate the issue based on the error event, and refer to Error Codes. Retain the event ID for troubleshooting; do not assume protocol support is lacking simply because there is no response.