OpenAI API 429 rate limit error how to fix
You're making API calls and getting slammed with Error 429: Rate limit reached. Your requests are being rejected, your application's broken, and you need it working now.
OpenAI API 429 rate limit error how to fix
You're making API calls and getting slammed with `Error 429: Rate limit reached`. Your requests are being rejected, your application's broken, and you need it working now.
What's actually happening
The 429 error means you've hit OpenAI's usage limits for your account tier. OpenAI sets 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 returns `429 Too Many Requests` and blocks your calls until the rate limit window resets.
Here's what triggers it. If you're on the free tier, you get roughly 3 RPM and 40,000 TPM. Paid tier 1 users (who've spent $5+) get 3,500 RPM and 200,000 TPM for GPT-4. Make four calls in one minute on the free tier? Fourth request gets rejected. The error response usually includes a header like `retry-after: 20` telling you how many seconds to wait.
Different models have different limits. GPT-4o has higher TPM limits than GPT-4 Turbo. Whisper has separate rate limits from text models. You can check your exact limits at platform.openai.com/settings/organization/limits — log in, click your organization name, then Settings, then Limits.
How to fix it
1. Check your current limits
Go to platform.openai.com/settings/organization/limits. You'll see your RPM, TPM, and batch queue limits for each model. Note which limit you're hitting — requests or tokens.
2. Add automatic retry logic
Implement exponential backoff in your code. When you get a 429, wait the time specified in the `retry-after` header, then try again. Most API libraries support this. In Python with the OpenAI library:
```python
from openai import OpenAI
client = OpenAI(max_retries=3)
```
This automatically retries with increasing delays. For custom handling, catch the `RateLimitError` and implement your own backoff.
3. Reduce request frequency
Batch your prompts if possible. Instead of making 100 separate API calls in quick succession, queue them and send with delays. Add a 1-2 second pause between requests if you're hitting RPM limits. Use the Batch API for non-urgent requests — it processes overnight at 50% cost but doesn't count against RPM limits.
4. Optimize token usage
If you're hitting TPM limits, reduce tokens per request. Shorten system prompts. Use `max_tokens` to cap responses. Switch from GPT-4 to GPT-4o-mini for tasks that don't need the full model — mini has separate, higher limits.
5. Upgrade your usage tier
OpenAI automatically upgrades you from tier 1 to tier 2 after you've spent $50 and been using the API for 7+ days. Tier 2 gets 5,000 RPM for GPT-4o. Tier 3 requires $100 spent and 7 days, giving 10,000 RPM. You can see your tier and next tier requirements at platform.openai.com/settings/organization/limits.
If you need immediate higher limits and haven't met the automatic requirements, you can't bypass them — OpenAI doesn't manually upgrade accounts. You must spend the amount and wait the time period.
If that doesn't work
Check for other API errors beyond 429 — you might be seeing 401 authentication failures or 500 server errors mixed in. Verify your API key is active at platform.openai.com/api-keys.
If your limits seem wrong (you're tier 2 but seeing tier 1 limits), wait 24 hours — tier upgrades aren't instant. If limits still don't match your tier after a full day, contact OpenAI support through the help widget at platform.openai.com. Click the question mark icon, select "API", then "Rate Limits". Include your organization ID and screenshots of your limits page.
For suspected billing issues causing limit restrictions, check platform.openai.com/settings/organization/billing. If there's an unexpected charge or payment failure, resolve it first — unpaid balances can trigger rate restrictions.
Questions people actually ask
Q: How long does the 429 block last?
A: Rate limits reset every minute for RPM, every minute for TPM, and every 24 hours for RPD. If you hit RPM limits at 2:43:15 PM, you can request again at 2:44:00 PM.
Q: Can I pay to increase limits immediately?
A: No. You must meet both spending thresholds and time requirements. Spending $100 in one day doesn't unlock tier 3 — you need $100 total AND 7 days of API usage.
Q: Do all models share the same rate limits?
A: No. GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo, DALL-E, Whisper, and TTS each have separate RPM and TPM limits. Check platform.openai.com/settings/organization/limits for the complete breakdown.
What to remember
- Rate limits are per model, not per account — GPT-4o and GPT-3.5 don't share limits
- Tier upgrades require both spending thresholds AND minimum time periods (usually 7 days)
- Use the Batch API for non-urgent requests to bypass RPM limits entirely
- The `retry-after` header tells you exactly how long to wait before retrying
- Optimizing token usage is faster than waiting for tier upgrades
---
*openai-support.com is an independent resource, not affiliated with OpenAI Inc.*