OpenAI API error 429 rate limit exceeded

You're building something with the OpenAI API, and suddenly your requests start failing with "error 429: ratelimitexceeded". Your app stops working, your users complain, and you're stuck wondering what happened.

OpenAI API error 429 rate limit exceeded

You're building something with the OpenAI API, and suddenly your requests start failing with "error 429: rate_limit_exceeded". Your app stops working, your users complain, and you're stuck wondering what happened.

What's actually happening

Error 429 means you've hit one of OpenAI's rate limits — you're sending too many requests too quickly for your current tier. OpenAI enforces three types of limits: requests per minute (RPM), tokens per minute (TPM), and requests per day (RPD). When you exceed any of these, the API blocks additional requests until your usage window resets.

The exact limits depend on your usage tier. Free tier accounts get 3 RPM and 200 RPM for GPT-3.5-turbo, while paid accounts start at tier 1 with significantly higher limits that increase automatically as you spend more. If you're on a new paid account and hitting 429s immediately, you're probably still on tier 1 limits — around 500 TPM for GPT-4 models — which fills up fast when processing longer conversations.

The error response typically includes specific details: `"error": {"message": "Rate limit reached for gpt-4 in organization org-xxx on tokens per min (TPM): Limit 10000, Used 9800, Requested 500", "type": "tokens", "param": null, "code": "rate_limit_exceeded"}`. Pay attention to which limit you hit — TPM, RPM, or RPD — because the fix differs for each.

How to fix it

1. Check your current tier and limits

Go to platform.openai.com/settings/organization/limits. This page shows your exact rate limits for each model. If you're on tier 1 with low limits but you've been using the API for weeks, you might qualify for tier 2 already — OpenAI auto-upgrades accounts that meet spending thresholds ($5 for tier 2, $50 for tier 3).

2. Implement exponential backoff

Add retry logic to your code that waits progressively longer after each 429 error. Start with a 1-second wait, then 2 seconds, 4 seconds, up to a maximum of 60 seconds. Most OpenAI client libraries support this natively — the Python library has `max_retries` built in. This handles temporary rate limit spikes without failing your requests.

3. Reduce your token usage per request

If you're hitting TPM limits, shrink your prompts. Remove unnecessary context, use shorter system messages, or implement conversation summarisation for long chat histories. Each GPT-4 request that includes 2000 tokens of context counts against your TPM even if the response is short. Check the `usage` object in API responses to see your actual token consumption.

4. Batch requests if you're hitting RPM

Instead of sending 100 separate completion requests, combine them where possible. Use the Batch API for non-urgent processing — it's 50% cheaper and doesn't count against your rate limits. Available at platform.openai.com/batches, it accepts JSONL files and processes requests within 24 hours.

5. Request a tier upgrade

If you've spent enough to qualify for the next tier but haven't been upgraded, contact OpenAI through platform.openai.com/settings/organization/billing. Include your organisation ID and current spending. Response times vary — typically 2-5 business days — but if you need immediate access and have a clear use case, mention your project details.

If that doesn't work

You're either hitting the absolute maximum for your tier or there's a billing issue blocking the upgrade. Check platform.openai.com/account/billing/overview for any failed payments or "payment method required" warnings. Unpaid invoices freeze tier upgrades even if your usage qualifies you.

For persistent 429 errors that don't match your dashboard limits, you might be sharing an organisation with other API users whose requests count toward your total. Check platform.openai.com/settings/organization/members — if others have access, their usage affects your limits. Understanding OpenAI API error codes helps diagnose whether this is a genuine rate limit or another API issue presenting as a 429.

If you genuinely need higher limits than your tier allows, you'll need to contact OpenAI support with a business case explaining your usage. Enterprise customers get custom limits, but approval isn't automatic.

Questions people actually ask

Q: How long until my rate limit resets?

A: RPM and TPM limits use a sliding window — they reset continuously as requests age out of the 1-minute window. RPD limits reset at midnight UTC. You don't wait for a full reset; capacity becomes available as old requests drop off.

Q: Will adding credits to my account increase my limits immediately?

A: No. Rate limits depend on your usage tier, which upgrades automatically based on spending history — typically after you've spent $5, $50, $100, etc. over time. Adding $100 today won't instantly unlock tier 4 limits if you're a new account.

Q: Can I pay extra to skip rate limits?

A: Not directly. OpenAI's tier system is the only mechanism. The Batch API offers unlimited throughput for delayed processing, which effectively bypasses real-time rate limits for non-urgent work.

What to remember

  • Check platform.openai.com/settings/organization/limits to see your exact current limits by model
  • Implement exponential backoff retry logic in your code — don't hammer the API after a 429
  • Tier upgrades happen automatically based on spending history, not account age
  • The Batch API has no rate limits and costs 50% less for non-urgent requests
  • TPM limits count input tokens plus output tokens for every request

---

*openai-support.com is an independent resource, not affiliated with OpenAI Inc.*

Related help