Skip to content

Errors

Read and handle API errors consistently.

Check the HTTP status and error.code. Save error.request_id or the X-Request-Id header for support.

{
  "error": {
    "message": "Authentication failed",
    "type": "authentication_error",
    "code": "auth_failed",
    "param": null,
    "request_id": "<request-id>"
  }
}
StatusMeaningWhat to do
400Invalid inputCorrect the request before retrying.
401Missing or invalid credentialsCheck your API key.
402Insufficient balanceAdd credit.
403Missing permission or generation suspendedCheck error.code and account access.
404Resource unavailableCheck the ID and your access.
409Duplicate or conflicting requestCheck operation status.
413Request too largeReduce the input or upload size.
429Rate, concurrency, or capacity limitWait for Retry-After, then retry with backoff.
5xxService failureCheck accepted operations before retrying; use bounded backoff and an idempotency key.

Errors after audio streaming starts interrupt the response instead of returning JSON. An HTTP 200 alone does not prove completion. See Streaming audio for partial audio and billing.