Skip to main content

SubmitHtmlTranslateTask

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.
ActionAccess levelResource typeCondition keyDependent action
anytrans:SubmitHtmlTranslateTasknone
*All Resources
*
    None
None

Request syntax

POST /anytrans/translate/html/submit HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYes

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

llm-kqtrcpdee4xm29xx
formatstringNo

The translation format.

text
sourceLanguagestringNo

The source language.

zh
targetLanguagestringNo

The target language.

en
textstringNo

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>
scenestringNo

The translation model.

Valid values:
  • mt-plus: Professional Edition.
  • mt-flash: Lite Edition.
mt-flash
extobjectNo

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

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

The sensitive word library.

stringNo

A sensitive word to be filtered.

password
terminologiesarray<object>No

The translation terminology library.

objectNo

A terminology pair to be enforced.

tgtstringNo

The translated text after enforcement.

ML
srcstringNo

The source text.

机器学习
textTransformobjectNo

Case conversion of the translated text.

toLowerbooleanNo

Converts the entire translated text to lowercase.

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

Converts the entire translated text to uppercase.

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

Converts the entire translated text to capitalized words with the first letter in uppercase.

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

Translation behavior control.

skipCsiCheckbooleanNo

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
paramMapanyNo

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

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"}
callbackUrlstringNo

The callback URL used to receive translation results.

Response elements

NameTypeDescriptionExample
object

Schema of Response

codestring

The response status code.

success
messagestring

The response message.

success
requestIdstring

The request ID, used to trace the API call chain.

72E4FDA1-5474-5DC1-8DFF-968BEEA65C49
successboolean

Indicates whether the API call was successful.

true
httpStatusCodestring

The HTTP status code.

200
dataobject

The response data.

taskIdstring

The HTML translation task ID.

2746f4be-cff2-465e-a2c6-12bff30ce0f9
statusstring

The translation task status.

Valid values:
  • in_process: In progress.
  • success: Completed.
in_process
trackingDatastring

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"}
callbackUrlstringNo

The callback URL used to receive translation results.

Examples

Success response JSON format
{
  "code": "success",
  "message": "success",
  "requestId": "72E4FDA1-5474-5DC1-8DFF-968BEEA65C49",
  "success": true,
  "httpStatusCode": 200,
  "data": {
    "taskId": "2746f4be-cff2-465e-a2c6-12bff30ce0f9\n",
    "status": "in_process",
    "trackingData": {
      "traceId": "trace_123456"
    }
  }
}

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.
See the Error Center for more error codes.

Release notes

Change timeChange summaryOperation
2026-03-17OpenAPI error codes changed and OpenAPI response structure changedView details
2025-12-25OpenAPI error codes changedView details
2025-11-25OpenAPI error codes changedView details