API keys
…
Quick start
Create a key above and send it as a Bearer token. Characters are deducted from your balance per request and refunded if the request fails.
curl https://api.translay.app/v1/translate \
-H "Authorization: Bearer tr_live_…" \
-H "Content-Type: application/json" \
-d '{
"text": "Where meaning travels intact.",
"source_language": "auto",
"target_language": "ru",
"mode": "quality"
}'Request
The response contains the translated text, the model used, token usage and the number of parts the text was split into.
| field | type | notes |
|---|---|---|
text | string | required, up to 100,000 characters |
target_language | string | required, ISO code or language name |
source_language | string | optional, default auto |
mode | fast | quality | optional, default fast |
stream | boolean | optional, server-sent events |
{
"translation": {
"text": "Там, где смысл доходит без потерь.",
"model": "glm5.3-flash",
"prompt_tokens": 61,
"completion_tokens": 14,
"chunks": 1
},
"remaining_chars": 4999971
}Streaming
Add "stream": true, or send Accept: text/event-stream, to receive server-sent events: one chunk event per part in order, then done.
event: chunk
data: {"index":0,"total":3,"text":"Первая часть…"}
event: chunk
data: {"index":1,"total":3,"text":"Вторая часть…"}
event: done
data: {"translation":{"model":"qwen3.7-flash","chunks":3,"prompt_tokens":2410,"completion_tokens":2388},"remaining_chars":4988120}Errors
Every error is JSON with a stable code. Branch on the code, show the message.
{
"error": "Not enough characters on the balance",
"code": "INSUFFICIENT_BALANCE",
"details": { "required": 1834, "balance": 120 }
}| code | status |
|---|---|
INVALID_API_KEY | 401 |
INVALID_REQUEST | 400 |
INVALID_TRANSLATION | 400 |
INSUFFICIENT_BALANCE | 402 |
RATE_LIMITED | 429 |
TRANSLATION_FAILED | 503 |
Limits
Up to 100,000 characters per request and 300 requests per minute per key. Long texts are split at paragraph boundaries and translated in parallel.
Languages
Pass ISO codes such as en, de, zh-TW, or any language name. Use auto to detect the source language.
GET https://api.translay.app/v1/languages Authorization: Bearer tr_live_…