OpenAI API 429 error how to fix rate limits

You're building something with the OpenAI API, and suddenly you hit a wall: "Error 429: Rate limit reached for requests." Your app stops working, your users are waiting, and you need to fix this now.

OpenAI API 429 error how to fix rate limits

You're building something with the OpenAI API, and suddenly you hit a wall: "Error 429: Rate limit reached for requests." Your app stops working, your users are waiting, and you need to fix this now.

What's actually happening

A 429 error means you've exceeded your usage tier's rate limits. OpenAI sets specific limits on how many requests per minute (RPM) and tokens per minute (TPM) you can send, and these limits vary based on your payment tier and usage history.

Here's what the actual error looks like in your console:

```

{

"error": {

"message": "Rate limit reached for gpt-4 in organization org-xxxxx on requests per min (RPM): Limit 500, Used 500, Requested 1.",

"type": "requests",

"code": "rate_limit_exceeded"

}

}

```

The error tells you exactly what limit you hit — requests per minute, tokens per minute, or tokens per day. New accounts start at Tier 1 with tight limits (500 RPM for GPT-4, 3,500 RPM for GPT-3.5). As you spend more over time, OpenAI automatically moves you to higher tiers with more generous limits. You can't pay to skip tiers — you have to build usage history.

How to fix it

1. Check your current tier and limits

Go to platform.openai.com/settings/organization/limits. This page shows your exact tier (1-5), your RPM and TPM limits for each model, and how much you've spent toward the next tier. If you're still at Tier 1, you'll need to spend at least $5 to reach Tier 2, which gives you 5,000 RPM for GPT-4.

2. Implement exponential backoff

When you get a 429, don't immediately retry. Wait a bit, then try again. Double your wait time with each failed attempt:

```python

import time

for attempt in range(5):

try:

response = client.chat.completions.create(...)

break

except openai.RateLimitError:

wait_time = (2 ** attempt) + random.random()

time.sleep(wait_time)

```

The error response includes a `retry-after` header telling you exactly how many seconds to wait. Use it.

3. Batch your requests intelligently

Instead of sending 100 rapid-fire requests, spread them out. If you're at 500 RPM, send one request every 120 milliseconds maximum. Build a queue system that respects your limits:

  • Track how many requests you've sent in the current minute
  • Pause when you approach your limit
  • Resume when the minute resets

4. Use the Batch API for non-urgent work

If you're processing thousands of items and don't need instant results, switch to the Batch API at platform.openai.com/batches. You upload a JSONL file with all your requests, and OpenAI processes them within 24 hours at 50% off standard pricing. No rate limits apply to batches.

5. Split load across models

If you're hitting GPT-4 limits but don't always need it, route simpler tasks to GPT-3.5-turbo. It has higher rate limits and costs less. Reserve GPT-4 for requests that actually need its capabilities.

If that doesn't work

Check if you have multiple API keys hitting the same organization limits. Rate limits apply per organization, not per key. If three different apps share one org, they all count toward the same 500 RPM.

If you legitimately need higher limits immediately, there's no express lane. You need to either wait for your usage to organically push you to the next tier, or reduce your request rate to fit your current limits. Contacting OpenAI support won't get you a tier bump — the system is entirely usage-based.

Watch for other API errors that look similar — a 401 means your API key is invalid, a 500 means OpenAI's systems are having issues, and "insufficient_quota" means you've run out of credits or hit your monthly budget cap.

Questions people actually ask

Q: How long until I reach the next tier?

A: Tier 2 requires $5 spent, Tier 3 needs $50, Tier 4 needs $1,000, and Tier 5 needs $5,000. Spending accumulates from your first payment, not monthly. Check platform.openai.com/settings/organization/limits for your progress.

Q: Can I pay extra to increase my rate limits immediately?

A: No. The tier system is automatic and based only on your total spend since joining. There's no option to purchase higher limits.

Q: Why am I getting 429 errors when I haven't sent many requests?

A: You might be sending tokens too fast rather than requests. A single request with 100,000 tokens can hit your TPM limit even if you're nowhere near your RPM limit. Check the error message to see which limit you exceeded.

What to remember

  • Rate limits are per organization and tier-based — check platform.openai.com/settings/organization/limits for your exact numbers
  • Always implement exponential backoff with the `retry-after` header
  • Use the Batch API for large non-urgent workloads to bypass rate limits entirely
  • New accounts start at Tier 1 — you need to spend $5 to reach Tier 2 with better limits
  • 429 is about pacing, not quota — if you've run out of credits, you'll get "insufficient_quota" instead

---

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

Related help