Complete developer guide and best practices to help you get started quickly.
API modules overview
Your first API request
Three steps to your first request: sign in to the console, create an API key, and call the translation endpoint with the key in the request header.
This section walks through your first call using the text translation endpoint. Authentication, error handling, dictionaries, and streaming are covered in later sections.
Three steps to begin
- Sign in to the developer console and finish your account setup.
- Create a new key on the API keys page. The key is shown only once — copy it immediately and store it safely.
- Send a POST request to the translation endpoint with X-API-Key in the HTTP header.
Example: translate a sentence
Send POST /api/v1/translations/text with the text, target language, and an optional source language (auto-detected when omitted).
Request example
curl -X POST "https://abemono.abestar.com.tw/api/v1/translations/text" \ -H "X-API-Key: [YOUR_API_KEY]" \ -H "Content-Type: application/json" \ -d '{ "text": "Hello, how are you?", "target_language": "zh-TW", "source_language": "en-US" }'
Replace [YOUR_API_KEY] with your API key
Successful response
On 200, data contains the translation result and the model code used; usage reports the billable characters.
Successful response example (HTTP 200)
{
"translated_text": "你好,你好嗎?",
"detected_source_lang": "en-US",
"usage": {
"quota_percent": {
"used": 5
}
},
"forced_replacement_count": 0
}Error response
Failures return a unified error object: code is the error code string, message is a human-readable description, and request_id identifies this request — include it when reporting issues.
Error response example (HTTP 401)
{
"error": {
"code": "unauthorized",
"message": "API key is missing or invalid.",
"details": {},
"request_id": "0af7651916cd43dd8448eb211c80319c"
}
}
