Localization Translate API Integration and Usage
The main function of the Localization Translate API is to obtain translated text by inputting the text that needs to be translated, while the target language for translation can be customized, and the translation results can be output in two mainstream formats: json and markdown.
This document will provide detailed instructions on integrating the Translate API, helping you easily integrate and fully utilize the powerful features of this API. With the Translate API, you can easily translate the input text into a specific language and support specific methods for outputting the translation results.
¶ Application Process
To use the Localization Translate API, first go to the 辰汐ai Console to obtain your API Token for future use.

If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in, and after completion, you will be automatically returned to the current page.
One API Token can call all services on the platform without needing to apply separately for each service. The first application will grant a free quota for a trial experience; when the quota is insufficient, you can recharge the general balance in the console.
📘 Complete Documentation: Localization Translate API →
¶ Request Example
We will take an English input as an example to demonstrate how to use this API. Suppose the English description is: # Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph., and we will demonstrate how to upload the English description and obtain the Chinese translation result, while displaying it in markdown format.
¶ Setting Request Headers and Request Body
Request Headers include:
accept: Specifies that the response result should be in JSON format, set toapplication/json.authorization: The key to call the API, which can be selected directly after application.
Request Body includes:
input: The text that needs to be translated.locale: The language for the translation.extension: The format for displaying the translation result.model: The large model used for translation, default is gpt-3.5.
Set as shown in the image below:

¶ Code Example
You can see that various language codes have been automatically generated on the right side of the page, as shown in the image:

Some code examples are as follows:
¶ CURL
curl -X POST 'https://api.acedata.cloud/localization/translate' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"input": "# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph.",
"locale": "zh-CN",
"extension": "md"
}'
¶ Python
import requests
url = "https://api.acedata.cloud/localization/translate"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"input": "# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph.",
"locale": "zh-CN",
"extension": "md"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
¶ Response Example
After a successful request, the API will return the result information of this translation task. For example:
{
"data": "# 标题 1\n\n这是一个段落。\n\n## 标题 2\n\n这是另一个段落。",
"usage": {
"prompt_tokens": 172,
"completion_tokens": 25
},
"model": "gpt-3.5-turbo-16k",
"locale": "zh-CN"
}
You can see that the result contains a data field, which includes the translated Chinese text, and is returned in markdown format, with other information as follows:
data, the result of this translation task.model, the large language model used for this translation task.locale, the type of translation language for this translation task.
¶ Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:
400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.
¶ Error Response Example
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ Conclusion
Through this document, you have learned how to easily use the Localization Translate API to translate input text into a specific language and support specific methods for outputting translation results. We hope this document helps you better integrate and use this API. If you have any questions, please feel free to contact our technical support team.