Tongyi Multimodal Translation: Batch Translation
Debugging
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Debug
Authorization information
The following table describes the authorization information of the API. You can use it in the Action element of a RAM permission policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
- Operation: the specific permission point.
- Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types supported for authorization in the operation. Details:
- Required resource types are marked with a preceding *.
- For operations that do not support resource-level authorization,
All resourcesis used.
- Condition key: the condition keys defined by the cloud product itself.
- Dependent action: other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent actions for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| anytrans:BatchTranslate | none | *All resources * |
| None |
Request syntax
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| workspaceId | string | Yes | The ID of the Model Studio workspace used for this request. | llm-kqtrcpdee4xm29xx |
| sourceLanguage | string | Yes | The source language. | zh |
| targetLanguage | string | Yes | The target language. | en |
| text | object | Yes | The batch of texts to translate. | {"0":"明天天气怎么样?","1":"你中午吃饭了吗"} |
| scene | string | No | The translation model. Valid values:
| mt-flash |
| format | string | No | The translation format. | text |
| appName | string | No | The source of the call. | baidufanyi |
| ext | object | No | The extended parameters that control translation features. | |
| examples | array<object> | No | A list of translation examples. | |
| object | No | A translation example. | ||
| tgt | string | No | The target text. | hello |
| src | string | No | The source text. | 你好 |
| domainHint | string | No | A domain hint (a piece of natural language text in English used to instruct the translation style of the large model) | this sentence from an e-commerce product image, please provide a translation that is both highly concise and no more than 1.2 times the length of the original. |
| sensitives | array | No | The sensitive word library. | |
| string | No | A sensitive word to be filtered out. | password | |
| terminologies | array<object> | No | The translation terminology library. | |
| object | No | A terminology pair to be overridden. | ||
| tgt | string | No | The translation after overriding. | API |
| src | string | No | The source text. | 应用接口 |
| textTransform | object | No | Translation text transformation. | |
| toLower | boolean | No | Convert the entire translation to lowercase. Valid values:
| false |
| toUpper | boolean | No | Convert the entire translation to uppercase. Valid values:
| false |
| toTitle | boolean | No | Convert the entire translation to capitalized (with the first letter of each word in uppercase). Valid values:
| false |
| config | object | No | Translation behavior control. | |
| skipCsiCheck | boolean | No | Whether to skip the Content Moderation check (if you need to skip the Content Moderation check, complete the Content Moderation disabling process before calling this API) | false |
| paramMap | any | No | Extended parameter configuration (bizUserId: the user ID at the business level, used to distinguish different business users, enabling "user-isolated" terminology intervention without mutual impact. bizType: the business scenario type/identifier, used to distinguish different scenarios, enabling "scenario-isolated" terminology intervention without mutual impact.) Valid values:
| {"bizUserld":"123456","bizType":session"} |
| langDetect | boolean | No | Whether to enable automatic source language detection. When set to true, the sourceLanguage parameter does not take effect. | false |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| code | string | The response status code. | 200 |
| message | string | The response message. | success |
| requestId | string | The request ID, used for tracing API calls. | 3BE338D3-16B1-513F-8DD2-57C8528DEAAA |
| success | boolean | Whether the API call is successful. | true |
| httpStatusCode | string | The HTTP status code. | 200 |
| data | object | The returned data. | |
| translationList | array<object> | The batch translation results. | |
| translationList | object | A single translation result. | |
| code | long | The response status code. | 200 |
| message | string | The response message. | OK |
| index | string | The index of the single translation result. | 0 |
| translation | string | The translation result corresponding to the index. | What will the weather be like tomorrow? |
| detectedLang | string | The automatically detected source language code. | zh |
| usage | object | The token usage. | |
| inputTokens | long | The number of input tokens. | 53 |
| outputTokens | long | The number of output tokens. | 8 |
| totalTokens | long | The total number of tokens. | 61 |
Examples
Normal response example
JSON format
Error codes
| HTTP status code | Error code | Error message |
|---|---|---|
| 400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. |
Change history
| Change time | Change summary | Operation |
|---|---|---|
| 2026-04-15 | OpenAPI error codes changed | View change details |
| 2026-03-26 | OpenAPI error codes changed, OpenAPI response structure changed | View change details |
| 2025-12-25 | OpenAPI error codes changed | View change details |