OpenAI API 429 rate limit error how to fix

Getting a 429 error from the OpenAI API means you've hit your rate limit — you're sending too many requests too fast, or you've burned through your tokens-per-minute quota. This happens to developers working with GPT-4,

OpenAI API 429 rate limit error how to fix

Getting a 429 error from the OpenAI API means you've hit your rate limit — you're sending too many requests too fast, or you've burned through your tokens-per-minute quota. This happens to developers working with GPT-4, GPT-3.5, embeddings, or any other API endpoint when their usage spikes beyond what their tier allows.

What's actually happening

When you see `Error 429: Rate limit exceeded`, the API is rejecting your request because you've crossed one of several limits OpenAI enforces. These limits aren't arbitrary — they're tied to your account's usage tier, which starts low for new accounts and increases automatically as you spend more over time.

There are three rate limit types you might be hitting:

  • RPM (requests per minute) — how many API calls you can make in 60 seconds
  • TPM (tokens per minute) — total tokens (input + output) processed per minute
  • TPD (tokens per day) — daily token quota, mainly for free-tier users

New accounts on the free tier typically get 3 RPM and 40,000 TPM for GPT-4o-mini, but practically nothing for GPT-4. Paid accounts start at Tier 1 with higher limits, then progress through Tier 2, 3, 4, and 5 as cumulative spend increases. You can check your current tier at platform.openai.com/settings/organization/limits — it shows your exact RPM and TPM for each model.

The error response includes a header like `retry-after: 20`, telling you how many seconds to wait before trying again. Most 429s come from hitting TPM limits when processing long documents or conversations, not from too many individual requests.

How to fix it

1. Check your current limits

Go to platform.openai.com/settings/organization/limits. You'll see your tier and the exact rate limits for each model. If you're on Tier 1 with 500 RPM for GPT-4o, and you're looping through 1,000 items without delays, that's your problem.

2. Add exponential backoff

Wrap your API calls in retry logic that waits progressively longer after each 429. In Python:

```python

import time

for attempt in range(5):

try:

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

break

except openai.RateLimitError as e:

wait = (2 ** attempt) + random.uniform(0, 1)

time.sleep(wait)

```

This waits ~1 second, then ~2, then ~4, giving your quota time to reset.

3. Batch requests and add delays

If you're processing lists, add `time.sleep(1)` between calls or process in smaller batches. For embeddings, use the batch endpoint instead of individual calls — you can embed up to 2,048 inputs in one request.

4. Switch to a faster model

If you're using GPT-4o for simple tasks, switch to GPT-4o-mini or GPT-3.5-turbo. They have 10-30x higher TPM limits. Check the API error 429 troubleshooting guide for model-specific limits.

5. Increase your tier

Your tier rises automatically with spending. Tier 2 needs $50 total spend, Tier 3 needs $100, Tier 4 needs $1,000. If you need higher limits immediately, add credits at platform.openai.com/settings/organization/billing and wait 24 hours — tier upgrades aren't instant.

If that doesn't work

If you've implemented backoff and you're still stuck, you might need a limit increase. Go to platform.openai.com/settings/organization/limits and click "Request increase" next to the model. Describe your use case, current limits, and requested limits. OpenAI reviews these manually — expect 3-7 days for a response.

Include specifics: "Currently Tier 2 with 5,000 TPM for GPT-4o. Processing customer support tickets requires 15,000 TPM during business hours." Vague requests get denied.

If you're seeing 429s alongside other errors like 401 or 500, check your API key validity and contact OpenAI support through the Help button in your dashboard. Don't email help@openai.com directly — it's a black hole.

Questions people actually ask

Q: Can I pay to remove rate limits entirely?

A: No. Even Tier 5 accounts have limits, just much higher ones. The highest tier gives you millions of TPM, but there's no unlimited option.

Q: Why does my limit reset mid-request?

A: Rate limits use a sliding window, not a hard 60-second reset. Tokens expire from the window on a rolling basis, so your available quota changes constantly as old requests age out.

Q: Does 429 consume my credits?

A: No. Failed requests don't charge you — you only pay for completed API calls that return tokens.

What to remember

  • Check your exact tier and limits at platform.openai.com/settings/organization/limits before anything else
  • Implement exponential backoff in all production code — retry with increasing delays
  • TPM limits hit harder than RPM for long conversations or document processing
  • Switch to GPT-4o-mini or GPT-3.5-turbo for 10-30x higher throughput on simple tasks
  • Tier increases happen automatically with spending, but take 24 hours to apply after payment

---

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

Related help