Skip to main content

BatchTranslate

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 resources is 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.
OperationAccess levelResource typeCondition keyDependent action
anytrans:BatchTranslatenone
*All resources
*
    None
None

Request syntax

POST /anytrans/translate/batch HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

The ID of the Model Studio workspace used for this request.

llm-kqtrcpdee4xm29xx
sourceLanguagestringYes

The source language.

zh
targetLanguagestringYes

The target language.

en
textobjectYes

The batch of texts to translate.

{"0":"明天天气怎么样?","1":"你中午吃饭了吗"}
scenestringNo

The translation model.

Valid values:
  • mt-plus: Professional Edition.
  • mt-flash: Lightweight Edition.
mt-flash
formatstringNo

The translation format.

text
appNamestringNo

The source of the call.

baidufanyi
extobjectNo

The extended parameters that control translation features.

examplesarray<object>No

A list of translation examples.

objectNo

A translation example.

tgtstringNo

The target text.

hello
srcstringNo

The source text.

你好
domainHintstringNo

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.
sensitivesarrayNo

The sensitive word library.

stringNo

A sensitive word to be filtered out.

password
terminologiesarray<object>No

The translation terminology library.

objectNo

A terminology pair to be overridden.

tgtstringNo

The translation after overriding.

API
srcstringNo

The source text.

应用接口
textTransformobjectNo

Translation text transformation.

toLowerbooleanNo

Convert the entire translation to lowercase.

Valid values:
  • true: Yes.
  • false: No.
false
toUpperbooleanNo

Convert the entire translation to uppercase.

Valid values:
  • true: Yes.
  • false: No.
false
toTitlebooleanNo

Convert the entire translation to capitalized (with the first letter of each word in uppercase).

Valid values:
  • true: Yes.
  • false: No.
false
configobjectNo

Translation behavior control.

skipCsiCheckbooleanNo

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
paramMapanyNo

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:
  • bizType: The business scenario type.
  • bizUserId: The business user ID.
{"bizUserld":"123456","bizType":session"}
langDetectbooleanNo

Whether to enable automatic source language detection. When set to true, the sourceLanguage parameter does not take effect.

false

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

codestring

The response status code.

200
messagestring

The response message.

success
requestIdstring

The request ID, used for tracing API calls.

3BE338D3-16B1-513F-8DD2-57C8528DEAAA
successboolean

Whether the API call is successful.

true
httpStatusCodestring

The HTTP status code.

200
dataobject

The returned data.

translationListarray<object>

The batch translation results.

translationListobject

A single translation result.

codelong

The response status code.

200
messagestring

The response message.

OK
indexstring

The index of the single translation result.

0
translationstring

The translation result corresponding to the index.

What will the weather be like tomorrow?
detectedLangstring

The automatically detected source language code.

zh
usageobject

The token usage.

inputTokenslong

The number of input tokens.

53
outputTokenslong

The number of output tokens.

8
totalTokenslong

The total number of tokens.

61

Examples

Normal response example JSON format
{
  "code": 200,
  "message": "success",
  "requestId": "3BE338D3-16B1-513F-8DD2-57C8528DEAAA",
  "success": true,
  "httpStatusCode": 200,
  "data": {
    "translationList": [
      {
        "code": 200,
        "message": "OK",
        "index": 0,
        "translation": "What will the weather be like tomorrow?",
        "detectedLang": "",
        "usage": {
          "inputTokens": 53,
          "outputTokens": 8,
          "totalTokens": 61
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError message
400IdempotentParameterMismatchThe 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.
Visit the Error Center to view more error codes.

Change history

Change timeChange summaryOperation
2026-04-15OpenAPI error codes changedView change details
2026-03-26OpenAPI error codes changed, OpenAPI response structure changedView change details
2025-12-25OpenAPI error codes changedView change details