Skip to main content

Error envelope

All errors follow OpenAI’s shape:
The type field is the most useful for programmatic handling.

Status codes

Retry strategy

  • 5xx errors → retry with exponential backoff (1s, 2s, 4s, 8s, give up at 30s)
  • 429 → wait the Retry-After header value, then retry
  • 402 → no point retrying until you top up credits
  • 4xx (other) → fix your request; don’t retry blindly