Skip to content

Errors

Every error has the same JSON shape:

{
"error": {
"type": "invalid_request_error",
"code": "input_too_long",
"message": "input exceeds 5000 characters",
"param": "input",
"request_id": "req_9f8e7d6c5b4a3f2e1d0c"
}
}
  • type groups errors by kind. code is the specific error; branch on it in your code.
  • param names the request field that caused the error, when there is one.
  • request_id matches the x-request-id response header.
HTTP type codes
400 invalid_request_error invalid_json, missing_param, invalid_param, input_too_long, invalid_audio
401 authentication_error missing_api_key, invalid_api_key, revoked_api_key, expired_api_key
404 not_found_error route_not_found, not_found
413 invalid_request_error file_too_large
422 invalid_request_error unsupported_media_type, audio_too_long
429 rate_limit_error rate_limit_exceeded, with a Retry-After header
500 api_error internal_error
503 service_unavailable_error inference_unavailable, server_busy, both with a Retry-After header

Retry 429 and 503 responses after the number of seconds in the Retry-After header. Don’t retry 4xx errors without changing the request.