Errors and limits
Errors are JSON with a detail field. This page lists all codes, the limits and how to retry.
Format
422
{
"detail": "too_short"
}For a malformed body (for example without text) detail is a list that names the place of the error.
Codes
| Status | detail | Meaning |
|---|---|---|
| 401 | invalid_api_key | The key is missing or malformed. |
| 401 | unknown_key | No key with this value exists. |
| 402 | quota_exhausted | The test quota is used up or too small for this request. |
| 402 | cost_cap_reached | The cost cap of the key is reached. Raise it or wait for the next period. |
| 402 | payment_required | The subscription is cancelled or unpaid. |
| 403 | key_blocked | The key has been blocked. |
| 422 | too_short | Fewer than 80 words. |
| 422 | too_long | More than 100,000 characters. |
| 422 | unsupported_language | The language is not one of the twelve, or the text is not in Latin script. |
| 429 | rate_limited | More than 60 requests per minute with this key. |
| 429 | too_many_concurrent_requests | More than two requests of this key at the same time. |
| 429 | too_many_failed_attempts | Too many unknown keys from this address. Wait ten minutes. |
| 503 | busy, unavailable | Briefly at capacity. Send the request again after Retry-After seconds. Nothing is billed. |
Limits
| Limit | Value |
|---|---|
| Text per request | 80 words to 100,000 characters |
| Requests per minute and key | 60 |
| Concurrent requests per key | 2 |
| Time per request | up to 120 seconds |
Split longer documents at paragraph breaks into several requests. GET /v1/models returns the current values.
Retries
Retry only 429 and 503, and wait the seconds given in the Retry-After header. A request that ends in an error is not billed, so sending it again is safe.