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

StatusdetailMeaning
401invalid_api_keyThe key is missing or malformed.
401unknown_keyNo key with this value exists.
402quota_exhaustedThe test quota is used up or too small for this request.
402cost_cap_reachedThe cost cap of the key is reached. Raise it or wait for the next period.
402payment_requiredThe subscription is cancelled or unpaid.
403key_blockedThe key has been blocked.
422too_shortFewer than 80 words.
422too_longMore than 100,000 characters.
422unsupported_languageThe language is not one of the twelve, or the text is not in Latin script.
429rate_limitedMore than 60 requests per minute with this key.
429too_many_concurrent_requestsMore than two requests of this key at the same time.
429too_many_failed_attemptsToo many unknown keys from this address. Wait ten minutes.
503busy, unavailableBriefly at capacity. Send the request again after Retry-After seconds. Nothing is billed.

Limits

LimitValue
Text per request80 words to 100,000 characters
Requests per minute and key60
Concurrent requests per key2
Time per requestup 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.