OpenAI API error 429 rate limit exceeded fix

You're building something with the OpenAI API and suddenly get hit with "Error 429: Rate limit exceeded." Your requests stop cold, your app breaks, and you're stuck wondering what just happened.

OpenAI API error 429 rate limit exceeded fix

You're building something with the OpenAI API and suddenly get hit with "Error 429: Rate limit exceeded." Your requests stop cold, your app breaks, and you're stuck wondering what just happened.

What's actually happening

Error 429 means you've sent too many requests to the OpenAI API in a short timeframe. OpenAI enforces two types of limits: requests per minute (RPM) and tokens per minute (TPM). When you exceed either one, the API rejects your request with a 429 error and includes a `Retry-After` header telling you how many seconds to wait.

These limits vary by account tier and the specific model you're using. A free trial account might get 3 RPM and 40,000 TPM on GPT-4, while a paid account with usage history could get 500 RPM and 300,000 TPM. The exact numbers appear in your API account limits page — check there first to see what you're working with.

The error response looks like this: `{"error": {"message": "Rate limit reached for requests", "type": "requests", "code": "rate_limit_exceeded"}}`. You might also see variations mentioning tokens or specific model names.

How to fix it

1. Check your current limits

Go to platform.openai.com/account/limits and log in. You'll see your exact RPM and TPM limits for each model. If you're on a free trial, these numbers will be low — typically single-digit requests per minute.

2. Implement exponential backoff

Add retry logic to your code that waits progressively longer after each 429 error. Start with the `Retry-After` value from the response header, or use 1 second, 2 seconds, 4 seconds, 8 seconds as your backoff sequence. Most API libraries have this built in — check your SDK documentation.

3. Batch your requests

If you're sending 50 separate API calls in a loop, you're going to hit limits immediately. Instead, combine multiple prompts into one request where possible, or space your requests across time. Add a delay of at least 60/RPM seconds between calls — so if you have 3 RPM, wait 20 seconds between requests.

4. Upgrade your tier

OpenAI increases limits based on your payment history and account age. Once you've spent $50+ on API usage and your account is at least 7 days old, your limits typically jump to tier 2 (higher RPM/TPM). You can't pay to instantly unlock higher tiers — you need to build usage history first.

5. Request a limit increase

If you have a legitimate need for higher limits and you're already on a paid tier, go to platform.openai.com/account/limits and click "Request increase" next to the model you need. Fill out the form with your use case and expected request volume. OpenAI typically responds within 1-3 business days, but approval isn't guaranteed.

If none of these steps work and you're still seeing 429 errors despite being under your stated limits, you might be hitting a different issue. Check for other API errors like insufficient quota or authentication failures that can look similar.

If that doesn't work

Contact OpenAI support through the help center at help.openai.com. Include your organization ID (found at platform.openai.com/account/organization), the exact error message with timestamp, and the model you're trying to use. Explain what you've already tried from the steps above.

Response times vary, but expect 2-5 days for limit increase requests. For urgent production issues, clearly state "production outage" in your subject line. See our full guide on how to contact OpenAI support for the fastest response paths.

Questions people actually ask

Q: Can I pay to instantly get higher rate limits?

A: No. OpenAI increases limits based on account age and spending history. You need to use the API consistently over time, not make a one-time payment.

Q: Why do I get 429 errors when I'm under my TPM limit?

A: You're probably hitting your RPM (requests per minute) limit instead. Both limits apply independently — check both numbers at platform.openai.com/account/limits.

Q: How long do I have to wait after getting a 429 error?

A: Check the `Retry-After` header in the error response — it tells you exactly how many seconds to wait. If you can't see the header, wait at least 60 seconds before trying again.

Q: Do rate limits reset at midnight or continuously?

A: They reset on a rolling per-minute window. If you hit your limit at 2:43pm, you can try again at 2:44pm, not at the next hour or day.

What to remember

  • Check platform.openai.com/account/limits for your exact RPM and TPM numbers
  • Add exponential backoff retry logic to handle 429 errors gracefully
  • Space out your requests — don't loop through API calls without delays
  • Higher limits come from spending history and account age, not instant payments
  • Both RPM and TPM limits apply — exceeding either one triggers a 429

---

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

Related help