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 Mainland China deployment mode. You must use a 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
You must obtain an API key and set 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. The call involves 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: Use the task_id to poll the task status until the task is complete and you retrieve the image URL.
Step 1: Create a task and get a task ID
-
After a task is created, use the returned
task_idto query the result. The task_id is valid for 24 hours. Do not create duplicate tasks. Instead, poll to retrieve the result. -
For a tutorial, see Postman.
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 The name of the model. Set this to |
|
|
input The input parameter object, which contains the following fields: |
Response parameters |
Successful responseSave the Error responseTask creation failed. See error codes to resolve the issue. |
|
output Information about the task output. |
|
|
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. If the ID does not exist or has expired, the task status is returned asUNKNOWN. -
The
urlreturned for a successful task is valid for 24 hours. Download and save the image 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 (for example, if no text remains after subject identification), the task still succeeds and is billed normally. However, the message
Task failedWhen a task fails,
|
|
output Information about the task output. |
|
|
usage Usage statistics. These statistics are counted only for successful tasks. |
|
|
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
Supported languages
When you translate an image, the source or target language must be Chinese or English. Direct translation between two non-Chinese or non-English languages, such as from Japanese to Korean, is not supported. If you are unsure of the source language, you can set source_lang to auto for automatic 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 Rate limits.
-
Billing: You are billed based on the number of successfully generated images. Failed model calls or processing errors do not incur any fees.
-
Note: If an image contains no translatable text, or if no text remains in the non-subject area after subject identification is enabled, the task is still considered successful and is billed as normal. In this case, the API returns the message
No text detected for translation.
Configure image access permissions
Images are stored in Object Storage Service (OSS). The links provide public access but are valid for only 24 hours. If your business system cannot access OSS links because of security policies, you can add the following OSS domain names to your network access whitelist.
dashscope-result-bj.oss-cn-beijing.aliyuncs.com
dashscope-result-hz.oss-cn-hangzhou.aliyuncs.com
dashscope-result-sh.oss-cn-shanghai.aliyuncs.com
dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com
dashscope-result-zjk.oss-cn-zhangjiakou.aliyuncs.com
dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com
dashscope-result-hy.oss-cn-heyuan.aliyuncs.com
dashscope-result-cd.oss-cn-chengdu.aliyuncs.com
dashscope-result-gz.oss-cn-guangzhou.aliyuncs.com
dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com
Error codes
If a call fails, see Error messages for troubleshooting.
FAQ
Q: Why is the content in the image not translated?
A: The entity segmentation feature prevents the model from translating text on entities in the image, such as people, products, or logos. To translate all the text, set the ext.config.imgSegment parameter to false.
Q: How do I convert a temporary image link to a permanent one?
A: You cannot directly convert a temporary link to a permanent one. Instead, download the image through a backend service and then upload it to OSS to generate a new permanent link.
Q: How do I view my model usage?
A: One hour after a model call is complete, you can go to the Monitoring page to view metrics such as the call count and success rate. How to view model call records?



