Guides
Errors
Errors use standard HTTP status codes and one JSON shape. Branch on the code field: it is stable. The message is for people and may change.
#Error format
{
"error": {
"message": "direction must be cyr2lat, lat2cyr, or auto",
"type": "invalid_request_error",
"code": "invalid_request"
}
}| Field | Type | Description |
|---|---|---|
error.code | string | Machine-readable code from the table below. |
error.type | string | Error class, derived from the HTTP status (OpenAI style). |
error.message | string | Human-readable explanation. Never contains your input. |
| HTTP status | type |
|---|---|
| 400, 405, 413 | invalid_request_error |
| 401 | authentication_error |
| 403 | permission_error |
| 404 | not_found_error |
| 429 | rate_limit_error |
| 500, 502, 503, 504 | server_error |
#Error codes
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body or a field is invalid: missing text or file, unknown direction, voice or format, wrong content type. Fix the request; do not retry. |
| 400 | invalid_audio | The audio could not be decoded. Check the file and its format. |
| 400 | key_in_query | The key was sent in the URL. Send it in the Authorization header. |
| 401 | invalid_api_key | No key, or the key is malformed, unknown, revoked or expired. Check the header; create a new key if needed. |
| 403 | account_suspended | The account is suspended. Contact support. |
| 403 | scope_not_allowed | The key lacks the scope for this endpoint. |
| 403 | voice_not_allowed | The key may not use this voice. |
| 404 | not_found | No such endpoint. Check the path and the /v1 prefix. |
| 405 | method_not_allowed | Wrong HTTP method, for example GET on a POST endpoint. |
| 413 | payload_too_large | Text, file or body over the limit. Split the input. |
| 413 | audio_too_long | Audio over 5 minutes. Cut it into parts. |
| 429 | rate_limited | Per-minute limit reached. Retry after Retry-After. |
| 429 | concurrent_request | Too many requests in flight for the account. Retry after 1 s and lower your parallelism. |
| 429 | quota_exceeded | Daily or monthly quota used up. Wait for the reset (Retry-After) or upgrade the plan. |
| 429 | global_capacity | Free plan: the shared daily capacity is used up. Retry after midnight UTC. |
| 500 | server_error | Unexpected error on our side. Retry after Retry-After or a few seconds; report it if it persists. |
| 502 | upstream_error | The speech server failed on this request. Retry once or twice. |
| 503 | service_busy | The GPU machine is busy with other requests. Retry after Retry-After. |
| 503 | service_unavailable | The API is shedding load, or the GPU machine is offline. Retry after Retry-After. |
| 503 | not_available | The endpoint is not offered yet. See GET /v1/status. |
| 504 | timeout | The model did not finish within 90 seconds. Retry with shorter input. |
Rejected requests do not use quota. Speech requests that fail on the server (502, 503, 504) are not charged.
#Handling errors
- 4xx except 429: the request is wrong. Fix it; retrying the same request gets the same answer.
- 429 and 5xx: retry after
Retry-After, with jitter and a cap on attempts. See retrying for code. - Log
X-Request-Idfrom every failed response and include it when you contact support.
Non-JSON responses
The API sits behind Cloudflare. A network failure between you and the API can return an HTML page or no body at all. Treat any response you cannot parse as JSON like a 5xx and retry later.