[AI61]AI Translation
The AI Translation API leverages advanced large language model (LLM) to deliver real-time multilingual translation services worldwide. It enables accurate and seamless conversion of source text into target languages. Developers can easily integrate the API to achieve efficient and precise text translation, fully catering to multilingual application scenarios and enhancing user experience and cross-language communication efficiency.
Note:
1.Refer to the "Language Code Table" to match the codes of the source and target languages to ensure the correct selection and use of corresponding language identifiers.
2.Each API call is billed on a per-use basis, and the fee will be settled according to the number of calls made.
Request Parameters
List of parameters supported by this API endpoint
| Name | Type | Example | Description |
|---|---|---|---|
| string | CN | Source language. Note: 1.Support direct input of the source language, e.g., CN; 2.Support automatic detection of the input text's language when the source language is not specified. |
| string | EN | Target language. Only supports CN, EN, and JP. If not specified, the default is EN. |
Required | string | 你好,世界! | The original text that needs to be translated.Cannot exceed 2000 characters |
Response Schema
Structure of the API response data
| Field Name | Type | Example | Description |
|---|---|---|---|
data | object | - | response data |
source_lang | string | CN | Source language. |
target_lang | string | EN | Target language. |
translate_result | string | Hello, world! | Translation result. |
statusRequired | boolean | false | Status |
error_msg | string | The request parameter format is incorrect! | Error Message |
error_codeRequired | integer | 0 | Error Code |
Success Response Example
Example of a successful API response
{
"data": {
"source_lang": "CN",
"target_lang": "EN",
"translate_result": "Hello, world!"
},
"status": true,
"error_code": 0
}Error Codes
List of possible error codes returned by this endpoint
Business Errors
| Error Code | Description |
|---|---|
68300004 | Invalid parameter! |
68300005 | Search api failure! |
68300006 | Analytic basic access error! |
68300007 | Bad request! |
68300008 | Service error, please try again later! |
68300010 | The file does not comply with upload specifications! |
Platform Errors
| Error Code | Description |
|---|---|
67200000 | API call exceeds the total limit set by the platform! |
67200001 | API call exceeds the total limit set by the platform! |
67200002 | The current call rate is too fast, exceeding the current configuration limit QPS! |
67200003 | The key and secret parameters for applying for the token are incorrect or the client has been disabled! |
67200004 | The requested api does not have permission. Please contact our support personnel! |
67200005 | Insufficient account balance/number of calls! |
67200006 | The client has exceeded the activation validity period! |
67200007 | The current call exceeds the configured usage limit of the day! |
67200008 | Please check if the required apikey in the query parameter has been transmitted! |
67200009 | The apikey does not match the passed bearerToken. Please check if a valid token is being used! |
67200012 | The request is illegal! |
67200100 | The current server status is busy, request response timeout! |
67200101 | The API requested currently does not exist. Please check the request path! |
HTTP Status Codes
| Status Code | Description |
|---|---|
0 | Success |
201 | Created |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Performance Metrics
Expected performance characteristics for this endpoint
Normal Response Time
5000 ms
Max Response Time
10000 ms