Skip to main content
Translation models

Qwen-MT-Uni API reference

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 str or list[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.

Request

Request headers
Content-Typestring(required)Content type. Must be application/json.Authorizationstring(required)Authentication credentials — an Alibaba Cloud Model Studio API key. Example: Bearer sk-xxxx.
Request body
model string (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).
  • Supported formats: PDF, DOCX, PPTX, XLSX, TXT, HTML, Markdown, JPG, PNG, MP3, WAV.
  • Size limits: single file ≤ 100 MB, documents ≤ 200 pages, audio duration must be between 3 seconds and 60 minutes.
  • URLs must not contain non-ASCII characters.
  • Must provide exactly one of fileUrl or source_texts.
source_texts 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.).
Domain hints currently only support English.
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.
  • false: (default) translate all text in the image.
  • true: skip text on image subjects.
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "qwen-mt-uni",
    "input": {
        "fileUrl": "https://maas-infra-public.oss-cn-hangzhou.aliyuncs.com/lzhe/test/03bc3a6a-a02b-11f1-8874-00163e79676e.jpg",
        "target_lang": "zh"
    }
}'

Response (success)

output objectBusiness 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.
usage 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.
request_id stringTop-level request ID. Returned on both success and failure.

Response (failure)

code stringError code string, e.g. InvalidParameter. Failure only.message stringError detail, e.g. InvalidParameter: <reason>. Failure only.request_id stringRequest ID.
  • Success
  • Failure
{
    "output": {
        "Code": 200,
        "Data": {
            "FileType": "image",
            "TranslatedFileUrl": "http://dashscope-a717.oss-cn-beijing.aliyuncs.com/xxx.jpg?Expires=xxx"
        },
        "Message": "Success",
        "RequestId": "a20aa16a-2445-929f-9130-af70b4a0ade4",
        "Success": true
    },
    "usage": {
        "input_tokens": 1887,
        "input_tokens_details": {
            "audio_tokens": 0,
            "character_tokens": 0,
            "document_tokens": 0,
            "image_tokens": 1887
        },
        "output_tokens": 1887,
        "output_tokens_details": {
            "audio_tokens": 0,
            "character_tokens": 0,
            "document_tokens": 0,
            "image_tokens": 1887
        },
        "total_tokens": 3774
    },
    "request_id": "a20aa16a-2445-929f-9130-af70b4a0ade4"
}

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:
  1. Submit task, receive task ID: send a request to create a task. The response returns a task ID (task_id).
  2. Poll for result by task ID: poll the query endpoint with task_id until 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. The task_id is 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: enable must be added.

Request

Request headers
Content-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 body
The body is identical to the synchronous call, including model and the full input object (fileUrl/source_texts, source_lang, target_lang, ext, ...).
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "qwen-mt-uni",
    "input": {
        "fileUrl": "https://maas-infra-public.oss-cn-hangzhou.aliyuncs.com/lzhe/test/03bc3a6a-a02b-11f1-8874-00163e79676e.jpg",
        "target_lang": "zh"
    }
}'

Response

output objectTask output.

Properties

task_id stringTask ID. Query validity is 24 hours.task_status stringTask status.

Enum values

  • PENDING: queued
  • RUNNING: processing
  • SUCCEEDED: task has finished; combine with output.Success to determine business success
  • FAILED: task itself failed
  • UNKNOWN: task does not exist or status is unknown
request_id stringUnique request ID for tracing.
  • Success
  • Failure
Save task_id to query task status and result.
{
    "output": {
        "task_id": "5dfd1549-e956-4f26-8802-6c9e06f704c6",
        "task_status": "PENDING"
    },
    "request_id": "fe9a9059-02dd-497c-a62c-8e27a0081c02"
}

Step 2: Query result by task ID

GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
  • task_id is valid for 24 hours. If the ID does not exist or has expired, the task status returns UNKNOWN.
  • The TranslatedFileUrl returned 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.

Request

Request headers
Authorizationstring(required)Authentication credentials. Example: Bearer sk-xxxx.
URL path parameters
task_id string (required)Task ID returned by the create-task endpoint.
  • Query task result
Replace 86ecf553-d340-4e21-xxxxxxxxx with your actual task_id.
curl -X GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response

Field visibility: while task_status is PENDING / RUNNING, TranslatedFileUrl, TranslatedTexts, usage, and end_time are empty. Continue polling.
output 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.
usage 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.
  • Pending / running
  • Succeeded
  • Business failed
{
    "request_id": "6e8d1dd6-9e02-9793-ad25-6e7fda5eeea0",
    "output": {
        "task_id": "df8fc25e-b9ee-4e96-9aa2-24d69681299e",
        "task_status": "PENDING"
    }
}

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)zhTraditional Chinese (zh-tw), English (en), Japanese (ja), Korean (ko), Kazakh (kk), Malay (ms), Thai (th)
Chinese (Traditional)zh-twSimplified Chinese (zh), English (en), Japanese (ja), Korean (ko), Kazakh (kk), Malay (ms), Thai (th)
EnglishenArabic (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)
SpanishesBulgarian (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)
ArabicarEnglish (en), Turkish (tr)
TurkishtrArabic (ar), Czech (cs), German (de), Greek (el), English (en), Hungarian (hu), Romanian (ro), Slovak (sk)
RomanianroEnglish (en), Turkish (tr)
AzerbaijaniazEnglish (en)
BengalibnEnglish (en)
CzechcsEnglish (en)
GermandeEnglish (en)
GreekelEnglish (en)
FinnishfiEnglish (en)
FrenchfrEnglish (en)
HebrewheEnglish (en)
HindihiEnglish (en)
HungarianhuEnglish (en)
IndonesianidEnglish (en)
ItalianitEnglish (en)
JapanesejaEnglish (en)
KoreankoEnglish (en)
MalaymsEnglish (en)
BurmesemyEnglish (en)
NepalineEnglish (en)
DutchnlEnglish (en)
PolishplEnglish (en)
Portuguese (Brazil)ptEnglish (en)
RussianruEnglish (en)
SinhalasiEnglish (en)
SwedishsvEnglish (en)
ThaithEnglish (en)
FilipinotlEnglish (en)
UkrainianukEnglish (en)
UrduurEnglish (en)
VietnameseviEnglish (en)
BulgarianbgEnglish (en)
BosnianbsEnglish (en)
DanishdaEnglish (en)
EstonianetEnglish (en)
CroatianhrEnglish (en)
LithuanianltEnglish (en)
LatvianlvEnglish (en)
NorwegiannoEnglish (en)
Portuguese (Portugal)pt-ptEnglish (en)
Romanian (Urdu)ro_urEnglish (en)
SlovakskEnglish (en)
SlovenianslEnglish (en)
SerbiansrEnglish (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.

Error codes

See Error codes.
Text Generation
Image Generation
Video Generation
World models
3D Model Generation
Audio
  • Audio generation
Realtime API
Text Embedding
Decision Model
TokenPlan
Model Production