Errors
Errors use a consistent, machine-readable envelope.
JSON
{
"error": {
"type": "invalid_request_error",
"code": "missing_field",
"message": "clientName is required.",
"param": "clientName"
}
}| HTTP | type | Meaning |
|---|---|---|
400 | invalid_request_error | Malformed or missing parameters |
401 | authentication_error | Bad, missing, or revoked key |
402 | usage_limit_error | The prepaid balance has nothing left for API requests past the included pool (code out_of_usage_credit), or the trial's 500 requests are used up (code trial_request_limit) - the message says what to do |
403 | permission_error | Key lacks the scope, the plan has no API access, a live key on a trial, a test key writing, or the feature is switched off |
404 | not_found | No such resource in this organization |
409 | idempotency_error | Idempotency-Key reused with a different body |
422 | validation_error | Well-formed but rejected by a business rule |
429 | rate_limit_error | Rate limited (see Retry-After) |
500 | api_error | Unexpected server error |