Errors, retries, and limits
Live
Open in ChatGPT
(opens in new tab)Last verified: 2026-08-11Error classes
| Status | Meaning | Action |
|---|---|---|
| 400 / 413 | Invalid input or request too large | Fix the request; do not retry unchanged |
| 401 | Missing or invalid key | Rotate or correct credentials |
| 402 | Billing or credit boundary | Resolve billing before retrying |
| 429 | Rate limited | Honor Retry-After and back off |
| 5xx | Transient service/provider failure | Retry a bounded number of times |
Retry policy
Use exponential backoff with jitter, a small maximum attempt count, and an overall deadline. Preserve request IDs and error bodies, but redact credentials and sensitive input.
Payload limits
Validate character counts, file counts, bytes, and model compatibility before sending. Read limits from model discovery where available. Chat history is not silently discarded: request bodies that exceed the gateway byte limit return
request_too_large, and model context overflow returns context_length_exceeded.PreviousWebhooks
NextData retention