Troubleshooting9 min readUpdated: 2026-03-31

OpenAI 401 and 429 Errors: Practical Fix Checklist

Diagnose unauthorized and rate/quota errors quickly with a production-ready checklist based on official OpenAI guidance.

1) 401 errors: split auth vs policy causes

OpenAI error guidance lists multiple 401 scenarios, including invalid credentials and IP allowlist mismatch. Treat 401 as a category, not a single root cause.

Start by checking which key is used, which project it belongs to, and whether your request source IP matches project policy.

  • Validate Authorization header format
  • Confirm key belongs to the expected organization/project
  • Review IP allowlist settings

2) 429 errors: rate limit vs quota

OpenAI distinguishes at least two common 429 patterns: rate-limit reached and current quota exceeded. The mitigation path is different for each.

If requests are too fast, smooth traffic and retry with backoff. If quota is exceeded, check billing, limits, and project budget settings.

3) Read limits using RPM/RPD/TPM/TPD/IPM

OpenAI rate limits are measured across several dimensions. You can hit RPM first even when TPM still looks healthy, so monitor both request and token dimensions.

Unsuccessful requests still count toward per-minute limits, so repeated immediate retries can worsen incidents.

4) Implement safe retries

Use exponential backoff with jitter for retriable failures. Pair retries with request deduplication and timeout budgets to prevent retry storms.

Also tune max_tokens close to expected output size, because rate-limit accounting can depend on max_tokens estimates.

5) Production runbook for recurring incidents

For recurring 401/429 incidents, create a runbook with ownership, alert thresholds, rollback paths, and communication templates.

A short, repeatable checklist is usually more valuable than ad-hoc debugging during peak traffic.

FAQ

Why does 429 happen even when token usage seems low?

You may be hitting RPM before TPM, or frequent failed retries may already consume your per-minute quota.

How can I distinguish quota issues from rate spikes?

Check the exact error message: 'rate limit reached' usually indicates traffic pacing issues, while 'current quota exceeded' points to billing/limits.

Should I keep retrying aggressively after a 429?

No. Use controlled backoff with jitter and reduce request burstiness first.

Related Providers

Sources