Errors, retries, and limits

Live
Classify failures before retrying and preserve the original request context.
Open in ChatGPT
(opens in new tab)
Last verified: 2026-08-11

Error classes

StatusMeaningAction
400 / 413Invalid input or request too largeFix the request; do not retry unchanged
401Missing or invalid keyRotate or correct credentials
402Billing or credit boundaryResolve billing before retrying
429Rate limitedHonor Retry-After and back off
5xxTransient service/provider failureRetry 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.