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 application grinds to a halt, and you're not sure if you've hit a hard wall or just need
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 application grinds to a halt, and you're not sure if you've hit a hard wall or just need to slow down.
What's actually happening
Error 429 means you're sending requests faster than your current API tier allows. OpenAI sets rate limits on three dimensions: requests per minute (RPM), tokens per minute (TPM), and requests per day (RPD). Free tier accounts get severely restricted limits — often 3 RPM and 40,000 TPM for GPT-3.5-turbo. Paid tier users get substantially higher limits that scale with how much you've spent historically.
When you exceed any of these limits, the API returns a 429 status code with a response like: `{"error": {"message": "Rate limit reached for requests", "type": "tokens", "param": null, "code": "rate_limit_exceeded"}}`. The error sometimes includes a `Retry-After` header telling you how many seconds to wait, but not always.
This isn't the same as running out of credits. If you're getting insufficient_quota errors or unexpected charges, that's a billing issue. Error 429 specifically means you're going too fast, even if you have plenty of credit remaining.
How to fix it
1. Check your current rate limits
Log into platform.openai.com and navigate to Settings → Limits. You'll see your exact RPM, TPM, and RPD limits for each model. If you're on the free tier, you're looking at extremely low limits — GPT-4 might be completely unavailable.
2. Implement exponential backoff
Add retry logic to your code that waits increasingly longer between failed requests. Start with a 1-second wait, then 2 seconds, 4 seconds, 8 seconds, up to a maximum of around 60 seconds. Most API libraries support this — for Python's `openai` library, you can use the built-in retry mechanism or implement your own:
```python
import time
for attempt in range(5):
try:
response = client.chat.completions.create(...)
break
except openai.RateLimitError:
wait_time = 2 ** attempt
time.sleep(wait_time)
```
3. Add request queuing
Instead of firing all requests simultaneously, queue them and process sequentially with controlled timing. If your limit is 60 RPM, ensure you're only sending one request per second maximum. Build a queue system that respects both RPM and TPM limits.
4. Upgrade your tier
Go to Settings → Billing and add at least $5 in credits if you haven't already. OpenAI automatically moves you to Tier 1 after your first successful payment, which typically increases your GPT-3.5-turbo limit to 3,500 RPM and 60,000 TPM. Tier 2 (after spending $50) gets you 3,500 RPM and 80,000 TPM. Higher tiers require $100+ in historical spend.
5. Batch your requests differently
If you're processing multiple independent prompts, spread them across time rather than submitting them all at once. For data processing tasks, consider OpenAI's Batch API, which has separate, much higher rate limits but processes requests asynchronously over 24 hours.
If that doesn't work
Check whether you're hitting TPM limits instead of RPM limits. A single request with a very long prompt or requested completion can consume your entire token budget. You'll see this if small requests succeed but large ones consistently fail. Reduce your `max_tokens` parameter or split large documents into smaller chunks.
If you're consistently hitting limits even with proper rate limiting and you're already on a paid tier, you need higher limits. Go to Help → Messages on platform.openai.com and request a limit increase. Include your use case, current tier, specific model you're using, and how much higher you need. Be specific: "I need 10,000 RPM for GPT-4 for a customer-facing chatbot" works better than "I need more access." For more guidance on contacting support effectively, see how to contact OpenAI support.
Response times vary wildly — sometimes 24 hours, sometimes a week. OpenAI prioritises requests from accounts with significant spend history.
Questions people actually ask
Q: Will waiting longer automatically increase my limits?
A: No. Your limits only increase by upgrading payment tiers through actual spending or by requesting manual increases from OpenAI support. Time alone doesn't help.
Q: Can I get around rate limits with multiple API keys?
A: Technically yes, but it violates OpenAI's terms of service and can get all your accounts banned. Don't do this. Instead, properly queue your requests or upgrade your tier.
Q: Why do I get 429 errors when I'm nowhere near my stated limits?
A: You might be hitting a different dimension than you think. Check TPM and RPD, not just RPM. Also, limits are rolling windows — if you sent 60 requests in the last 60 seconds, request 61 fails even if you've been quiet for 30 seconds.
Q: Do rate limits reset at midnight?
A: RPM and TPM limits use rolling 60-second windows, not daily resets. RPD limits reset at midnight UTC.
What to remember
- Error 429 means you're sending requests too fast, not that you're out of credits
- Check Settings → Limits on platform.openai.com for your exact RPM, TPM, and RPD caps
- Implement exponential backoff in your code before your first 429 error, not after
- Upgrading from free to paid tier ($5+ in credits) dramatically increases your limits
- For other API errors like 401 authentication or 500 server failures, the fixes are different — 429 is specifically about request frequency
---
*openai-support.com is an independent resource, not affiliated with OpenAI Inc.*