An API rate limit exceeded error means you sent more requests, or more tokens, in a time window than your account allows, so the server answered HTTP 429 Too Many Requests and did not run the request. It clears on its own: wait the number of seconds in the Retry-After header, or back off exponentially with random jitter, then send the same request again.
The catch is that LLM providers also return 429 for problems a retry can't fix. OpenAI sends one when your prepaid balance is empty, Anthropic when your tier's monthly spend cap is reached, and Gemini when a daily quota is used up. Retrying those only adds delay.
Below: how to tell them apart on OpenAI, Anthropic (Claude), Google Gemini and DeepSeek, the tier limits as of 5 November 2026, and retry code tested with openai 3.45.0, anthropic 2.4.0 and google-genai 2.34.0.
What does rate limit exceeded mean?
A rate limit counts what you send per window and refuses the request that goes over. LLM APIs count several things, and whichever runs out first triggers the error:
- Requests per minute (RPM) and, on some models, requests per day (RPD).
- Tokens per minute (TPM). Anthropic counts input (ITPM) and output (OTPM) separately.
- Requests in flight at the same moment, which is DeepSeek's only published limit.
- Dollars spent per 10 minutes, a separate Gemini limit.
Limits belong to the account, not the key. OpenAI applies them per organization and project, Gemini per project ("not per API key"), and DeepSeek per account "regardless of which API Key is used". A second key in the same account adds no capacity.
Three details explain most 429s that arrive below the published limit:
- Limits are enforced in short slices. Anthropic's rate limits page says 60 RPM may be enforced as 1 request per second, and its token bucket refills continuously rather than resetting each minute.
- Failed requests count. OpenAI's rate limits guide says unsuccessful requests use up your per-minute limit, so a tight retry loop keeps you over it.
- Growth rate counts. OpenAI's
slow_downand Anthropic's acceleration limits can fire when traffic jumps, even below your RPM and TPM.
Which API rate limit exceeded error did you get?
The status code alone doesn't tell you. Read the code in the body.

OpenAI
OpenAI's error codes guide lists these under 429 and 503:
Status and error.code | Cause | Retry? |
|---|---|---|
429 rate_limit_exceeded | RPM or TPM for that model at your tier | Yes, after Retry-After |
429 slow_down (type rate_limit_error) | Traffic grew too fast | Yes, at a lower rate |
429 credit_balance_exhausted | Prepaid balance is empty | No |
429 organization_spend_limit_exceeded, project_spend_limit_exceeded | A hard spend limit you set | No |
429 organization_usage_limit_exceeded | OpenAI's monthly usage limit for your tier | No |
503 server_is_overloaded | The model is overloaded | Yes |
Billing errors can still carry error.type insufficient_quota, the type that usually comes with OpenAI's "You exceeded your current quota" message. Since 2 September 2026, fast ramps return 429 slow_down, not 503. A TPM message shows your limit, tokens used and tokens requested, per Microsoft's Dev Proxy guide.
One 429 isn't about you: Flex processing returns 429 Resource Unavailable when capacity is short, and OpenAI's Flex guide says you aren't charged for it.
Anthropic (Claude)
A rate-limit 429 has type rate_limit_error, a message naming the limit, and often a retry-after header (not every 429 has one). A public report from March 2026 quotes one:
This request would exceed the rate limit for your organization (...) of 2,000,000 input tokens per minute.
The monthly spend cap looks almost the same. From Anthropic's docs:
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "You have reached your API usage limits: your organization has crossed its monthly API usage threshold, set based on your organization's API tier. You will regain access on 2026-09-01 at 00:00 UTC.",
"details": { "error_code": "enforced_spend_limit_reached" }
},
"request_id": "req_018EeWyXxfu5pfWkrYcMdjWG"
}
It has no retry-after header, and retries, the SDK's included, fail until access resumes. A spend limit you set yourself returns a 400 invalid_request_error instead. A 529 overloaded_error means the API is busy for everyone; see what to do during an LLM API outage.
Gemini
Gemini reports per-minute and per-day quotas alike as 429 RESOURCE_EXHAUSTED, usually with the text "You exceeded your current quota". The detail that matters is in the body. Trimmed from public reports:
{"error": {"code": 429, "status": "RESOURCE_EXHAUSTED",
"message": "You exceeded your current quota, please check your plan and billing details. ...",
"details": [
{"@type": "type.googleapis.com/google.rpc.QuotaFailure",
"violations": [{"quotaId": "GenerateRequestsPerDayPerProjectPerModel-FreeTier"}]},
{"@type": "type.googleapis.com/google.rpc.RetryInfo", "retryDelay": "34.074824224s"}]}}
A quotaId with PerMinute clears within a minute. One with PerDay resets at midnight Pacific time, whatever retryDelay says. Google documents no rate-limit headers, so the wait is only in the body. An empty Prepay balance returns 402, which Google's troubleshooting guide says not to retry.
DeepSeek
DeepSeek publishes no RPM or TPM limits. Its rate limit page caps requests in flight per account: 2,500 on deepseek-flash and 500 on deepseek-v4-pro. A request counts from the moment it's sent until the response finishes, and anything over the cap gets a 429. An empty balance is a 402 and an overloaded server a 503. A queued request gets keep-alive lines, and DeepSeek drops it if inference hasn't started within 10 minutes.
Rate limit or quota: the 429s a retry can't fix
| Provider | Error | Cause | What restores access |
|---|---|---|---|
| OpenAI | 429 credit_balance_exhausted | Prepaid balance is empty | Pay in billing settings |
| OpenAI | 429 *_spend_limit_exceeded | Your own hard spend limit | Raise it, or wait for the monthly reset |
| OpenAI | 429 organization_usage_limit_exceeded | Tier's monthly usage limit ($500 on Build) | A higher approved limit, or the next tier |
| Anthropic | 429 enforced_spend_limit_reached | Tier's spend cap ($500 on Start) | Tier increase, or 00:00 UTC on the 1st |
| Anthropic | 400 "You have reached your specified API usage limits" | Your own spend limit | Raise it |
| Gemini | 429 RESOURCE_EXHAUSTED, PerDay quota | Daily quota | Midnight Pacific, or a paid tier |
| Gemini | 402 payment_required | Prepay balance at $0 | Buy more, or turn on auto-reload |
| DeepSeek | 402 Insufficient Balance | Balance is empty | Pay |
Gemini also pauses every project on a billing account at its tier's monthly spend cap until the 1st. Your retry code must refuse all of these: the OpenAI and Anthropic SDKs retry a 429 without reading its code.
OpenAI API rate limits by usage tier
OpenAI API rate limits depend on your usage tier and the model. On 6 October 2026 OpenAI cut its paid tiers from five to three, so any guide showing Tier 1 to Tier 5 is out of date. From the rate limits guide and the model pages, 5 November 2026:
| Tier | How you qualify | Monthly usage limit | gpt-6-astra, gpt-6.1-sol, gpt-6.1-terra (RPM / TPM) | gpt-6-luna (RPM / TPM) |
|---|---|---|---|---|
| Free | In an allowed country | $100 | Not supported | Not supported |
| Build | $5 paid in total | $500 | 5,000 / 1,000,000 | 5,000 / 2,000,000 |
| Launch | $100 paid in total | $5,000 | 10,000 / 4,000,000 | 10,000 / 10,000,000 |
| Grow | $500 paid in total | $200,000 | 15,000 / 40,000,000 | 30,000 / 180,000,000 |
- You move up automatically when total payments reach the threshold. Grow used to need $1,000. Check your tier and per-model limits under Settings > Organization > Limits, where Upgrade tier sits in the Usage Tiers section.
- The Free tier can't call the GPT-6 models or gpt-5.6-luna. It can use embeddings: text-embedding-3-small allows 100 RPM, 2,000 RPD and 40,000 TPM.
- Long-context requests have a separate limit, some model families share one limit, and an organization owner can set lower limits per project.
- Above 1 million TPM, OpenAI's rule of thumb is to grow traffic by no more than 50% every 15 minutes. Going from 1 million to 4 million TPM takes four steps, about an hour.
The OpenAI API guide covers keys, billing and the first request.

Claude and Gemini tiers
Anthropic assigns tiers from usage history; new organizations may start in an Evaluation tier below Start. Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 each get their own limits:
| Anthropic tier | Monthly spend cap | RPM | Input tokens/min | Output tokens/min |
|---|---|---|---|---|
| Start | $500 | 4,000 | 2,000,000 | 400,000 |
| Build | $1,000 | 10,000 | 5,000,000 | 1,000,000 |
| Scale | $200,000 | 13,000 | 10,000,000 | 2,000,000 |
Ask for more with Request tier increase on the Console's Rate limits page. The Claude API key guide covers the Console side.
Gemini publishes the tiers but shows per-model limits only in AI Studio:
| Gemini tier | How you qualify | Monthly spend cap | Spend per 10 minutes |
|---|---|---|---|
| Free | Active project | None | None |
| Tier 1 | Billing account linked | $250 | $10 |
| Tier 2 | $100 paid, 3 days after first payment | $2,000 | $200 |
| Tier 3 | $1,000 paid, 30 days after first payment | $20,000 to $100,000+ | $200 |
The spend-rate limit bites early. A Gemini 3.8 Flash request with 10,000 input and 1,000 output tokens costs $0.01125 at $0.75 / $3.75 per million, so a Tier 1 project can send about 888 of them per 10 minutes, roughly 89 a minute. From 1 January 2027 the price doubles and that halves to about 44. The Gemini API pricing guide has the full price list.
Fix 1: retry with backoff, jitter and Retry-After
The official SDKs each handle a 429 differently. Against a local server that always returns 429:

| SDK | Default retries | Delay without a header | Retry-After |
|---|---|---|---|
openai 3.45.0 | 2 | 0.5 s, then 1 s, doubling to 8 s, minus up to 25% | Honored up to 120 s; longer means no retry |
anthropic 2.4.0 | 2 | Same | Honored, no upper limit |
google-genai 2.34.0 | 0 | With HttpRetryOptions(): 4 retries, about 1, 2, 4, 8 s plus jitter | Ignored |
Google's troubleshooting page says the Python SDK retries up to four times by default. In 2.34.0 it sent one request and stopped until retry options were passed.
So without a header the OpenAI and Anthropic SDKs give up after about two seconds, and they treat a spend cap like a busy minute. The rules from OpenAI's guide hold for every provider: treat Retry-After as a minimum and add a small random delay, cap both attempts and total time, never retry billing errors, and turn off SDK retries when you wrap your own (otherwise 3 SDK attempts times 6 of yours is 18 requests).
import random
import time
from email.utils import parsedate_to_datetime
import openai
def header_wait(headers):
"""Seconds the server asked for in retry-after-ms or Retry-After, else None."""
if headers is None:
return None
ms = headers.get("retry-after-ms")
if ms:
try:
return float(ms) / 1000
except ValueError:
pass
value = headers.get("retry-after")
if not value:
return None
try:
return float(value) # "20"
except ValueError:
try: # "Wed, 05 Nov 2026 18:00:00 GMT"
return max(0.0, parsedate_to_datetime(value).timestamp() - time.time())
except (TypeError, ValueError):
return None
def with_backoff(call, classify, attempts=6, base=1.0, cap=60.0, deadline=300.0):
"""Run call(); on a retryable error wait and try again.
classify(err) returns (retry, wait_hint), where wait_hint is the server's delay or None."""
start = time.monotonic()
for attempt in range(1, attempts + 1):
try:
return call()
except Exception as err:
retry, hint = classify(err)
if not retry or attempt == attempts:
raise
if hint is None:
wait = random.uniform(0, min(cap, base * 2 ** attempt)) # full jitter
else:
wait = hint + random.uniform(0, 1) # server minimum, plus a little spread
if time.monotonic() - start + wait > deadline:
raise # out of time: queue the job instead of hammering
time.sleep(wait)
client = openai.OpenAI(max_retries=0) # this loop owns the retries
STOP_CODES = {
"insufficient_quota", "credit_balance_exhausted", "organization_spend_limit_exceeded",
"project_spend_limit_exceeded", "organization_usage_limit_exceeded",
}
def classify_openai(err):
if isinstance(err, openai.RateLimitError): # 429
if err.code in STOP_CODES or err.type == "insufficient_quota":
return False, None # billing, not speed
return True, header_wait(err.response.headers)
if isinstance(err, openai.InternalServerError): # 500, 503 server_is_overloaded
return True, header_wait(err.response.headers)
if isinstance(err, openai.APIConnectionError): # includes timeouts
return True, None
return False, None # 400, 401, 402, 403, 404
response = with_backoff(
lambda: client.responses.create(model="gpt-6-luna", input="Say hello."),
classify_openai,
)
The same classify_openai works for DeepSeek and other OpenAI-compatible APIs: point the client at their base URL and their 402 falls through as "don't retry". For Claude and Gemini, swap the classifier:
import anthropic
from google.genai import errors
def classify_anthropic(err):
if isinstance(err, anthropic.RateLimitError): # 429
error = err.body.get("error", {}) if isinstance(err.body, dict) else {}
if (error.get("details") or {}).get("error_code") == "enforced_spend_limit_reached":
return False, None # tier spend cap: wait for the 1st
return True, header_wait(err.response.headers)
if isinstance(err, anthropic.InternalServerError): # 500, 529 overloaded_error
return True, header_wait(err.response.headers)
if isinstance(err, anthropic.APIConnectionError):
return True, None
return False, None
def classify_gemini(err):
if not isinstance(err, errors.APIError):
return False, None
if err.code in (500, 503, 504):
return True, None
if err.code != 429:
return False, None # 400, 402 Prepay empty, 403
body = err.details if isinstance(err.details, dict) else {}
hint = None
for d in body.get("error", body).get("details", []):
if d.get("@type", "").endswith("QuotaFailure"):
for v in d.get("violations", []):
if "PerDay" in v.get("quotaId", ""):
return False, None # daily quota: resets at midnight PT
if d.get("@type", "").endswith("RetryInfo"):
hint = float(d.get("retryDelay", "0s").rstrip("s")) # "34.07s" -> 34.07
return True, hint
Create the Claude client with anthropic.Anthropic(max_retries=0). Against a local server returning each documented body, this code waited out Retry-After and succeeded, stopped at once on insufficient_quota, credit_balance_exhausted, enforced_spend_limit_reached and a PerDay quota, and honored a 1.5 s retryDelay on a per-minute quota. On streaming requests, retry only errors that arrive before the stream starts; never replay one after you've used part of its output.
Fix 2: send fewer requests and fewer counted tokens
Backoff gets one request through. If 429s are routine, cut what counts against the limit:
- Move work that doesn't need an answer right away to a batch API. OpenAI's Batch API doesn't touch your live limits and costs 50% less, with its own queue limit (20,000,000 tokens for gpt-6-luna on Build). Anthropic's Message Batches and Gemini's Batch API also have their own limits.
- Cache stable prompt prefixes on Claude. On most Claude models only uncached input counts toward ITPM, so at an 80% cache hit rate a 2,000,000 ITPM limit carries 10,000,000 input tokens a minute.
- Set the output cap close to what you need on OpenAI. Its limiter counts the larger of
max_tokensand the estimated tokens in your request. Claude counts only output actually generated. - If you hit RPM with TPM to spare, put several small tasks in one request.
- Cap concurrency where the limit is concurrency, as on DeepSeek:
import os
import threading
import openai
ds = openai.OpenAI(base_url="https://api.deepseek.com", api_key=os.environ["DEEPSEEK_API_KEY"])
in_flight = threading.BoundedSemaphore(400) # under deepseek-v4-pro's 500 per account
def ask_deepseek(messages):
with in_flight:
return ds.chat.completions.create(model="deepseek-v4-pro", messages=messages)
Fix 3: spread load across models
Limits are per model, so a second model is spare capacity. Claude Sonnet 5.5 and Opus 5.5 each have their own 4,000 RPM on Start. OpenAI's limits vary by model too, though models listed under a "shared limit" on your limits page draw on one pool. When the main model stays limited after a few retries, move the request down a list:
def ask(prompt, models=("gpt-6.1-sol", "gpt-6-luna")):
for model in models:
try:
return with_backoff(
lambda: client.responses.create(model=model, input=prompt),
classify_openai, attempts=3, deadline=20,
)
except openai.RateLimitError as err:
if err.code in STOP_CODES:
raise # billing: another model won't help
raise RuntimeError("every model is rate limited")
Two related moves: on Flex, retry a 429 Resource Unavailable with service_tier set to auto to fall back to standard processing, and give each app its own OpenAI project or Claude workspace with lower limits, so one batch job can't starve the rest. The OpenAI spending limits guide covers project limits.
Monitor your limits before they bite
Every OpenAI and Claude response reports how much room is left:
| Provider | Headers | Reset format |
|---|---|---|
| OpenAI | x-ratelimit-limit-*, x-ratelimit-remaining-*, x-ratelimit-reset-* for requests and tokens, plus -project-tokens | Duration, such as 1s or 6m0s |
| Anthropic | anthropic-ratelimit-requests-*, -input-tokens-*, -output-tokens-* (-limit, -remaining, -reset) | RFC 3339 time |
| Gemini | None documented | RetryInfo in the 429 body |
| DeepSeek | None documented | Count requests in flight yourself |
Read them without losing the parsed response:
raw = client.responses.with_raw_response.create(model="gpt-6-luna", input="ping")
h = raw.headers
print(h.get("x-ratelimit-remaining-requests"), h.get("x-ratelimit-remaining-tokens"),
h.get("x-ratelimit-reset-tokens"))
response = raw.parse()
messages.with_raw_response.create(...) does the same in the anthropic SDK. Anthropic rounds remaining tokens to the nearest thousand.
Then:
- Log 429s by
error.codeorquotaId, not by status, so quota problems don't hide among rate limits. - Alert when remaining requests or tokens fall below about 20%.
- Check the dashboards: OpenAI's Limits page, the Claude Console's Usage page (peak tokens per minute against your limit) and AI Studio's rate-limit page.
- Test error paths before production: Microsoft's Dev Proxy
openai-throttlingpreset returns OpenAI's real 429 and 503 bodies withRetry-After, and a 30-line local server works for any provider.
What developers report
- "it’s always about squeezing within TPM limits" (OpenAI Developer Community reply to OpenAI's tier announcement, 6 Oct 2026, link)
- Across public SWE-bench Pro runs, 36 of 730 Claude Sonnet 4.5 trajectories (4.9%) ended on Anthropic 429s and were scored as task failures, undercounting the model by 1.3 points (GitHub issue on scaleapi/SWE-bench_Pro-os, 10 Mar 2026, link)
- An eval harness retried a Gemini free-tier
PerDayquota 429 for over ten minutes until stopped by hand; the report notes that gemini-cli treatsPerDayquotas as final (GitHub issue on UKGovernmentBEIS/inspect_ai, 23 Sep 2026, link) - A paid Tier 1 user got 429
RESOURCE_EXHAUSTEDfrom Gemini 2.5 Flash while, by the reporter's account, RPM, TPM and RPD stayed below their limits (GitHub issue on googleapis/python-genai, 16 Feb 2026, link) - "Probably the HN hug of death happening." A commenter trying a Gemini-backed demo saw nearly every request fail with Gemini's quota 429 (Hacker News, 22 Apr 2026, link)
Rate limits on Aight
Aight is one OpenAI-compatible API for 138 models, and going by its documented error codes, the classify_openai function above handles it as is. Its API reference keeps rate limits and money apart: a 429 means too many requests for that key in one minute (wait for Retry-After), a 402 out_of_balance is "never a rate limit", a 403 key_cap_reached means the key hit its own monthly cap, and a 503 balance_unverifiable wasn't run or charged and can be retried. The error code sits in the body's param field.
What it adds for rate-limit work: the fallback list in Fix 3 can mix makers on one key and one balance, for example gpt-6-luna ($0.10 / $0.50 per million tokens), DeepSeek-V4.1-Flash ($0.30 / $1.20) and claude-sonnet-5-5 ($2.00 / $10.00). A per-key monthly cap also stops a runaway retry loop from spending more than you planned.
Where direct is better: Aight doesn't publish its per-minute number, so load-test your peak before moving production traffic. It documents no batch endpoint, so work that can wait costs half as much through OpenAI's Batch API. And Gemini's free tier costs nothing.
FAQ
How long does a rate limit exceeded error last?
For per-minute limits, seconds to a few minutes. The Retry-After header, OpenAI's x-ratelimit-reset-* headers or Gemini's RetryInfo tell you how long. Daily quotas last until their reset (midnight Pacific on Gemini), and monthly spend caps until the 1st.
Do failed requests count against the rate limit?
On OpenAI, yes: its guide says unsuccessful requests count toward your per-minute limit. A tight retry loop keeps you limited, so the wait between attempts has to grow.
Can more API keys raise a rate limit?
No. OpenAI applies limits per organization and project, Gemini per project and DeepSeek per account, whatever key you use. Higher limits come from a higher tier or a request to the provider.
Why does a 429 arrive below the limit?
Short-window enforcement (60 RPM can mean 1 request per second), a fast ramp (slow_down or an acceleration limit), other people's traffic in the same organization, or a quota error that isn't a rate limit at all. Read the code in the body before changing anything.
Is "You exceeded your current quota" a rate limit?
On OpenAI it's billing: the insufficient_quota type means an empty balance or a spend or usage limit, and retrying won't help. On Gemini the same words cover per-minute and per-day quotas, so check the quotaId: per-minute quotas clear quickly, per-day ones at midnight Pacific.
Sources
- OpenAI: Rate limits, Error codes, Flex processing, Changelog (2 September and 6 October 2026), Models and model pages for gpt-6-luna, gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-5.6-luna and text-embedding-3-small
- OpenAI Developer Community: Update to OpenAI API Rate Limits, 6 October 2026
- Anthropic: Rate limits, Errors
- Google: Gemini API rate limits, Troubleshooting, API errors, Billing, Pricing
- DeepSeek: Error codes, Rate limit and isolation, Models and pricing
- Microsoft Learn: OpenAI "Rate limit reached" errors (Dev Proxy), 29 October 2026
- SDKs: openai on PyPI (3.45.0), anthropic on PyPI (2.4.0), google-genai on PyPI (2.34.0); retry behavior read from each package's source and measured against a local server
- GitHub: scaleapi/SWE-bench_Pro-os #78, UKGovernmentBEIS/inspect_ai #5526, google-gemini/gemini-cli #9248, googleapis/python-genai #2065, pydantic/pydantic-ai #12063
- Hacker News: comment with a Gemini 429 body, 22 April 2026
- Aight: API reference, Models and pricing
Checked on 5 November 2026. Updated 17 November 2026: Aight's current model list.