92 languages with terms
Qwen-MT is a machine translation model fine-tuned from Qwen3, supporting 92 languages. It provides term intervention, domain prompting, and translation memory to enhance translation quality.
Limitations
For model details, pricing, and rate limits, see Model Gallery.
Get an API key and set it as an environment variable. To use the SDK, install it.
To enable streaming, add
Model differences:
For DashScope, set
For professional translation tasks, you may encounter these issues:
To ensure translation accuracy and consistency when text contains brand names, product names, or technical terms, you can provide a glossary in the
To instruct the model to use a specific translation style or sentence pattern, you can provide source-target sentence pairs as examples in the
To adapt the translation style to a specific domain, you can use the
Use custom prompts in Qwen-MT to specify details such as the language or style. This method is mutually exclusive with the
Example: Spanish-to-English translation in the legal domain:
Use the English name or Code from the table below when you send a request.
For detailed API parameters, see:
How it works
-
Provide the text to translate: The
messagesarray must contain a single message with itsroleset touser. Thecontentof this message is the text to be translated. -
Set languages: Set the source language (
source_lang) and target language (target_lang) in thetranslation_optionsparameter. For a list of supported languages, see Supported languages. To automatically detect the source language, setsource_langtoauto.
Specifying the source language improves translation accuracy. You can also set languages using custom prompts.
- OpenAI compatible
- DashScope
- Single-turn translation only: The model is designed for translation tasks and does not support multi-turn conversations.
- System messages not supported: You cannot set global behavior using a message with the
systemrole. Instead, define translation configurations in thetranslation_optionsparameter.
Model selection
- For general scenarios, you can select
qwen-mt-flash. It balances quality, speed, and cost, and supports incremental streaming output. - For the highest translation quality in professional fields, you can select
qwen-mt-plus. - For the fastest response speed in simple, real-time scenarios, you can select
qwen-mt-lite.
| Model | Scenario | Result | Speed | Cost | Supported languages | Supports incremental streaming output |
|---|---|---|---|---|---|---|
| qwen-mt-plus | Scenarios that require high translation quality, such as professional fields, formal documents, academic papers, and technical reports | Best | Standard | High | 92 | Unsupported |
| qwen-mt-flash | Top choice for general use. Suitable for scenarios such as website/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 such as real-time chat and live comment translation | Basic | Fastest | Lowest | 31 | Supported |
Getting started
Get an API key and set it as an environment variable. To use the SDK, install it.
- OpenAI compatible
- DashScope
Sample requestSample response
Streaming output
For general streaming concepts (SSE protocol, how to enable streaming, billing, and token usage), see Streaming output. This section covers only the streaming behavior specific to machine translation.
stream: true to your translation call. The only difference from standard streaming is including translation_options:
| Model | Incremental streaming |
|---|---|
| qwen-mt-flash, qwen-mt-lite | Supported — each chunk contains only new content |
| qwen-mt-plus, qwen-mt-turbo | Not supported — each chunk contains all content generated so far |
incremental_output=True to enable incremental streaming on supported models.
Improve translation quality
For professional translation tasks, you may encounter these issues:
- Inconsistent terminology: Product names or industry terms are translated incorrectly.
- Mismatched style: The style of the translated text does not meet the standards of specific domains, such as legal or marketing.
Term intervention
To ensure translation accuracy and consistency when text contains brand names, product names, or technical terms, you can provide a glossary in the terms field. This instructs the model to use your specified translations.
Define and pass terms as follows:
1
Define terms
Create a JSON array and assign it to the
terms field. Each object in the array represents a term in the following format:2
Pass the terms
Use the
translation_options parameter to pass the defined terms array.- OpenAI compatible
- DashScope
Sample requestSample responseAfter you add the terms, the translation result is consistent with the terms you passed: "biological sensor" and "health status of the body".
Translation memory
To instruct the model to use a specific translation style or sentence pattern, you can provide source-target sentence pairs as examples in the tm_list field. The model then imitates the style of these examples for the current translation task.
1
Define the translation memory
Create a JSON array named
tm_list. Each JSON object in the array contains a source sentence and its corresponding translated sentence in the following format:2
Pass the translation memory
Use the
translation_options parameter to pass the translation memory array.- OpenAI compatible
- DashScope
Sample requestSample response
Domain prompting
To adapt the translation style to a specific domain, you can use the translation_options parameter to pass a domain prompt. For example, translations for legal or government domains should be formal, while those for social media should be colloquial.
Domain prompts currently support only English.
- OpenAI compatible
- DashScope
Sample requestSample response
Custom prompts
Use custom prompts in Qwen-MT to specify details such as the language or style. This method is mutually exclusive with the translation_options parameter. If you use both, translation_options may not take effect.
For the best translation results, use
translation_options to configure translation settings instead.- OpenAI compatible
- DashScope
Sample requestSample response
Going live
-
Control the input token count
The Qwen-MT models have a maximum input limit of 8,192 tokens. For long content, consider the following strategies to control the number of input tokens:
- Translate in segments: When you translate long text, process it in segments. Split the text based on semantic units, such as paragraphs or complete sentences, instead of by character count. This approach preserves contextual integrity and improves translation quality.
- Provide the most relevant reference content: Terms, translation memory, and domain prompts are added to the input prompt as tokens. To optimize token usage, provide only the reference content that is most relevant to the current task. Avoid using large, generic lists.
-
Set
source_langbased on the scenario- When the source language is uncertain, such as in social chat scenarios with multilingual text, set
source_langtoauto. The model automatically identifies the source language. - In scenarios with a fixed language and high accuracy requirements, such as for technical documents or operation manuals, always specify
source_lang. Explicitly defining the source language improves translation accuracy.
- When the source language is uncertain, such as in social chat scenarios with multilingual text, set
Supported languages
Use the English name or Code from the table below when you send a request.
If you are unsure of the source language, you can set the
source_lang parameter to auto for automatic detection.- qwen-mt-plus/flash/turbo (92 languages)
- qwen-mt-lite (31 languages)
| 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 Bokmal | Norwegian Bokmal | 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 |