qwen3-livetranslate-flash translates audio and video through the OpenAI-compatible chat completions endpoint. All requests are streamed.
Note: The DashScope interface is not supported.
Supported models
qwen3-livetranslate-flashqwen3-livetranslate-flash-2025-12-01
Prerequisites
Before you begin, complete the following:
- Create an API key
- Configure the API key as an environment variable
- Install the OpenAI SDK (for Python or Node.js)
Endpoints
Region | SDK | HTTP endpoint |
|---|---|---|
Singapore |
|
|
Beijing |
|
|
{WorkspaceId} with your actual workspace ID.
Quick start
The following examples translate an audio file and return both translated text and audio through streaming. Replace the base_url if you use the Beijing region.
Python
Node.js
curl
Video input
To translate video instead of audio, set the content type to video_url:
Request body
Required parameters
Parameter | Type | Description |
|---|---|---|
| string | Model name. Valid values: |
| array | An array of messages. Only one user message is supported. |
| boolean | Must be |
| object | Translation configuration. See Translation options. This is a non-standard OpenAI parameter. In the Python SDK, pass it inside |
Optional parameters
Parameter | Type | Default | Description |
|---|---|---|---|
| array |
| Output modality. Set to |
| object | - | Output audio configuration. Required when |
| object | - | Streaming configuration. See Stream options. |
| integer | Model maximum | The maximum number of tokens to generate. Generation stops at this limit or when complete. |
| integer | - | Random seed for reproducibility. The same seed produces identical output for identical requests. Range: |
| float | 1.0 | Controls the speed of the output audio. 1.0 is normal speed, less than 1.0 is slower, greater than 1.0 is faster. Range: [0.5, 2.0]. |
Sampling parameters
For translation accuracy, keep these parameters at their default values.
Parameter | Type | Default | Range | Notes |
|---|---|---|---|---|
| float | 0.000001 | [0, 2) | Controls output diversity. |
| float | 0.8 | (0, 1.0] | Nucleus sampling threshold. |
| float | 0 | [-2.0, 2.0] | Reduces repetition when positive. |
| integer | 1 | >= 0 | Candidate set size. If the value is |
| float | 1.05 | > 0 | Penalizes repeated sequences. Non-standard OpenAI parameter. Python SDK: use |
Message object
The messages array must contain exactly one object with role set to user.
Properties ofcontentarray items:
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes |
|
| object | When | Audio input. See below. |
| object | When | Video input. See below. |
input_audioobject:
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | URL of the audio file, or a Base64 data URL. For local files, see Input a Base64-encoded local file. |
| string | Yes | Audio format, such as |
video_urlobject:
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Public URL of the video file, or a Base64 data URL. For local files, see Input a Base64-encoded local file. |
Translation options
Field | Type | Required | Description |
|---|---|---|---|
| string | No | Full English name of the source language. See Supported languages. If omitted, language is auto-detected. |
| string | Yes | Full English name of the target language. See Supported languages. |
Note:translation_optionsis a non-standard OpenAI parameter. In the Python SDK, pass it insideextra_body: In Node.js or HTTP, pass it at the top level of the request body.
Audio output options
Required when modalities is ["text", "audio"].
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Voice for the output audio. See Supported voices. |
| string | Yes | Output audio format. Only |
Stream options
Field | Type | Default | Description |
|---|---|---|---|
| boolean |
| When |
Response
The API returns a series of streaming chunks, each as a chat.completion.chunk object. Chunks fall into three categories: text, audio, and token usage.
Text chunk
Contains incremental translated text in choices[0].delta.content:
Audio chunk
Contains incremental Base64-encoded audio in choices[0].delta.audio.data:
Token usage chunk
Returned as the final chunk when include_usage is true. The choices array is empty, and usage contains the token breakdown:
Note: For video input,prompt_tokens_details.audio_tokensincludes the audio tokens extracted from the video.video_tokensreports the video-specific token count.
Response fields
Field | Type | Description |
|---|---|---|
| string | The request identifier. Identical across all chunks. |
| array | Generated content. Empty in the final usage chunk. |
| string | Incremental translated text. |
| object | Incremental audio data. |
| string | Base64-encoded audio segment. |
| string | Unique identifier for the output audio. |
| integer | Timestamp when the request was created. |
| string | Message role. Present only in the first chunk. |
| string |
|
| integer | Always |
| integer | Unix timestamp for the request. Identical across all chunks. |
| string | The model name. |
| string | Always |
| object | Token consumption. Present only in the final chunk when |
| integer | Total input tokens. |
| integer | Total output tokens. |
| integer | Sum of |
| integer | Output audio tokens. |
| integer | Output text tokens. |
| integer | Input audio tokens. For video input, this includes audio extracted from the video. |
| integer | Input text tokens. Always |
| integer | Input video tokens. Present only for video input. |
Fields fixed to null
The following fields are present in the response for OpenAI compatibility but always return null:
reasoning_content, function_call, refusal, tool_calls, logprobs, service_tier, system_fingerprint
Usage notes
- Streaming only. Set
streamtotrue. Non-streaming calls are unsupported. - Single message. The
messagesarray accepts one user message only. - Non-standard parameters.
translation_options,top_k, andrepetition_penaltyare not in the standard OpenAI API. Python SDK: pass inextra_body. Node.js/HTTP: include at top level. - Sampling defaults. Defaults for
temperature,top_p,top_k,presence_penalty, andrepetition_penaltyare optimized for translation accuracy. Changing them may degrade quality. - Output audio format. Only
wavis supported. - Automatic language detection. If
source_langis omitted, the input language is auto-detected.
References
- Audio and video translation overview
- Supported voices
- Supported languages
- Model selection
- Create an API key
- Configure API key as an environment variable
- Install the SDK
- Input a Base64-encoded local file