Chat error codes
Chat Completions errors use the standard error object shown below. Speech and catalogue errors contain code, message and request_id. Provide the response header X-Request-Id and request time when reporting an issue.
Failed requests return a non-2xx HTTP status with an error object:
json
{"error":{"message":"Invalid request parameter.","type":"invalid_request_error","param":"messages","code":"invalid_request"}}Use code for program logic and message for diagnostic context.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_request | Invalid model, messages or generation parameters |
| 401 | invalid_api_key | Invalid, expired, or disabled key |
| 402 | insufficient_balance | Not enough credits |
| 403 | forbidden | Account or IP access is restricted |
| 429 | rate_limited | Requests-per-minute limit exceeded |
| 500 | internal_error | Server error |
| 503 | upstream_unavailable | Chat or voice service is unavailable |
| 400 | content_policy_violation | Content did not pass policy checks |
| 413 | payload_too_large | Request body is too large |
| 504 | timeout | Request timed out |
Check your request and credentials before retrying. For transient errors, wait before retrying; repeated message submissions may produce another reply.
Streaming waits up to 90 seconds for the first text and stops after 60 seconds without new text. Continuous output has no fixed total timeout and remains subject to max_tokens.