OpenAI API 429 rate limit how to fix
You're making API calls and suddenly hit a wall: Error 429: Rate limit reached. Your code stops working, and you're not sure if you're doing something wrong or if OpenAI's throttling you unfairly.
OpenAI API 429 rate limit how to fix
You're making API calls and suddenly hit a wall: `Error 429: Rate limit reached`. Your code stops working, and you're not sure if you're doing something wrong or if OpenAI's throttling you unfairly.
What's actually happening
A 429 error means you've exceeded OpenAI's usage limits for your tier. The API enforces three types of limits: requests per minute (RPM), tokens per minute (TPM), and requests per day (RPD). When you cross any of these thresholds, the API blocks new requests until your rate window resets.
Your error response includes specific headers telling you exactly what happened. Look for `x-ratelimit-limit-requests`, `x-ratelimit-remaining-requests`, and `x-ratelimit-reset-requests` in the response. The reset header shows when your quota refreshes — usually a timestamp in Unix epoch format.
Free tier accounts get the strictest limits: typically 3 RPM and 200 RPM for different models. Paid accounts on usage tiers 1-5 get progressively higher limits, scaling from 500 RPM up to 10,000 RPM for tier 5. Your tier increases automatically as you spend more and maintain your account over time. There's no way to pay directly for a higher tier — it's purely based on spending history and account age.
How to fix it
1. Check your current limits
Log into platform.openai.com and go to Settings → Limits. You'll see your exact RPM, TPM, and RPD caps for each model family. Note your current tier and the limits that apply to your API key.
2. Implement exponential backoff
Add retry logic to your code. When you hit a 429, wait before retrying. Start with 1 second, then double the wait time with each subsequent failure: 2 seconds, 4 seconds, 8 seconds. Most OpenAI client libraries include this built-in — check your SDK documentation for automatic retry configuration.
```python
import time
import openai
for attempt in range(5):
try:
response = openai.ChatCompletion.create(...)
break
except openai.error.RateLimitError:
if attempt < 4:
time.sleep(2 ** attempt)
else:
raise
```
3. Batch your requests strategically
If you're processing large datasets, don't fire all requests simultaneously. Add delays between calls. For a 500 RPM limit, you can safely make 8 requests per second (500/60). Build a queue system that releases requests at a controlled pace.
4. Use the Batch API for non-urgent tasks
For jobs that don't need immediate results, switch to the Batch API at api.openai.com/v1/batches. Batch requests cost 50% less and don't count against your rate limits. Results arrive within 24 hours. Perfect for processing transcripts, analysing datasets, or generating content in bulk.
5. Monitor the rate limit headers
Parse the `x-ratelimit-remaining-tokens` header before each request. If it's low, pause until `x-ratelimit-reset-tokens` passes. This prevents hitting the limit in the first place.
6. Increase your spend to raise your tier
Your tier upgrades automatically after you've spent $100 (tier 2), $500 (tier 3), $1,000 (tier 4), or $5,000 (tier 5). Each tier unlocks higher limits. If you legitimately need more capacity right now, prepay for usage through Settings → Billing → Add credit balance. Consistent spending over 7-14 days triggers tier reviews.
If prepaying doesn't immediately upgrade your tier, you're likely waiting for the account age requirement — tier 2 needs 7 days, tier 3 needs 7 days, tier 4 needs 14 days, tier 5 needs 30 days.
If that doesn't work
Contact OpenAI through the help widget on platform.openai.com if you're hitting limits that don't match your documented tier, or if you need a custom rate limit for a specific business use case. Include your organisation ID, the exact error message with timestamp, and your typical request pattern (requests per hour, models used, use case description).
OpenAI typically responds within 2-4 business days. For urgent issues blocking production systems, follow the priority support process with full technical details. Don't expect instant tier upgrades — these follow automatic rules based on payment history.
Questions people actually ask
Q: Can I pay extra to skip the rate limits immediately?
A: No. Tier upgrades require both spending thresholds and account age. Adding $500 of credit won't instantly jump you to tier 3 if your account is 2 days old.
Q: Do different API keys on the same account share rate limits?
A: Yes. All keys under one organisation pull from the same rate limit pool. Creating multiple keys won't give you extra capacity.
Q: Why do I get 429 errors when I'm nowhere near my daily limit?
A: You're hitting the per-minute limit (RPM or TPM), not the daily cap. Check `x-ratelimit-limit-requests` — it shows your minute-level ceiling.
Q: Will switching models help?
A: Sometimes. GPT-4 and GPT-3.5 have separate rate limits. If you're maxed out on GPT-4 requests, GPT-3.5-turbo calls might still work. Check Settings → Limits for model-specific caps.
What to remember
- 429 errors are OpenAI's throttle, not a bug in your code — you've exceeded your tier's capacity
- Parse rate limit headers (`x-ratelimit-remaining-requests`) to predict and avoid hitting the ceiling
- Implement exponential backoff retry logic before deploying to production
- Use the Batch API for non-urgent bulk processing — it's cheaper and bypasses rate limits
- Tier upgrades happen automatically based on spend + account age, not manual requests
Related help
- OpenAI API error 429 and other API errors
- How to contact OpenAI support
- Unexpected OpenAI charge — refund guide
---
*openai-support.com is an independent resource, not affiliated with OpenAI Inc.*