OpenAI API 429 rate limit fix
You're sending requests to the OpenAI API and getting slammed with error 429. Your code stops working, your users complain, and you're stuck figuring out why OpenAI keeps rejecting your calls.
OpenAI API 429 rate limit fix
You're sending requests to the OpenAI API and getting slammed with error 429. Your code stops working, your users complain, and you're stuck figuring out why OpenAI keeps rejecting your calls.
What's actually happening
Error 429 means you've hit OpenAI's rate limits — you're sending too many requests too quickly for your current tier. The full error looks like this:
```
{
"error": {
"message": "Rate limit reached for requests",
"type": "requests",
"code": "rate_limit_exceeded"
}
}
```
OpenAI enforces two types of limits: requests per minute (RPM) and tokens per minute (TPM). Free tier users get 3 RPM and 40,000 TPM. Tier 1 (you've spent $5+) gets 500 RPM and 200,000 TPM. Higher tiers unlock more capacity. If you're on the free tier and fire off four requests in 60 seconds, the fourth one fails with 429.
The error also appears when you've maxed out your monthly spending cap or when you're using an old endpoint that's been deprecated. Check your OpenAI usage dashboard — if you see spending at 100% of your limit, that's your problem, not RPM.
How to fix it
1. Check your current tier
Go to platform.openai.com/settings/organization/limits. Look at your "Rate limits" section. You'll see exact RPM and TPM numbers for each model. If you're still on free tier, you need to add $5+ credit to move to Tier 1.
2. Add exponential backoff to your code
Wrap your API calls in retry logic that waits longer after each failure:
```python
import time
def call_api_with_retry(max_retries=5):
for attempt in range(max_retries):
try:
response = openai.ChatCompletion.create(...)
return response
except openai.error.RateLimitError:
wait_time = (2 ** attempt) + random.random()
time.sleep(wait_time)
raise Exception("Max retries exceeded")
```
This backs off for 1 second, then 2, then 4, then 8. Most 429 errors resolve within 60 seconds.
3. Implement request batching
If you're sending 100 individual requests in a loop, you're burning through RPM fast. OpenAI's batch API lets you bundle requests into a single JSONL file. Upload it, wait for processing, download results. This counts as one request, not 100. Check the batch API docs for format details.
4. Increase your spending limit
Click "Settings" → "Billing" → "Limits" in your OpenAI dashboard. Raise your monthly budget from the default $100. OpenAI won't automatically increase it — you have to manually approve higher spend. If you're consistently hitting limits at Tier 1, spending $50+ moves you to Tier 2 with 5,000 RPM.
5. Switch models strategically
GPT-4 has tighter limits than GPT-3.5-turbo. If you're prototyping, use `gpt-3.5-turbo` or `gpt-4o-mini` — both have much higher RPM allowances. GPT-4o-mini costs 60x less than GPT-4 and often works fine for simpler tasks.
If these steps don't work: You might be seeing other OpenAI API errors bundled with 429. Error 401 means your API key is invalid. Error 500 or 503 means OpenAI's servers are down (check status.openai.com). Error `insufficient_quota` means you're out of credits entirely — add funds immediately.
If that doesn't work
Contact OpenAI support if you've tried everything above and still hit 429 constantly. Here's how to contact OpenAI support effectively: go to help.openai.com, click "Messages" in the bottom-right corner, then "Send us a message." Include:
- Your organization ID (from platform.openai.com/settings)
- The exact error message with timestamps
- Your current tier and usage pattern (e.g. "Tier 1, sending 300 RPM to gpt-4")
- What you've already tried
They typically respond within 24-48 hours for billing and rate limit issues. Don't expect instant quota increases — they review based on payment history and usage patterns. If you're seeing unexpected charges, that's a separate issue requiring different documentation.
Questions people actually ask
Q: Can I pay to instantly increase my rate limits?
A: No direct payment button exists. You move up tiers by spending more over time — $5 gets you Tier 1, $50 gets you Tier 2. Higher tiers unlock automatically after you've spent the threshold amount and waited the required time period (usually 7 days).
Q: Does 429 mean I'm banned?
A: No. It's a temporary limit, not an account suspension. You're not blocked — just sending too many requests too fast. Wait 60 seconds and try again. Account bans show different error codes and disable dashboard access entirely.
Q: Will switching API keys help?
A: Only if you're switching to a different organization with higher limits. Creating new keys in the same org doesn't reset rate limits — they're tied to your organization ID, not individual API keys.
What to remember
- Error 429 means you've exceeded requests per minute or tokens per minute for your tier
- Free tier gets 3 RPM — spend $5+ to unlock Tier 1 with 500 RPM
- Add exponential backoff retry logic to handle temporary rate limits gracefully
- Batch API reduces 100 requests to 1, saving massive RPM
- Higher tiers unlock automatically after spending thresholds, not by requesting access
---
*openai-support.com is an independent resource, not affiliated with OpenAI Inc.*