qwen3-livetranslate-flash translates audio and video through the OpenAI-compatible chat completions endpoint. All requests are streamed.
Related documentation: Audio and video file translation - Qwen
The DashScope interface is not supported.
OpenAI compatible
POST
https://WorkspaceId.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completionsPOST
https://WorkspaceId.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions- Beijing region
- Singapore region
The
base_url configured for SDK calls is: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1The endpoint configured for HTTP calls: POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completionsYou must have obtained and configured an API key and configured the API key as an environment variable. If you call the API through the OpenAI SDK, you must install the SDK.
Request body
modelstring(required)messagesarray(required)Message types
Message types
User Messageobject(required)Properties
Properties
contentarray(required)Properties
Properties
typestring(required)-
input_audioSet it toinput_audiowhen inputting audio. -
video_urlSet it tovideo_urlwhen inputting a video file.
input_audioobjecttype is input_audio.Properties
Properties
datastring(required)formatstring(required)mp3 or wav.video_urlobjecttype is video_url.Properties
Properties
urlstring(required)rolestring(required)user.streamboolean(required)falseWhether to return responses in streaming mode. The model only supports streaming output, so it can only be set to true.stream_optionsobject(optional)stream is true.Properties
Properties
include_usageboolean(optional)falseWhether to include token usage information in the last data chunk.Valid values:true: included;false: not included.
modalitiesarray(optional)["text"]The modality of the output data. Valid values:["text","audio"]: outputs both text and audio;["text"]: outputs text only.
audioobject(optional)modalities parameter must be ["text","audio"].Properties
Properties
voicestring(required)formatstring(required)wav is supported.max_tokensinteger(optional)seedinteger(optional)seed is passed and the other parameters remain unchanged, the model tries to return the same result.Value range: [0,2 31 −1].speech_ratefloat(optional)temperaturefloat(optional)top_pfloat(optional)presence_penaltyfloat(optional)top_kinteger(optional)extra_body={"top_k": xxx}. When calling through the Node.js SDK or HTTP, pass it as a top-level parameter.repetition_penaltyfloat(optional)extra_body={"repetition_penalty": xxx}. When calling through the Node.js SDK or HTTP, pass it as a top-level parameter.translation_optionsobject(required)Properties
Properties
source_langstring(optional)target_langstring(required)extra_body={"translation_options": xxx}. When calling through the Node.js SDK or HTTP, pass it as a top-level parameter.python
chat response chunk object (streaming output)
idstringchoicesarrayinclude_usage parameter is set to true, choices is an empty array in the last chunk.Properties
Properties
deltaobjectProperties
Properties
contentstringreasoning_contentstringnull.function_callobjectnull.audioobjectProperties
Properties
datastringexpires_atintegeridstringrefusalobjectnull.rolestringtool_callsarraynull.finish_reasonstringstopwhen the output stops naturally;nullwhen the generation is not finished;lengthwhen the generation ends due to excessive length.
indexintegerchoices array, fixed to 0.logprobsobjectnull.createdintegermodelstringobjectstringchat.completion.chunk.service_tierstringnull.system_fingerprintstringnull.usageobjectinclude_usage is true.Properties
Properties
completion_tokensintegerprompt_tokensintegertotal_tokensintegerprompt_tokens and completion_tokens.completion_tokens_detailsobjectProperties
Properties
audio_tokensintegerreasoning_tokensintegernull.text_tokensintegerprompt_tokens_detailsobjectProperties
Properties
audio_tokensintegerThe number of audio tokens in the video file is returned through this parameter.
text_tokensintegervideo_tokensinteger