A 429 Too Many Requests, or a vendor’s 403 that carries a rate-limit reason, means you went over a limit. Read the status code, Retry-After, the vendor’s rate-limit headers and the error body to see which limit it was: per user, per key, per project or app, or global. Then wait for the reset or back off, and fix the cause.
Table of Contents
Find which limit you hit
- Read the status code. 429 is the standard one, defined in RFC 6585 section 4. GitHub and Google Drive also use 403, so a 403 whose body names a rate limit is a limit.
- Read
Retry-After. It is seconds or an HTTP date, and not every 429 carries it. - Read the vendor’s rate-limit headers. GitHub sends
x-ratelimit-remaining: 0and an epochx-ratelimit-reset; the other vendors’ families are in the table. - Read the error body for the scope. Google’s Drive API names the reason (
userRateLimitExceededis per user,rateLimitExceededthe project’s). Discord sendsX-RateLimit-Scopeasuser,globalorshared. OpenAI applies limits per organization, so a teammate’s traffic counts against you. - Pick the fix that matches the scope. Wait for the reset. Slow down, batch calls where the vendor supports it, and cache what you fetch twice. Authenticate where signed-in callers get more: GitHub documents 60 requests per hour unauthenticated and 5,000 for an authenticated user. Or ask for more quota, as in the table.
- Do not retry the ones that retrying cannot fix. Anthropic documents a spend-cap 429 with no
retry-afterheader that fails until access resumes. OpenAI says quota and billing errors cannot be resolved by retrying.
Rate limit errors by vendor
Every cell comes from the vendor’s own documentation, read on 22 October 2026. The wording differs by vendor, and “API rate limit exceeded” is not a string I found in these pages, so I attribute it to none of them.
| Vendor | Status | Exact string or reason | When to retry | What the vendor says to do |
|---|---|---|---|---|
| GitHub REST API, primary limit | 403 or 429 | x-ratelimit-remaining is 0 |
After x-ratelimit-reset (UTC epoch seconds) |
Do not retry before the reset. Authenticate for a higher limit. |
| GitHub, secondary limit | 403 or 429 | An error message saying you exceeded a secondary rate limit | retry-after seconds if present; else the reset if remaining is 0; else at least one minute |
Then back off exponentially and stop after a set number of tries. |
| Google Drive API | 403 | userRateLimitExceeded, “User Rate Limit Exceeded” |
Not stated; use backoff | Raise the per-user quota, use quotaUser if one user acts for many, back off. |
| Google Drive API | 403 | rateLimitExceeded, “Rate Limit Exceeded” (the project’s limit) |
Not stated; use backoff | Raise the quota, batch requests, back off. |
| Google Drive API | 429 | rateLimitExceeded, “Rate Limit Exceeded” (too many requests too quickly) |
Not stated; use backoff | Retry with exponential backoff. |
| Google Cloud quotas | 429 over HTTP/REST; Compute Engine 403 QUOTA_EXCEEDED, or 403 RATE_LIMIT_EXCEEDED for a rate quota |
gRPC returns ResourceExhausted; google.rpc.Code maps RESOURCE_EXHAUSTED to 429 |
Rate quotas reset after an interval set by each service | Request a quota adjustment. |
| OpenAI API | 429 | “Rate limit reached for requests”. A separate 429, “Slow down”, has type rate_limit_error and code slow_down |
Retry-After, and x-ratelimit-reset-requests or -tokens |
Pace requests; without Retry-After, back off with jitter. Ask the organization owner for a higher limit. |
| Anthropic API | 429 | Type rate_limit_error; the body says which limit was exceeded |
retry-after seconds; anthropic-ratelimit-*-reset in RFC 3339 format |
Wait that long; earlier retries fail. Raise traffic gradually. |
| Discord API | 429 | “You are being rate limited.” with global: true and X-RateLimit-Global for the global limit |
Retry-After header or retry_after field in the JSON body |
Rely on those two. The global limit is 50 requests per second per bot. |
| Microsoft Graph | 429 | Code TooManyRequests, message “Please retry again later.” |
Retry-After seconds |
Wait that long; without the header, use exponential backoff. |
Read the rate-limit headers with curl
GitHub’s documentation for the rate limit endpoint says “Accessing this endpoint does not count against your REST API rate limit” about /rate_limit, so it is a safe place to read the header family. I ran this on 22 October 2026, without a token:
$ curl -s -D - -o /dev/null https://api.github.com/rate_limit | tr -d '\r' | grep -i '^x-ratelimit'
x-ratelimit-limit: 60
x-ratelimit-remaining: 60
x-ratelimit-used: 0
x-ratelimit-resource: core
x-ratelimit-reset: 1792677592
$ date -u -r 1792677592
Thu Oct 22 13:59:52 UTC 2026
The 60 matches GitHub’s documented unauthenticated limit, which is tied to the caller’s IP address. x-ratelimit-reset is epoch seconds, and date -u -r decodes it (on Linux, date -u -d @1792677592).
Back off with Retry-After and jitter
In your own client, sleep at least as long as Retry-After, but never less than your own jittered backoff, because Retry-After can parse to zero while the server is still refusing you. That clamp is the difference between four requests and eight in the runs below:
const ceiling = Math.min(CAP_MS, BASE_MS * 2 ** attempt);
const jittered = Math.floor(Math.random() * ceiling); // full jitter
let wait;
if (serverWait === null) wait = jittered; // no Retry-After sent
else if (serverWait < jittered) wait = jittered; // the floor that matters
else wait = serverWait;
What a correct 429 looks like on the wire
A fixed-window limiter allowing three requests per three seconds, rejecting the fourth:
HTTP/1.1 429 Too Many Requests
RateLimit-Policy: "demo";q=3;w=3
RateLimit: "demo";r=0;t=3
RateLimit-Limit: 3
RateLimit-Remaining: 0
RateLimit-Reset: 3
Retry-After: 3
Content-Type: application/problem+json
RFC 6585 says a 429 “MUST NOT be stored by a cache” and “MAY include a Retry-After header”. RFC 9110 section 10.2.3, which obsoleted RFC 7231, does not mention 429 at all. A 429 without Retry-After is legal.
Retry-After has two forms and both are mandatory to parse
RFC 9110 section 10.2.3 defines the grammar as Retry-After = HTTP-date / delay-seconds. Both forms, emitted by the same endpoint:
delay-seconds form: Retry-After: 3
HTTP-date form: Retry-After: Mon, 10 Aug 2026 04:03:49 GMT
The date form is IMF-fixdate from RFC 9110 section 5.6.7: always GMT, with whole-second resolution. That is the cause of the bug below. The bug, the jittered floor that ends it and the header blocks on this page are in one script you can run, api-rate-limit-exceeded-error-429.sh, which starts its own rate-limited server and backoff client on 127.0.0.1 only.
The RateLimit fields are an Internet-Draft, not a standard
RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset come from the IETF draft draft-ietf-httpapi-ratelimit-headers. It has not been published as an RFC. The script asks datatracker and prints the answer; this is the output of my run on 22 October 2026:
rfc=None rev='11' expires='2026-11-24T09:26:58Z'
Revision 11, no RFC number, expiring 24 November 2026. Treat it as work in progress and do not break if a server omits it.
The three integer fields are the old syntax, last defined in draft-06. Draft-07 used a single RateLimit field with limit=, remaining= and reset= parameters. From draft-08 onward the document specifies two structured fields, one advertising the policy and one reporting what is left:
RateLimit-Policy: "demo";q=3;w=3 # named policy, quota 3, window 3s
RateLimit: "demo";r=0;t=3 # 0 remaining, 3s until reset
If you operate an API, emit both: deployed clients read the legacy trio, and the pair is where the draft is going. As a consumer, treat all of it as advisory. The draft sets precedence: “If a response contains both the RateLimit and Retry-After fields, the Retry-After field MUST take precedence and the effective window MAY be ignored.”
The bug: honouring Retry-After literally produces a hot loop
A client that does what most tutorials say (parse Retry-After, sleep that long, retry) against a server sending the HTTP-date form. Lines are shortened from the script’s log:
t=+ 7ms attempt 1: HTTP 429 | Retry-After: Mon, 10 Aug 2026 04:03:52 GMT
t=+ 8ms server said 1585ms; sleeping 1585ms
t=+ 1597ms attempt 2: HTTP 429 | Retry-After: Mon, 10 Aug 2026 04:03:52 GMT
t=+ 1597ms server said 0ms; sleeping 0ms
t=+ 1600ms attempt 3: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1603ms attempt 4: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1607ms attempt 5: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1610ms attempt 6: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1612ms attempt 7: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1614ms attempt 8: HTTP 429 | ... server said 0ms; sleeping 0ms
t=+ 1616ms exhausted 8 attempts
Seven requests in nineteen milliseconds, at a server that had just asked the client to slow down. The printed deadline is truncated to a whole second, so it names an instant slightly before the real window boundary. The client wakes early, gets another 429, computes deadline - now as zero or less and spins until the window rolls. Its exponential backoff never ran, because Retry-After was present on every response and always won.
With the floor from the clamp above, same server, same date form:
t=+ 4ms attempt 1: HTTP 429 | server said 2089ms; sleeping 2089ms
t=+ 2099ms attempt 2: HTTP 429 | server said 0ms; jitter ceiling 800ms -> sleeping 417ms
t=+ 2519ms attempt 3: HTTP 429 | server said 0ms; jitter ceiling 1600ms -> sleeping 1582ms
t=+ 4105ms attempt 4: HTTP 200
SUCCESS after 4 attempt(s)
Four attempts across 4.1 seconds instead of eight across 1.6. When Retry-After is absent, the ceilings double (400ms, 800ms, 1600ms, 3200ms, 6400ms) with a fresh random sleep inside each. Without the randomness, clients throttled together retry together.
429 is not 503
RFC 9110 section 15.6.4 defines 503 as “temporary overload or scheduled maintenance”, the server’s problem. 429 is a 4xx: your volume against your quota. Both may carry Retry-After; only 429 should carry quota fields. The script’s /503 endpoint sends no RateLimit headers, which is the right shape:
HTTP/1.1 503 Service Unavailable
Retry-After: 2
Content-Type: application/problem+json
Retrying a 503 harder will not help, because you are not the cause. Retrying a 429 more slowly will.
Real APIs and limiters this page does not cover
The retry client ran against a loopback server on one Mac (Node 22.22.1 and curl 8.7.1 in the 22 October 2026 run), with no network latency or distributed limiter, and its timings vary from run to run because of the jitter, so read them as client logic, not performance data. The only live call was the one unauthenticated GitHub request shown above, and it did not hit a limit. I read the Google, OpenAI, Anthropic, Discord and Microsoft documentation but did not call those APIs, so I have not seen their errors myself. I did not test an authenticated GitHub call, a quota request, sliding-window or token-bucket limiters, concurrency limits or the draft’s pk parameter.