All Products
Search
Document Center

Machine Translation:Machine Translation Universal Edition call guide

Last Updated:Apr 01, 2026

Translates text or HTML content from a source language to a target language using the TranslateGeneral operation.

Limitations

  • QPS limit: 50. Contact us via DingTalk group 23369411 to request a higher limit.

  • Maximum input length: 5,000 characters. For longer content, use Document Translation.

  • Review the pricing for Machine Translation Universal Edition before calling this API.

2, please ensure that the use of the interface, has fully understood the universal version translation products charging methods and prices

Debugging

Call TranslateGeneral directly in OpenAPI Explorer, which generates sample code for different SDKs automatically.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesTranslateGeneralThe operation to perform. Set to TranslateGeneral.
FormatTypeStringYestextThe format of the source text. Valid values: text (plain text, no format processing applied), html (HTML content, tags are preserved in output).
SceneStringYesgeneralThe translation domain. Set to general for the Universal Edition.
SourceLanguageStringYeszhThe source language code. Set to auto to enable automatic language detection. For supported language codes, see Language codes.
SourceTextStringYesHelloThe source text to translate.
TargetLanguageStringYesenThe target language code. For supported language codes, see Language codes.

Response elements

ParameterTypeExampleDescription
CodeInteger200The HTTP status code.
DataStructThe translation result.
└ TranslatedStringHelloThe translated text.
└ WordCountString10The word count of the source text.
└ DetectedLanguageStringzhThe detected language code of the source text. Returned only when SourceLanguage is set to auto.
MessageStringsuccessThe response message.
RequestIdString86D18195-D89C-4C8C-9DC4-5FCE789CE6D5The request ID.

Examples

Sample request

http(s)://[Endpoint]/?Action=TranslateGeneral
&FormatType=text
&Scene=general
&SourceLanguage=en
&SourceText=Hello
&TargetLanguage=zh
&<Common request parameters>

Sample success response

XML format:

<TranslateGeneralResponse>
    <RequestId>14E447CA-B93B-4526-ACD7-42AE13CC2AF6</RequestId>
    <Data>
        <Translated>Hello</Translated>
    </Data>
    <Code>200</Code>
</TranslateGeneralResponse>

JSON format:

{
    "TranslateGeneralResponse": {
        "RequestId": "14E447CA-B93B-4526-ACD7-42AE13CC2AF6",
        "Data": {
            "Translated": "Hello"
        },
        "Code": 200
    }
}

Error codes

HTTP status codeError codeError messageDescription
10110001The request has timed out.The request timed out.
10210002A system error occurred.A system error occurred.
10310003An error occurred while decoding the URL. Verify that the specified URL is encoded.The source text could not be decoded. Verify that the text is URL encoded.
10410004Some required parameters are missing.One or more required parameters were not provided.
10510005The specified language pair is not supported.The combination of source and target language is not supported.
10610006An error occurred while detecting the language.Language detection failed.
10710007An error occurred while translating.The translation failed.
10810008The specified string is too long.The source text exceeds the maximum length.
10910009The RAM user has no permissions.The RAM user does not have permission to call this operation.
11010010The account does not activate the service.Machine Translation is not activated for this account.
11110011Sub-account service failureThe RAM user encountered a service error.
11210012Translation service call failedThe translation service call failed.
11310013The account service is not activated or the payment is overdue.Machine Translation is not activated or the account has an overdue payment.
19919999An unknown error occurred.An unknown error occurred.

For the full list of error codes, see Service error codes.