Model overview
Qwen-MT-Uni is a fully multimodal translation model for images, text, audio, and a wide range of document formats. Through a unified pipeline of format detection, intelligent routing, content extraction, cross-modal translation, and original-format reconstruction, it delivers high-fidelity, end-to-end translation across input types. The model supports both synchronous invocation (the request waits for processing and returns the result directly — suitable for text, images, and small files) and asynchronous invocation (add the header X-DashScope-Async: enable; the API returns a task_id and you poll the query endpoint — suitable for large documents and long audio).
The API follows the DashScope standard protocol. For synchronous calls, a top-level string code means failure (error code = code, reason = message); otherwise a top-level output object means success (result in output.Data, usage in usage). For asynchronous calls, poll the query endpoint until output.task_status = SUCCEEDED, then check output.Success: true = business success, false = business failure (see output.Code and output.Message for details).
Prerequisites
Obtain an API key and export it as an environment variable.
Supported input formats
- String: input
strorlist[str]; output keeps the same scalar/array shape. - PDF: input
.pdf; output.pdf. - Word: input
.docx; output.docx. - PowerPoint: input
.pptx; output.pptx. - Excel: input
.xlsx; output.xlsx. - TXT: input
.txt; output.txt. - HTML: input
.html,.htm; output.html. - Markdown: input
.md,.markdown,.mdown,.mkd; output.md. - Image: input
.png,.jpg,.jpeg; output.jpg. - Audio: input
.mp3,.wav; output.mp3.
- A single file must not exceed 100 MB; documents must not exceed 200 pages; audio duration must be between 3 seconds and 60 minutes.
- URLs must not contain non-ASCII characters.
- Legacy binary Word (
.doc) and PowerPoint (.ppt) must be converted to OOXML (.docx/.pptx) before submission.
Synchronous call
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation. Replace {WorkspaceId} with your actual Workspace ID.
In synchronous mode the request blocks until processing is complete and returns the translation result (text or translated file URL) directly. No polling required.
RequestRequest headersContent-Typestring(required)Content type. Must be application/json.Authorizationstring(required)Authentication credentials — an Alibaba Cloud Model Studio API key. Example: Bearer sk-xxxx.Request bodymodelstring (required)Model name. Set to qwen-mt-uni.input object (required)Input parameters, containing the following fields:
Properties fileUrl string (conditionally required)A publicly accessible HTTP(S) URL. The server automatically detects the modality (document / image / audio).
string | array<string> (conditionally required)A non-empty string or an array of non-empty strings. Batch translations preserve input order; the response preserves the scalar/array shape. Must provide exactly one of fileUrl or source_texts.source_lang string (optional)Source language code, e.g. zh. If omitted, the source language is auto-detected.target_lang string (required)Target language code or supported language name, e.g. ko. See Supported languages.ext object (optional)Extension fields.
Properties domainHint string (optional)English domain hint, up to 200 English words. Use it to shape translation style for a specific domain (usage scenario, tone, etc.).Example: These sentences are from seller-buyer conversations on a B2C ecommerce platform. Translate them into clear, engaging customer service language.format_hint string (optional)Format hint. Use when fileUrl has no recognizable file extension to explicitly declare the format, e.g. pdf, image.sensitives array (optional)Sensitive-word list, case-sensitive, up to 50 non-empty strings. When extracted text exactly matches an item, the original text is preserved and not sent to the model.Example: ["10% off site-wide", "7-day free return"]glossary array (optional)Glossary, up to 100 entries of {"src": "source text", "tgt": "target text"}. Currently applied as a prompt-level glossary; supports keeping the source unchanged, forcing a specific translation, and empty target values.Example: [{"src": "application programming interface", "tgt": "API"}, {"src": "machine learning", "tgt": "ML"}]config object (optional)
Properties imageSegment bool (optional)Applies to image inputs only. Whether to enable subject segmentation. When enabled, text on subjects (people, products, logos) is skipped during translation.
|
Response (success)outputobjectBusiness result envelope. Returned on success, omitted on failure.
Properties Success booleantrue if the business call succeeded.Code integerBusiness result code. 200 on success.Message stringResult message. Always Success on success.RequestId stringUnique request ID, useful for tracing.Data objectTranslation result.
Properties FileType stringResult type. One of strings / document / image / audio.TranslatedTexts string | array<string>Text translation result. Returned only when source_texts is provided. Preserves the scalar/array shape of the input.TranslatedFileUrl stringDownload URL of the translated file (signed, time-limited). Returned only when fileUrl is provided.objectTop-level token usage. Billed by input_tokens.
Properties input_tokens integerTotal input tokens.output_tokens integerTotal output tokens.total_tokens integerSum of input and output tokens.input_tokens_details objectPer-modality input token breakdown: document_tokens, audio_tokens, character_tokens, image_tokens.output_tokens_details objectPer-modality output token breakdown. Same fields as input_tokens_details.stringTop-level request ID. Returned on both success and failure.Response (failure)codestringError code string, e.g. InvalidParameter. Failure only.message stringError detail, e.g. InvalidParameter: <reason>. Failure only.request_id stringRequest ID. |
|
Asynchronous call
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation. Replace {WorkspaceId} with your actual Workspace ID.
Async invocation is a two-step flow:
- Submit task, receive task ID: send a request to create a task. The response returns a task ID (
task_id). - Poll for result by task ID: poll the query endpoint with
task_iduntil the task completes and returns the translated file URL or text.
Step 1: Submit task and receive task ID
- Once created, poll with the returned
task_id. Thetask_idis valid for 24 hours. Do not resubmit the same task; poll instead. - Request parameters are identical to the synchronous call except that the header
X-DashScope-Async: enablemust be added.
RequestRequest headersContent-Typestring(required)Content type. Must be application/json.Authorizationstring(required)Authentication credentials — an Alibaba Cloud Model Studio API key. Example: Bearer sk-xxxx.X-DashScope-Asyncstring(required)Async mode switch. Must be set to enable. Without this header the call runs synchronously.Request bodyThe body is identical to the synchronous call, includingmodel and the full input object (fileUrl/source_texts, source_lang, target_lang, ext, ...). |
ResponseoutputobjectTask output.
Properties task_id stringTask ID. Query validity is 24 hours.task_status stringTask status.
Enum values
stringUnique request ID for tracing. |
Save task_id to query task status and result. |
Step 2: Query result by task ID
GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
task_idis valid for 24 hours. If the ID does not exist or has expired, the task status returnsUNKNOWN.- The
TranslatedFileUrlreturned on success is valid for 24 hours. Download and save the file promptly. - The default RPS of this query endpoint is 1. For higher-frequency polling or event notifications, configure async task callback.
RequestRequest headersAuthorizationstring(required)Authentication credentials. Example: Bearer sk-xxxx.URL path parameterstask_idstring (required)Task ID returned by the create-task endpoint. |
Replace 86ecf553-d340-4e21-xxxxxxxxx with your actual task_id. |
ResponseField visibility: while task_status is PENDING / RUNNING, TranslatedFileUrl, TranslatedTexts, usage, and end_time are empty. Continue polling.objectTask status and result.
Properties task_id stringTask ID. Returned in all three states.task_status stringTask status. PENDING = queued; RUNNING = in progress; SUCCEEDED = finished. On business failure this is still SUCCEEDED; combine with output.Success to determine business success.submit_time stringSubmission time, format yyyy-MM-dd HH:mm:ss.SSS. Returned in success and failure examples.scheduled_time stringScheduling time, format yyyy-MM-dd HH:mm:ss.SSS. Returned in success and failure examples.end_time stringEnd time, format yyyy-MM-dd HH:mm:ss.SSS. Returned in success and failure examples.Success booleanWhether the business logic succeeded. true = success, false = failure. Not returned in the pending example.Code integerBusiness result code. 200 = success, 400 = invalid parameters. Not returned in the pending example.Message stringBusiness result message. Success on success; on failure, e.g. InvalidParameter: missing required field: input.target_lang.RequestId stringBusiness request ID. Returned in success and failure examples.Data objectTranslation result. Returned only on business success.
Properties FileType stringResult type: strings / document / image / audio.TranslatedFileUrl stringSigned, time-limited download URL of the translated file. Returned only when fileUrl was provided.TranslatedTexts string | array<string>Text translation result. Returned only when source_texts was provided. Preserves the scalar/array shape.objectToken usage. Populated on success, {} on failure, absent while pending. Fields identical to the synchronous call.request_id stringQuery request ID. Returned in all three states. |
|
Supported languages
If you are unsure of the source language, leave source_lang empty for auto-detection. The table below lists all supported translation directions:
| Source (name) | Source (code) | Available targets |
|---|---|---|
| Chinese (Simplified) | zh | Traditional Chinese (zh-tw), English (en), Japanese (ja), Korean (ko), Kazakh (kk), Malay (ms), Thai (th) |
| Chinese (Traditional) | zh-tw | Simplified Chinese (zh), English (en), Japanese (ja), Korean (ko), Kazakh (kk), Malay (ms), Thai (th) |
| English | en | Arabic (ar), Azerbaijani (az), Bengali (bn), Bosnian (bs), Czech (cs), Danish (da), German (de), Greek (el), Spanish (es), Estonian (et), Finnish (fi), French (fr), Hebrew (he), Hindi (hi), Hungarian (hu), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Lithuanian (lt), Latvian (lv), Malay (ms), Burmese (my), Nepali (ne), Dutch (nl), Norwegian (no), Polish (pl), Portuguese-Brazil (pt), Portuguese-Portugal (pt-pt), Romanian (ro), Romanian-Urdu (ro_ur), Russian (ru), Sinhala (si), Slovak (sk), Slovenian (sl), Serbian (sr), Swedish (sv), Thai (th), Filipino (tl), Turkish (tr), Ukrainian (uk), Urdu (ur), Vietnamese (vi), Simplified Chinese (zh), Traditional Chinese (zh-tw) |
| Spanish | es | Bulgarian (bg), Czech (cs), Danish (da), German (de), Greek (el), English (en), Estonian (et), Finnish (fi), French (fr), Croatian (hr), Hungarian (hu), Italian (it), Lithuanian (lt), Latvian (lv), Dutch (nl), Norwegian (no), Polish (pl), Portuguese-Brazil (pt), Portuguese-Portugal (pt-pt), Romanian (ro), Russian (ru), Slovak (sk), Swedish (sv) |
| Arabic | ar | English (en), Turkish (tr) |
| Turkish | tr | Arabic (ar), Czech (cs), German (de), Greek (el), English (en), Hungarian (hu), Romanian (ro), Slovak (sk) |
| Romanian | ro | English (en), Turkish (tr) |
| Azerbaijani | az | English (en) |
| Bengali | bn | English (en) |
| Czech | cs | English (en) |
| German | de | English (en) |
| Greek | el | English (en) |
| Finnish | fi | English (en) |
| French | fr | English (en) |
| Hebrew | he | English (en) |
| Hindi | hi | English (en) |
| Hungarian | hu | English (en) |
| Indonesian | id | English (en) |
| Italian | it | English (en) |
| Japanese | ja | English (en) |
| Korean | ko | English (en) |
| Malay | ms | English (en) |
| Burmese | my | English (en) |
| Nepali | ne | English (en) |
| Dutch | nl | English (en) |
| Polish | pl | English (en) |
| Portuguese (Brazil) | pt | English (en) |
| Russian | ru | English (en) |
| Sinhala | si | English (en) |
| Swedish | sv | English (en) |
| Thai | th | English (en) |
| Filipino | tl | English (en) |
| Ukrainian | uk | English (en) |
| Urdu | ur | English (en) |
| Vietnamese | vi | English (en) |
| Bulgarian | bg | English (en) |
| Bosnian | bs | English (en) |
| Danish | da | English (en) |
| Estonian | et | English (en) |
| Croatian | hr | English (en) |
| Lithuanian | lt | English (en) |
| Latvian | lv | English (en) |
| Norwegian | no | English (en) |
| Portuguese (Portugal) | pt-pt | English (en) |
| Romanian (Urdu) | ro_ur | English (en) |
| Slovak | sk | English (en) |
| Slovenian | sl | English (en) |
| Serbian | sr | English (en) |
Billing and rate limits
- Free quota and unit price: see Model pricing.
- Rate limits: see Rate limits.
- Billing rule: billed by
input_tokens. Prices are identical for synchronous and asynchronous calls. - Note: failed calls do not incur charges and do not consume the new-user free quota.