Qwen-MT-Image accurately translates text in images while preserving the original layout. The model also supports domain hints, sensitive word filtering, and terminology intervention.
The features described in this document are available only in the China (Beijing) region. You must use the API key for this region.
Model overview
|
Source language: Chinese |
English |
Japanese |
|
Korean |
Spanish |
French |
|
Model |
Description |
Output image specifications |
|
qwen-mt-image |
Qwen image translation model. Supports translation between Chinese or English and other languages. Direct translation between two non-Chinese, non-English languages (e.g., Japanese to Korean) is not supported. See Supported languages. |
Image format: JPG |
Prerequisites
Obtain 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 Postman.
Request parameters |
Image translation
|
Request headers |
|
|
Content-Type The content type of the request. Must be |
|
|
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. |
|
|
X-DashScope-Async Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be Important
If this request header is missing, the error "current user api does not support synchronous calls" is returned. |
|
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.
|
|
output Task output information. |
|
|
request_id Unique request identifier for tracing and troubleshooting. |
|
|
message Detailed error message. Returned only for failed requests. See Error codes. |
|
|
code Error code. Returned only for failed requests. See Error codes. |
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. -
The default RPS for this query API is 1. For more frequent queries or event notifications, configure an asynchronous task callback.
-
To query or cancel tasks in batches, see Manage asynchronous tasks.
Request parameters |
Query task resultReplace
|
Request headers |
|
|
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. |
|
URL path parameters |
|
|
task_id The ID of the task. |
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 request identifier for tracing and troubleshooting. |
Supported languages
At least one of the source or target languages 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 language detection.
|
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 Qwen-Image.
-
Billing is per successfully generated image. Failed calls and errors incur no fees or consume no free quota.
-
If an image contains no translatable text (or no text outside 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 codes for resolution.
FAQ
Q: Why is content in the image not translated?
The subject segmentation feature excludes text on image subjects (people, products, logos) from translation. To translate all text in the image, set ext.config.imageSegment to false.
Q: How do I convert a temporary image link to a permanent one?
Temporary links cannot be converted directly to permanent ones. Download the image via a backend service and upload it to OSS to get a permanent link.
Q: How do I view model invocation metrics?
A: One hour after a model invocation completes, go to the Monitoring (China (Beijing)) or Monitoring (Singapore) 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.





