Submitting an HTML translation task with Tongyi Multimodal Translation
Try it now
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the call succeeds, OpenAPI Explorer can automatically generate SDK code examples.
Debug
RAM authorization
The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles permission to call this API. Details are as follows:
- Operation: the specific permission.
- Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization for the operation. Details are as follows:
- For required resource types, a leading asterisk (*) is used.
- For operations that do not support resource-level authorization, All Resources is used.
- Condition key: the condition keys defined by the cloud service 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.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| anytrans:SubmitHtmlTranslateTask | none | *All Resources * |
| None |
Request syntax
Request parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | The ID of the Model Studio workspace used for this request. | llm-kqtrcpdee4xm29xx |
| format | string | No | The translation format. | text |
| sourceLanguage | string | No | The source language. | zh |
| targetLanguage | string | No | The target language. | en |
| text | string | No | The HTML content to be translated. | <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>我的第一个网页</title> </head> <body> <h1>欢迎来到我的网页!</h1> <p>这是一个简单的 HTML 页面。</p> <p>学习 HTML 是进入网页开发的第一步。</p> <a href="https://www.example.com">点击这里访问示例网站</a> </body> </html> |
| scene | string | No | The translation model. Valid values:
| mt-flash |
| ext | object | No | 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 | Domain hint (a natural language text in English used to instruct the translation style of the large model) | his 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. | password | |
| terminologies | array<object> | No | The translation terminology library. | |
| object | No | A terminology pair to be enforced. | ||
| tgt | string | No | The translated text after enforcement. | ML |
| src | string | No | The source text. | 机器学习 |
| textTransform | object | No | Case conversion of the translated text. | |
| toLower | boolean | No | Converts the entire translated text to lowercase. Valid values:
| false |
| toUpper | boolean | No | Converts the entire translated text to uppercase. Valid values:
| false |
| toTitle | boolean | No | Converts the entire translated text to capitalized words with the first letter in uppercase. Valid values:
| false |
| config | object | No | Translation behavior control. | |
| skipCsiCheck | boolean | No | Specifies whether to skip the Content Moderation check (to skip the check, you must first complete the Content Moderation disablement process before calling this API) | false |
| paramMap | any | No | Extended parameter configuration (bizUserld: the business-level user ID, used to distinguish different business users so that terminology enforcement is isolated by user and does not affect each other. bizType: the business scenario type/identifier, used to distinguish different scenarios so that terminology enforcement is isolated by scenario and does not affect each other.) Valid values:
| {"bizUserld":"123456","bizType":session"} |
| trackingData | string | No | Custom passthrough data defined by the user. The translation service does not process it and returns it as-is, for scenarios such as event tracking. | {"traceId":"trace_123456"} |
| callbackUrl | string | No | The callback URL used to receive translation results. |
Response elements
| Name | Type | Description | Example | |
|---|---|---|---|---|
| object | Schema of Response | |||
| code | string | The response status code. | success | |
| message | string | The response message. | success | |
| requestId | string | The request ID, used to trace the API call chain. | 72E4FDA1-5474-5DC1-8DFF-968BEEA65C49 | |
| success | boolean | Indicates whether the API call was successful. | true | |
| httpStatusCode | string | The HTTP status code. | 200 | |
| data | object | The response data. | ||
| taskId | string | The HTML translation task ID. | 2746f4be-cff2-465e-a2c6-12bff30ce0f9 | |
| status | string | The translation task status. Valid values:
| in_process | |
| trackingData | string | Custom passthrough data defined by the user. The translation service does not process it and returns it as-is, for scenarios such as event tracking. | {"traceId":"trace_123456"} | |
| callbackUrl | string | No | The callback URL used to receive translation results. |
Examples
Success response
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. |
Release notes
| Change time | Change summary | Operation |
|---|---|---|
| 2026-03-17 | OpenAPI error codes changed and OpenAPI response structure changed | View details |
| 2025-12-25 | OpenAPI error codes changed | View details |
| 2025-11-25 | OpenAPI error codes changed | View details |