Qwen-MT is a machine translation model fine-tuned from Qwen3. It supports 92 languages -- including Chinese, English, Japanese, Korean, French, Spanish, German, Thai, Indonesian, Vietnamese, and Arabic -- and offers term intervention, domain prompting, and translation memory to control translation quality.
How it works
-
Provide the text to translate: The
messagesarray must contain a single message with itsroleset touser. Thecontentof this message is the text you want to translate. -
Set languages: Specify the source language (
source_lang) and target language (target_lang) in thetranslation_optionsparameter. For a list of supported languages, see Supported languages. To let the model detect the source language automatically, setsource_langtoauto.Specifying the source language improves translation accuracy.
You can also set the language using custom prompts .
translation_options parameter to access advanced translation features such as term intervention, translation memory, and domain prompting.
Limitations
- Single-turn translation only: Qwen-MT is purpose-built for translation and does not support multi-turn conversations.
- System messages not supported: You cannot set global behavior through a
system-role message. Instead, configure translation behavior in thetranslation_optionsparameter.
Model selection
- For general scenarios, choose
qwen-mt-flash. It offers the best balance of quality, speed, and cost, and supports incremental streaming output. - For the highest translation quality in professional domains, choose
qwen-mt-plus. - For the fastest response speed in simple, real-time scenarios, choose
qwen-mt-lite.
Model | Scenario | Result | Speed | Cost | Supported languages | Incremental stream |
|---|---|---|---|---|---|---|
qwen-mt-plus | Provides high-quality translation for scenarios such as professional fields, formal documents, academic papers, and technical reports | Best | Standard | High | 92 | Unsupported |
qwen-mt-flash | Recommended for general use. Suitable for website and app content, product descriptions, daily communication, and blog posts | Good | Fast | Low | 92 | Supported |
qwen-mt-turbo | This model will not be updated in the future. Use flash instead. | Fair | Fast | Low | 92 | Unsupported |
qwen-mt-lite | Simple, latency-sensitive scenarios like real-time chat and live comment translation | Basic | Fastest | Lowest | 31 | Supported |
Getting started
This section walks through a simple example: translating "No me reí después de ver este video" into English.
Obtain an API key and export the API key as an environment variable. If you use the OpenAI SDK or DashScope SDK to make calls, install the SDK.
- OpenAI compatible
- DashScope
Streaming output
Streaming output delivers translated content incrementally, reducing perceived latency. Currently, qwen-mt-flash and qwen-mt-lite support incremental streaming, where each response contains only the newly generated content. Enable it with the incremental_output parameter. qwen-mt-plus and qwen-mt-turbo support only non-incremental streaming, where each response returns the full translation so far. For more information, see Streaming output.
- OpenAI compatible
- DashScope
Improve translation quality
Basic translation works well for everyday use cases like casual communication. For professional or high-stakes translation tasks, you may run into specific challenges:
- Inconsistent terminology: Product names or industry-specific terms are translated incorrectly or inconsistently across passages.
- Mismatched style: The translated text does not match the tone or conventions expected in a specific domain, such as legal or marketing content.
Term intervention
Supply a glossary in the terms field to ensure that brand names, product names, or technical terms are translated consistently every time.
To define and pass your glossary:
-
Define terms
Create a JSON array and assign it to the
termsfield. Each object in the array maps a source term to its required translation:
-
Pass the terms
Pass the
translation_optionsparameter with yourtermsarray included.
- OpenAI compatible
- DashScope
Translation memory
When you need the model to follow a specific translation style or sentence pattern, provide source-target sentence pairs as examples in the tm_list field. The model learns from the style of these reference pairs and applies it to the current translation. This is useful for maintaining consistency across large documentation sets or when adapting to an organization’s established writing conventions.
-
Define the translation memory
Create a JSON array named
tm_list. Each object pairs a source sentence with its reference translation:
-
Pass the translation memory
Include the
translation_optionsparameter with your translation memory array.
- OpenAI compatible
- DashScope
Domain prompting
Pass a domain prompt in translation_options to tailor the translation style for a specific field. For example, legal or government content calls for formal language, while social media posts work better with a conversational tone.
- OpenAI compatible
- DashScope
Custom prompts
Use custom prompts with Qwen-MT to control details such as the target language, tone, or domain. The translation_options parameter and custom prompts can be passed together, but when both are set simultaneously, settings in translation_options (such as target_lang, source_lang, and so on) take priority over corresponding settings in the custom prompt and will override language or style specifications in the custom prompt.
For the best translation results, use translation_options to configure translation settings instead.
The following example shows a Spanish-to-English legal translation using a detailed prompt:
- OpenAI compatible
- DashScope
Going live
-
Control the input token count
Qwen-MT models accept a maximum of 8,192 input tokens. For longer content, use the following strategies to stay within this limit:
- Translate in segments: Break long text into manageable chunks at natural semantic boundaries -- such as paragraphs or complete sentences -- rather than splitting by character count. This preserves contextual coherence and yields more accurate translations.
- Provide only the most relevant references: Terms, translation memory entries, and domain prompts all consume input tokens. Include only references directly relevant to the text being translated. Avoid passing large, generic reference lists.
-
Set
source_langbased on the scenario- When the source language is uncertain -- for example, in multilingual chat scenarios -- set
source_langtoauto. The model identifies the language automatically. - When the source language is known and accuracy is critical -- such as for technical documentation or operation manuals -- always specify
source_langexplicitly. This improves translation accuracy.
- When the source language is uncertain -- for example, in multilingual chat scenarios -- set
Supported languages
When sending a request, use either the English name or the Code from the tables below.
If you are unsure of the source language, you can set thesource_langparameter toautofor automatic detection.
- Languages supported by qwen-mt-plus/flash/turbo (92)
- Languages supported by qwen-mt-lite (31)
Language | English name | Code |
|---|---|---|
English | English | en |
Simplified Chinese | Chinese | zh |
Traditional Chinese | Traditional Chinese | zh_tw |
Russian | Russian | ru |
Japanese | Japanese | ja |
Korean | Korean | ko |
Spanish | Spanish | es |
French | French | fr |
Portuguese | Portuguese | pt |
German | German | de |
Italian | Italian | it |
Thai | Thai | th |
Vietnamese | Vietnamese | vi |
Indonesian | Indonesian | id |
Malay | Malay | ms |
Arabic | Arabic | ar |
Hindi | Hindi | hi |
Hebrew | Hebrew | he |
Burmese | Burmese | my |
Tamil | Tamil | ta |
Urdu | Urdu | ur |
Bengali | Bengali | bn |
Polish | Polish | pl |
Dutch | Dutch | nl |
Romanian | Romanian | ro |
Turkish | Turkish | tr |
Khmer | Khmer | km |
Lao | Lao | lo |
Cantonese | Cantonese | yue |
Czech | Czech | cs |
Greek | Greek | el |
Swedish | Swedish | sv |
Hungarian | Hungarian | hu |
Danish | Danish | da |
Finnish | Finnish | fi |
Ukrainian | Ukrainian | uk |
Bulgarian | Bulgarian | bg |
Serbian | Serbian | sr |
Telugu | Telugu | te |
Afrikaans | Afrikaans | af |
Armenian | Armenian | hy |
Assamese | Assamese | as |
Asturian | Asturian | ast |
Basque | Basque | eu |
Belarusian | Belarusian | be |
Bosnian | Bosnian | bs |
Catalan | Catalan | ca |
Cebuano | Cebuano | ceb |
Croatian | Croatian | hr |
Egyptian Arabic | Egyptian Arabic | arz |
Estonian | Estonian | et |
Galician | Galician | gl |
Georgian | Georgian | ka |
Gujarati | Gujarati | gu |
Icelandic | Icelandic | is |
Javanese | Javanese | jv |
Kannada | Kannada | kn |
Kazakh | Kazakh | kk |
Latvian | Latvian | lv |
Lithuanian | Lithuanian | lt |
Luxembourgish | Luxembourgish | lb |
Macedonian | Macedonian | mk |
Maithili | Maithili | mai |
Maltese | Maltese | mt |
Marathi | Marathi | mr |
Mesopotamian Arabic | Mesopotamian Arabic | acm |
Moroccan Arabic | Moroccan Arabic | ary |
Najdi Arabic | Najdi Arabic | ars |
Nepali | Nepali | ne |
North Azerbaijani | North Azerbaijani | az |
North Levantine Arabic | North Levantine Arabic | apc |
Northern Uzbek | Northern Uzbek | uz |
Norwegian Bokmål | Norwegian Bokmål | nb |
Norwegian Nynorsk | Norwegian Nynorsk | nn |
Occitan | Occitan | oc |
Odia | Odia | or |
Pangasinan | Pangasinan | pag |
Sicilian | Sicilian | scn |
Sindhi | Sindhi | sd |
Sinhala | Sinhala | si |
Slovak | Slovak | sk |
Slovenian | Slovenian | sl |
South Levantine Arabic | South Levantine Arabic | ajp |
Swahili | Swahili | sw |
Tagalog | Tagalog | tl |
Ta’izzi-Adeni Arabic | Ta’izzi-Adeni Arabic | acq |
Tosk Albanian | Tosk Albanian | sq |
Tunisian Arabic | Tunisian Arabic | aeb |
Venetian | Venetian | vec |
Valaisan | Waray | war |
Welsh | Welsh | cy |
Western Persian | Western Persian | fa |