Qwen-MT-Image accurately translates text in images while preserving the original layout. The model also supports custom features such as domain hints, sensitive word filtering, and terminology intervention.
This document applies only to the Chinese Mainland deployment mode. Use the corresponding API key.
Model overview
|
Source language: English |
Japanese |
|
Portuguese |
Arabic |
|
Model |
Description |
Output image specifications |
|
qwen-mt-image |
Qwen - image translation model Supports translation between Chinese or English and other languages. It does not support direct translation between non-Chinese or non-English languages, such as from Japanese to Korean. See Supported languages. |
Image format: JPG. |
Prerequisites
Get an API key and export the API key as an environment variable.
HTTP
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis
The HTTP API uses an asynchronous mode with two steps:
-
Create a task and obtain a task ID: Send a request to create a task. The request returns a task ID (task_id).
-
Query the result using the task ID: Poll the task status with the task_id until completion and retrieve the image URL.
Step 1: Create a task and get a task ID
-
After creating a task, use the returned
task_idto query the result. The task_id is valid for 24 hours. Poll for results instead of creating duplicate tasks. -
For a tutorial, see Use Postman or cURL.
Request parameters |
Image translation
|
Request headers |
|
|
Content-Type The content type of the request. Must be |
|
|
Authorization The authentication credentials using a Model Studio API key. Example: |
|
|
X-DashScope-Async Enables asynchronous processing. Must be Important Returns "current user api does not support synchronous calls" error if not included. |
|
Request body |
|
|
model Model name. Set to |
|
|
input An input parameter object containing the following fields: |
Response parameters |
Successful responseSave the Error responseTask creation failed. See error codes to resolve the issue. |
|
output Task output information. |
|
|
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
|
|
message Detailed error message. Returned only when the request fails. See error codes for details. |
|
|
code The error code. Returned only when the request fails. See error codes for details. |
Step 2: Query the result using the task ID
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
-
The
task_idis valid for 24 hours. Nonexistent or expired IDs return statusUNKNOWN. -
The
urlfor successful tasks is valid for 24 hours. Download and save promptly.
Request parameters |
Query task resultReplace
|
Request headers |
|
|
Authorization The authentication credentials using a Model Studio API key. Example: |
|
URL path parameters |
|
|
task_id The ID of the task to query. |
Response parameters |
Task successful - translatable content existsTask data (task status and image URLs) is retained for only 24 hours and then automatically purged. Save generated images promptly. Task successful - no translatable contentIf the image contains no translatable text (e.g., after subject segmentation), the task still succeeds and is billed normally, but returns
Task failedWhen a task fails,
|
|
output Information about the task output. |
|
|
usage Usage statistics. These are counted only for successful tasks. |
|
|
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
Supported languages
Either the source or target language must be Chinese or English. Direct translation between other language pairs (e.g., Japanese to Korean) is not supported. Set source_lang to auto for automatic detection if unsure.
|
Language |
Code |
As source language |
As target language |
|
Chinese |
zh |
|
|
|
English |
en |
|
|
|
Korean |
ko |
|
|
|
Japanese |
ja |
|
|
|
Russian |
ru |
|
|
|
Spanish |
es |
|
|
|
French |
fr |
|
|
|
Portuguese |
pt |
|
|
|
Italian |
it |
|
|
|
German |
de |
|
|
|
Vietnamese |
vi |
|
|
|
Malay |
ms |
|
|
|
Thai |
th |
|
|
|
Indonesian |
id |
|
|
|
Arabic |
ar |
|
|
Billing and rate limits
-
For free quota and pricing, see Model pricing.
-
For rate limits, see Rate limits.
-
Billing: Charged per successfully generated image. Failed calls or errors incur no fees.
-
If an image contains no translatable text (or no text in non-subject areas after segmentation), the task still succeeds and is billed normally, returning
No text detected for translation.
Error codes
If the model call fails and returns an error message, see Error messages for resolution.
FAQ
Q: Why is the content in the image not translated?
The entity segmentation feature excludes text on image entities (people, products, logos) from translation. To translate all text, set ext.config.imgSegment to false.
Q: How do I convert a temporary image link to a permanent one?
You cannot directly convert temporary links to permanent ones. Download the image via a backend service and upload to OSS for a permanent link.
Q: How do I view model invocation metrics?
A: One hour after a model invocation completes, go to the Monitoring (Singapore) or Monitoring (China (Beijing)) page to view metrics such as invocation count and success rate. For more information, see Bill query and cost management.
Q: How do I get the domain name whitelist for image storage?
A: Images generated by models are stored in OSS. The API returns a temporary public URL. To configure a firewall whitelist for this download URL, note the following: The underlying storage may change dynamically. This topic does not provide a fixed OSS domain name whitelist to prevent access issues caused by outdated information. If you have security control requirements, contact your account manager to obtain the latest OSS domain name list.



