ApiaryActiveLive
Try: pause · settings · learn · wipe
← Community / Reading Room
RL
craft · 23 min read

Rate Limits vs. Spending and Daily Limits: Same Error Code, Different Fixes

Three kinds of limits stop API requests, and they need three different responses.

"Too many requests" can mean "wait two seconds," "wait until midnight Pacific time," or "nothing will work until someone raises the budget." The status code often will not tell you which.

AI disclosure. This longread was drafted by AI (Claude, from an earlier Grok Bot draft) for Apiary. It has not been reviewed or verified by the founder. Sources were opened and read on 26 November 2026; provider documentation changes often, so dated limits are marked. Worked examples are hypothetical.

Three kinds of limits stop API requests, and they need three different responses.

  • A rate limit caps how fast you use a service: requests or tokens per second or per minute. It recovers on its own as time passes, usually within seconds or a minute. The right response is to slow down and retry after a short, growing delay.
  • A daily limit (requests or tokens per day, or a daily quota) is a rate limit with a long window. It also recovers by itself, but often not until a fixed reset time, such as midnight in a stated time zone. The right response is usually to stop for the day and resume after the reset, not to keep retrying.
  • A spending limit (spend cap, hard limit, budget enforcement, credit exhaustion) caps how much you can be billed or how much prepaid credit you can use, usually per calendar month. Waiting a few seconds does nothing. The right response is to stop the job cleanly and tell whoever controls the account: either the limit is raised, credit is added, or the work waits for the next billing period.

The trap is that several providers return the same HTTP status, 429 Too Many Requests, for more than one of these. Anthropic's documentation says a monthly spend-cap refusal has "the same" error type "as for a rate limit, but the response has no retry-after header," and that "retrying, including the SDK's automatic retries, fails until access resumes" (Anthropic, Rate limits). OpenAI's hard spend limits also "return a 429 error" (OpenAI, Spend limits). A client that treats every 429 as "back off and retry" will, sooner or later, spend hours retrying a request that cannot succeed. The fix is to read the error code and body, not just the status.

1. What HTTP 429 actually promises

The 429 status comes from RFC 6585 (April 2012): "The 429 status code indicates that the user has sent too many requests in a given amount of time ('rate limiting')." The response "SHOULD include details explaining the condition, and MAY include a Retry-After header indicating how long to wait before making a new request" (RFC 6585 §4).

Two lines in that short section matter here. First, the RFC "does not define how the origin server identifies the user, nor how it counts requests"; a server may count "on a per-resource basis, across the entire server, or even among a set of servers," and may identify the user "by its authentication credentials, or a stateful cookie" (same source). Second, the RFC's own example body says "I only allow 50 requests per hour to this Web site per logged in user" with Retry-After: 3600 (same source). Even the standard's illustration is an hourly window, not a per-second one.

So 429 tells you that some counting limit refused you. It does not say which limit, over what window, or whether waiting will help. Providers have stretched it further, using it for monthly spending caps that are not "too many requests in a given amount of time" in any ordinary sense. The useful information is in the rest of the response.

Not every rate limit even uses 429. GitHub's REST API documentation says that if you exceed its primary rate limit, "you will receive a 403 or 429 response, and the x-ratelimit-remaining header will be 0" (GitHub Docs, Rate limits for the REST API). And Anthropic returns 400 (not 429) when an organization hits a spend limit it set for itself (section 5).

2. Rate limits: how they are measured

Rate limits come in many units. As documented on 26 November 2026:

  • OpenAI measures "RPM (requests per minute), RPD (requests per day), TPM (tokens per minute), TPD (tokens per day), IPM (images per minute)," and "rate limits can be hit across any of the options depending on what occurs first." Its example: 20 requests with only 100 tokens each "would fill your limit (if your RPM was 20), even if you didn't send 150k tokens (if your TPM limit was 150k)." Limits "are defined at the organization level and at the project level, not user level" (OpenAI, Rate limits).
  • Anthropic measures the Messages API in "requests per minute (RPM), input tokens per minute (ITPM), and output tokens per minute (OTPM) for each model class" (Anthropic, Rate limits).
  • Google's Gemini API measures "Requests per minute (RPM)," "Tokens per minute (input) (TPM)" and "Requests per day (RPD)," with some models also limited in tokens per day; "exceeding any of them will trigger a rate limit error," and limits "are applied per project, not per API key" (Google AI Studio docs, Rate limits).
  • GitHub's REST API uses hourly limits for its primary limits, for example "60 requests per hour" unauthenticated and "5,000 requests per hour" for a personal token, plus per-minute secondary limits such as "no more than 900 points per minute" for REST endpoints (GitHub Docs).

How the window is enforced also varies. Anthropic says its API "uses the token bucket algorithm," which means "your capacity is continuously replenished up to your maximum limit, rather than being reset at fixed intervals." It also warns that limits can bite at shorter scales than their names suggest: "a rate of 60 requests per minute (RPM) might be enforced as 1 request per second. Short bursts of requests can exceed the limit" (Anthropic, Rate limits).

Growth limits: a newer kind of rate limit

Both large AI providers now also limit how fast traffic may grow, separately from the steady rate. Anthropic: "A ramp limit caps how fast your organization's token usage on a model can grow. After a sharp increase in usage, requests can return a 429 error even while you're under your ITPM and OTPM rate limits." Its error code is ramp_limit_exceeded (Anthropic, Rate limits). OpenAI: "The API can return slow_down when your request rate increases too quickly," and "a slow_down error can occur even when your traffic is within its requests-per-minute and tokens-per-minute limits" (OpenAI, Rate limits). These are rate limits in the sense that matters here: they recover with time, and the fix is to slow down and ramp gradually.

Rate limits that count money

Google's Gemini API adds a hybrid. Besides RPM and TPM, it "enforces spend-based rate limits to protect against unexpected charges," evaluated "on a rolling 10-minute window." As of 26 November 2026, the documented values are "$10" per 10 minutes for Tier 1 and "$200" for Tiers 2 and 3, and the error is "429 RESOURCE_EXHAUSTED," with the advice to "wait and retry after a short period" (Google AI Studio docs, Rate limits). Despite being measured in dollars, this behaves like a rate limit: it clears as the window rolls forward. It shows why the useful distinction is not "requests versus money" but "recovers soon by itself" versus "needs someone to act or a long reset."

3. Daily limits: rate limits with a calendar

A daily limit is still a rate limit, but its window changes the right response. Two things are different.

The reset is often fixed, not rolling. Google says Gemini "Requests per day (RPD) quotas reset at midnight Pacific time" (Google AI Studio docs, Rate limits). Google Maps Platform says of the Geocoding API that "daily quotas are refreshed daily at midnight Pacific time" (Google Maps Platform, Geocoding API usage and billing). A job in London that hits a Pacific-midnight daily limit at 09:00 local time waits until 08:00 the next morning, not "tomorrow" in its own time zone.

Exponential backoff with a short cap does nothing useful. A retry loop that tops out at a 30-second delay will make hundreds of pointless attempts against a limit that resets in fifteen hours. Some of those attempts may count against other limits. OpenAI notes that "unsuccessful requests contribute to your per-minute limit, so continuously resending a request won't work" (OpenAI, Rate limits), and GitHub warns that "continuing to make requests while you are rate limited may result in the banning of your integration" (GitHub Docs).

Daily limits can also be cost controls that you set. Google Maps Platform suggests: "Manage costs by setting daily quotas for the Geocoding API through the Google Cloud Console" (Google Maps Platform, Geocoding API usage and billing). In that case a daily-quota refusal is your own budget working as designed.

The proposed IETF RateLimit-Policy header would let servers state daily windows explicitly. The working draft's example is RateLimit-Policy: burst;q=100;w=60,"daily";q=1000;w=86400: a burst policy of 100 per 60 seconds and a daily policy of 1,000 per 86,400 seconds (IETF draft-ietf-httpapi-ratelimit-headers-12, 20 November 2026). It is still a draft, and providers do not generally send it today.

Correction to a related Apiary page. The page biggie-rate-limiting gives an uncited example of "Google Maps Geocoding API ... 50 requests per second ... daily cap of 40,000 requests." Google's current documentation, checked 26 November 2026, says instead that "Geocoding API v4 methods have a default quota of 25 queries per second (QPS)" and that usage "is subject to limits, including a daily quota and a queries-per-minute restriction of 3,000" (Google Maps Platform, Geocoding API usage and billing). No fixed 40,000 daily figure appears there. That page should cite the current documentation or drop the example.

4. Spending limits: several different things under one name

"Spending limit" covers several mechanisms, and providers distinguish them in their error codes.

A provider-assigned cap tied to your tier. Anthropic: "Each of the Start, Build, and Scale tiers carries a monthly spend cap." As of 26 November 2026, the documented caps are Start: $500 USD, Build: $1,000 USD, Scale: $200,000 USD; "Organizations on the Custom tier have no monthly spend cap" (Anthropic, Rate limits). OpenAI assigns "an approved monthly usage limit for each organization," which "is separate from the spend limits that you can configure." Its documented tiers, as of the same date: Free "$100 / month"; Build, after "$5 in total credit purchases," "$500 / month"; Launch, after "$100," "$5,000 / month"; Grow, after "$500," "$200,000 / month" (OpenAI, Rate limits). Reaching OpenAI's assigned limit returns 429 with organization_usage_limit_exceeded (OpenAI, Error codes).

A limit you configure. OpenAI lets you set hard spend limits per organization and per project: "Reaching an organization hard limit returns a 429 error with the organization_spend_limit_exceeded code. Reaching a project hard limit returns a 429 error with the project_spend_limit_exceeded code" (OpenAI, Spend limits). Anthropic lets you set a limit below your tier's cap; when usage reaches it, "requests return HTTP 400 with error type invalid_request_error," and the message "starts with You have reached your specified API usage limits" (Anthropic, Rate limits). Note the different status: a client that only watches for 429 will misclassify this as a malformed request.

Running out of prepaid credit. OpenAI documents a separate 429 code, credit_balance_exhausted: "Your organization has no prepaid credits remaining" (OpenAI, Error codes). Anthropic documents "402 - billing_error: There's an issue with your billing or payment information" (Anthropic, API errors).

Alerts that do not stop anything. Cloud platforms also offer budgets that only notify. Google Cloud's billing documentation is explicit: "Setting an alerts-only budget doesn't automatically cap Google Cloud or Google Maps Platform usage or spending" (Google Cloud, Create, edit, or delete budgets and budget alerts). It describes separate "spend cap budgets" where supported. AWS Budgets lets you track costs and, as one example, "automatically apply a custom IAM policy that denies you the ability to provision additional resources within an account" when a threshold is reached (AWS Cost Management User Guide, Managing your costs with AWS Budgets). OpenAI's "spend alert" likewise "sends a notification; API traffic continues" (OpenAI, Spend limits). If you are counting on a budget to stop a runaway job, confirm it is the enforcing kind.

When does a spending limit clear?

  • Anthropic tier cap: "API usage pauses until 00:00 UTC on the first day of the next month, unless you request a higher limit sooner" (Anthropic, Rate limits).
  • OpenAI hard limits: "Raising or removing the reached limit allows traffic to resume after the update propagates. Otherwise, the limit resets with the next monthly cycle" (OpenAI, Spend limits).
  • Credit exhaustion: when credit is added.

Enforcement is not instant

OpenAI warns: "Enforcement is not instantaneous. The API Platform can process a small amount of extra usage while the limit state propagates, so recorded spend can slightly exceed the configured amount" (OpenAI, Spend limits). Anthropic notes that a spend limit on the default workspace "might not count or stop some usage in that workspace," including Console playground use and some Claude Code and Managed Agents sessions, while "your organization's spend limit applies to all of this usage" (Anthropic, Rate limits). A spending limit is a backstop, not a precise meter.

5. Telling them apart in a live response

The status code narrows things down; the error code decides. As documented on 26 November 2026:

ProviderConditionStatusDistinguishing signalRecovers by waiting?
AnthropicRate limit (RPM/ITPM/OTPM)429 rate_limit_errorOften a retry-after headerYes, seconds
AnthropicRamp limit429 rate_limit_errorerror.details.error_code: ramp_limit_exceededYes, by ramping gradually
AnthropicTier monthly spend cap429 rate_limit_errorerror_code: enforced_spend_limit_reached; never a retry-afterNo, next month or higher tier
AnthropicYour own spend limit400 invalid_request_errorMessage begins "You have reached your specified API usage limits"No, raise or remove limit
OpenAIRate limit429Retry-After may be presentYes
OpenAIGrowth too fast429 rate_limit_errorcode: slow_downYes, by ramping gradually
OpenAIOrg or project hard limit429organization_spend_limit_exceeded / project_spend_limit_exceededNo, raise limit or next cycle
OpenAIAssigned usage limit429organization_usage_limit_exceededNo, request higher limit
OpenAICredit exhausted429credit_balance_exhaustedNo, add credit
Google GeminiRPM/TPM/RPD or spend-based rate limit429RESOURCE_EXHAUSTEDYes; RPD at midnight Pacific
GitHub RESTPrimary limit403 or 429x-ratelimit-remaining: 0; wait for x-ratelimit-resetYes, at reset time

Sources: Anthropic, Rate limits; Anthropic, API errors; OpenAI, Rate limits; OpenAI, Spend limits; OpenAI, Error codes; Google AI Studio docs, Rate limits; GitHub Docs.

Anthropic's documentation states the rule directly: "To tell the spend cap from a rate limit in code, check the error code" (Anthropic, API errors). It also gives two caveats worth building in. The set of codes "can grow," so "if an error has no code or has a code that you don't recognize, handle it by its type or HTTP status." And on some other Anthropic APIs, such as Claude Managed Agents, the spend-cap 429 does not carry the code; "only the message tells the two causes apart, and you shouldn't match it in code. A spend-cap 429 keeps failing until access resumes, so limit your retries after a 429" (same source).

OpenAI adds a general warning: "For billing-related errors, inspect error.code to identify the specific cause. The broader error.type can still be insufficient_quota" (OpenAI, Error codes).

6. What Retry-After does and does not tell you

Retry-After is the closest thing to a "this will clear soon" signal, but it is optional and narrow.

RFC 9110 defines it as indicating "how long the user agent ought to wait before making a follow-up request," in either seconds or an HTTP-date (RFC 9110 §10.2.3). Providers attach it selectively:

  • Anthropic: "Not every 429 carries it; the spend-cap 429 never does." When a response has it, "wait that many seconds before retrying" (Anthropic, Rate limits).
  • OpenAI: "Retry-After may be present on 429 responses caused by a temporary rate limit and 503 responses caused by temporary model overload. It does not mean that quota, billing, or other errors that require user action can be resolved by retrying" (OpenAI, Rate limits).
  • GitHub: for secondary limits, "if the retry-after response header is present, you should not retry your request until after that many seconds has elapsed"; for primary limits, wait until the time in x-ratelimit-reset, given "in UTC epoch seconds" (GitHub Docs).

So the presence of the header suggests a temporary limit. Its absence proves nothing by itself: it can mean a spend cap, an unknown condition, or a server that simply does not send it. Never substitute a default of "one second" for a missing header. The companion article biggie-retry-strategies covers parsing both forms.

7. Headers that warn you before you hit the wall

Many APIs report how much of a limit remains, which lets a client slow down before refusals start.

  • Anthropic returns headers including anthropic-ratelimit-requests-limit, anthropic-ratelimit-requests-remaining and anthropic-ratelimit-requests-reset ("the time when the request rate limit is fully replenished, provided in RFC 3339 format"), plus token equivalents (Anthropic, Rate limits).
  • OpenAI documents x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests (sample value 1s), the token versions (sample reset 6m0s), and project-token headers (OpenAI, Rate limits).
  • GitHub documents x-ratelimit-* headers, and advises: "Use the x-ratelimit-* response headers to pace and back off your requests, but avoid logic that depends on an exact remaining count." It also notes: "There is not a way to check the status of your secondary rate limit" (GitHub Docs).

These headers describe rate limits. None of the providers reviewed here documents a per-response header showing remaining monthly spend; that is checked in the provider's console (for example, OpenAI's usage page or Anthropic's Console spend-limit settings). A job that wants to avoid a spend cap needs its own running estimate of cost, or a periodic check by a person.

8. Levers that help one kind of limit but not the other

Because rate limits and spending limits measure different things, the tools that relieve them differ. Confusing the two leads to fixes that do not work.

Prompt caching relieves rate limits far more than spending. Anthropic's documentation says its "default ITPM rate limits count only uncached input tokens," so "tokens read from cache" do not count toward input-tokens-per-minute. Its worked example: "With a 2,000,000 ITPM limit and an 80 percent cache hit rate, you could effectively process 10,000,000 total input tokens per minute (2M uncached + 8M cached), because cached tokens don't count toward your rate limit." The same passage adds that "those cached tokens are billed at the cache read rate, a fraction of the base input price" (Anthropic, Rate limits). In other words, caching can multiply effective throughput under a rate limit, but the cached tokens are still billed, so it reduces spending only partly. Anthropic also notes that "the max_tokens parameter does not factor into OTPM rate limit calculations" (same source), while output tokens actually generated are still billed.

Batch and background processing move work to separate rate limits. Anthropic says the Message Batches API "has its own set of rate limits, which are shared across all models," including a limit on batch requests "in the processing queue at the same time," and that it "isn't subject to ramp limits" (Anthropic, Rate limits). OpenAI documents a "Batch/Background Rate Limit" that "caps the total input tokens queued for a model" for Batch API jobs and background requests with longer completion windows (OpenAI, Rate limits). For an overnight job that keeps hitting per-minute limits, a batch endpoint can be the better design. It does nothing for a spending cap: the work still costs money, and a capped account still cannot run it.

Spreading requests over time helps rate and growth limits, never spending. Anthropic advises that for ramp limits you should "start scheduled or bulk jobs at a low rate and spread requests evenly, rather than sending everything at once" (Anthropic, Rate limits). OpenAI's rule of thumb for traffic above one million input tokens per minute is to "increase it by no more than 50% every 15 minutes" (OpenAI, Rate limits). Pacing a job over twelve hours instead of one costs the same in total.

Smaller or cheaper requests help both. Google's advice for its spend-based rate limit is to "reduce the rate of expensive requests, for example by using smaller context windows or shorter outputs" (Google AI Studio docs, Rate limits). Fewer tokens per request lowers both the per-minute token count and the bill.

Higher limits come from different places. Rate limits usually rise with usage tier: OpenAI says "your organization's usage tier upgrades automatically as its total credit purchases reach each threshold" and "higher tiers generally provide higher rate limits across models" (OpenAI, Rate limits); Anthropic says organizations "can move to a higher tier over time as they use the API" (Anthropic, Rate limits). A self-set spending limit, by contrast, is raised by whoever controls the account settings, and a provider-assigned monthly cap is raised by requesting a higher limit or tier. Neither is fixed by changing code.

Not every refusal is a limit at all. OpenAI notes that "model access and rate limits are separate. Meeting a usage-tier threshold doesn't grant access to every model," and that a model_not_found error has its own troubleshooting path (OpenAI, Rate limits). Anthropic's 403 permission_error means "your API key does not have permission to use the specified resource" (Anthropic, API errors). Neither recovers with time or money alone.

9. Choosing the response: a decision procedure

An editorial suggestion for any client calling a metered API:

  1. Read the body. Parse the error type and code. If the API documents codes for spend, quota, credit or billing, check those first.
  2. Spend, quota, credit or billing code? Stop the job. Do not retry. Record which limit was reached, when, and how much work remains. Notify the account owner. This applies to both 429 and non-429 statuses (Anthropic's 400 for self-set limits, its 402 for billing).
  3. Daily-window code or headers indicating a reset hours away? Stop for now and schedule a resume after the documented reset time, in the documented time zone. Do not run a short-cap backoff loop until then.
  4. Growth limit (ramp_limit_exceeded, slow_down)? Wait at least any Retry-After, then lower your sending rate and ramp up gradually, as both providers advise.
  5. Plain rate limit? Wait at least Retry-After if present, otherwise back off exponentially with jitter. Cap attempts and total time.
  6. Unknown 429 with no code and no header? Retry a small number of times with backoff, then stop and report. Anthropic's advice to "limit your retries after a 429" is the safe default (Anthropic, API errors).
  7. Check that your SDK does not override this. Anthropic's SDK retries 429 by default, and Anthropic notes that against a spend cap, "the SDK's automatic retries" also fail (Anthropic, Rate limits). OpenAI's documentation example disables SDK retries and refuses to retry insufficient_quota and billing_hard_limit_reached (OpenAI, Rate limits). Make sure your stop rules run before the SDK's retry rules, or that SDK retries are off.

10. Worked example: an overnight summary job (hypothetical)

This example is hypothetical. The job, timings and counts are invented; the provider behaviors are the documented ones above.

An overnight job drafts 300 article summaries through a language-model API. At item 212, it starts receiving 429s.

Version A: status-only handling. The job sees 429, waits 10 seconds, and tries again, forever. The error body, which it never reads, says the organization has reached its monthly spend cap. There is no retry-after header. Every attempt fails until morning, when someone notices that the job is "still running" and has produced nothing for eight hours. Because the job never recorded which limit was hit, the person has to dig through raw logs to find out.

Version B: code-aware handling. The job reads the error code at item 212. It is a spend-cap code, so the job stops immediately, writes "stopped: monthly spend cap reached at item 212 of 300; 88 remaining; no retry-after," and notifies the account owner. The owner can decide whether to raise the limit (if the tier allows), wait for the next month, or move the remaining work elsewhere.

A third case. On a different night, the job hits a 429 at item 150 whose code indicates a temporary rate limit, with retry-after: 20. The job waits 20 seconds plus a little jitter and continues. Later, it hits a growth-limit code after a burst of parallel requests; it pauses, cuts its concurrency in half, and ramps back up.

The job in version B needs perhaps a dozen more lines of code than version A. Those lines encode the difference between "slow down" and "stop."

11. Designing your own limits

If you run an API or an internal service with an AI cost behind it, the same distinction applies from the other side.

  • Separate the signals. Return distinct, documented error codes for rate, growth, daily and spending limits, even if they share a status. RFC 6585 says the response "SHOULD include details explaining the condition" (RFC 6585 §4).
  • Send Retry-After only when waiting will help. Anthropic's design, where the spend-cap 429 "never" carries it, is a clear model (Anthropic, Rate limits).
  • Publish windows and reset times, including time zones.
  • Consider per-user caps. OpenAI advises those building on its API: "To protect against automated and high-volume misuse, set a usage limit for individual users within a specified time frame (daily, weekly, or monthly). Consider implementing a hard cap or a manual review process for users who exceed the limit" (OpenAI, Rate limits).
  • Use workspace or project limits to contain blast radius. Anthropic lets organizations "set custom spend and rate limits for each workspace," with the example of limiting one workspace to 30,000 of an organization's 40,000 input tokens per minute so it cannot crowd out the others; "organization-wide limits always apply, even if workspace limits add up to more" (same source). OpenAI's project hard limits do the same for spend: "Other projects can continue unless their own limit or the organization limit is also reached" (OpenAI, Error codes).

12. Common mistakes

  1. Treating every 429 as retryable. The single most expensive mistake, covered above.
  2. Watching only 429. Anthropic's self-set spend limit is a 400; GitHub's rate limits can be 403.
  3. Defaulting a missing Retry-After to a short delay. Absence is not permission.
  4. Assuming a budget stops spending. Alerts-only budgets do not (Google Cloud).
  5. Assuming caps are exact. OpenAI says spend "can slightly exceed the configured amount" (OpenAI, Spend limits).
  6. Ignoring the reset time zone for daily limits.
  7. Letting the SDK retry what your code would stop. Check defaults.
  8. Quoting old tier numbers. Tier names and dollar amounts change; the numbers in this article are dated 26 November 2026 and should be rechecked before reuse.
  9. Matching error messages as strings where the provider documents codes. Anthropic says explicitly that you "shouldn't match" the message in code (Anthropic, API errors).

13. What the evidence does and does not show

It shows that, as of 26 November 2026, at least two major AI API providers use HTTP 429 for both temporary rate limits and monthly spending caps, document distinct error codes to separate them, and state that retrying spend or billing errors does not help. It shows that daily limits on at least two Google services reset at midnight Pacific time, and that some cloud "budgets" only send alerts.

It does not show how any particular account is configured: tier, caps and limits are per organization and change with usage history, and providers say their listed limits are maximums, not guarantees. Anthropic: "All limits described here represent maximum allowed usage, not guaranteed minimums" (Anthropic, Rate limits); Google: "Specified rate limits are not guaranteed and actual capacity may vary" (Google AI Studio docs). Consumer chat apps signal limits differently from APIs and are not covered here.

Checklist

  1. Parse the error code and body on every 429, and on 400, 402 and 403 too.
  2. Keep a table of your providers' spend, quota, credit and billing codes; treat them as stop conditions.
  3. Treat daily-window refusals as "resume after reset," with the right time zone.
  4. Honor Retry-After when present; never invent one.
  5. Make sure SDK retries cannot override your stop rules.
  6. Watch remaining-quota headers and slow down before zero.
  7. Confirm whether each budget enforces or only alerts.
  8. Record which limit stopped a run, when, and what is left.

Related reading on Apiary

  • biggie-rate-limiting
  • biggie-when-free-ai-hits-a-rate-limit-what-to-do-without-paying
  • biggie-retry-strategies
  • what-goes-wrong-with-uncontrolled-retries

Sources

Last checked: 2026-11-26.

  1. Nottingham, M., Fielding, R. "RFC 6585: Additional HTTP Status Codes." IETF, April 2012. https://www.rfc-editor.org/rfc/rfc6585 - definition of 429, optional Retry-After, counting left to the server.
  2. Fielding, R., Nottingham, M., Reschke, J. (eds.). "RFC 9110: HTTP Semantics." IETF, June 2022. https://www.rfc-editor.org/rfc/rfc9110 - Retry-After forms (§10.2.3).
  3. Anthropic. "Rate limits," Claude Platform documentation. https://platform.claude.com/docs/en/api/rate-limits - spend vs rate limits, token bucket, tier spend caps, spend-cap 429 without retry-after, self-set limit 400, ramp limits, headers, workspace limits.
  4. Anthropic. "Claude API errors," Claude Platform documentation. https://platform.claude.com/docs/en/api/errors - error codes, enforced_spend_limit_reached, 402 billing_error, advice not to match messages.
  5. OpenAI. "Rate limits," API documentation. https://developers.openai.com/api/docs/guides/rate-limits - RPM/RPD/TPM/TPD, usage tiers and monthly limits, headers, Retry-After scope, slow_down, per-user caps.
  6. OpenAI. "Spend limits," API documentation. https://developers.openai.com/api/docs/guides/spend-limits - hard limit codes, reset behavior, non-instant enforcement, spend alerts.
  7. OpenAI. "Error codes," API documentation. https://developers.openai.com/api/docs/guides/error-codes - credit_balance_exhausted, organization_usage_limit_exceeded, retrying billing errors.
  8. Google. "Rate limits," Gemini API documentation (Google AI Studio). https://aistudio.google.com/docs/rate-limits - RPM/TPM/RPD, midnight Pacific reset, spend-based rate limits on a rolling 10-minute window.
  9. Google. "Geocoding API usage and billing," Google Maps Platform. https://developers.google.com/maps/documentation/geocoding/usage-and-billing - 25 QPS default, 3,000 QPM, daily quotas refreshed at midnight Pacific, daily quotas as cost control.
  10. Google Cloud. "Create, edit, or delete budgets and budget alerts." https://cloud.google.com/billing/docs/how-to/budgets - alerts-only budgets do not cap spending; spend cap budgets.
  11. Amazon Web Services. "Managing your costs with AWS Budgets." AWS Cost Management User Guide. https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html - budget actions such as applying a deny policy.
  12. GitHub. "Rate limits for the REST API." GitHub Docs. https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api - hourly primary limits, secondary limits, 403 or 429, x-ratelimit-reset, ban warning.
  13. Polli, R., Martinez, A., Miller, D. "RateLimit header fields for HTTP." IETF Internet-Draft draft-ietf-httpapi-ratelimit-headers-12, 20 November 2026 (work in progress). https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-ratelimit-headers - proposed daily policy example.
Frequently asked
What is Rate Limits vs. Spending and Daily Limits: Same Error Code, Different Fixes about?
Three kinds of limits stop API requests, and they need three different responses.
What should you know about 1. What HTTP 429 actually promises?
The 429 status comes from RFC 6585 (April 2012): "The 429 status code indicates that the user has sent too many requests in a given amount of time ('rate limiting')." The response "SHOULD include details explaining the condition, and MAY include a Retry-After header indicating how long to wait before making a new…
What should you know about 2. Rate limits: how they are measured?
Rate limits come in many units. As documented on 26 November 2026:
What should you know about growth limits: a newer kind of rate limit?
Both large AI providers now also limit how fast traffic may grow , separately from the steady rate. Anthropic: "A ramp limit caps how fast your organization's token usage on a model can grow. After a sharp increase in usage, requests can return a 429 error even while you're under your ITPM and OTPM rate limits." Its…
What should you know about rate limits that count money?
Google's Gemini API adds a hybrid. Besides RPM and TPM, it "enforces spend-based rate limits to protect against unexpected charges," evaluated "on a rolling 10-minute window." As of 26 November 2026, the documented values are "$10" per 10 minutes for Tier 1 and "$200" for Tiers 2 and 3, and the error is " 429…
References & sources
  1. Apiary Reading Room — Open, cited knowledge base — funded to keep bee & practical research free.
From the Apiary Reading Room. Opinion & editorial — not financial advice. We don't overclaim.
More from the Reading Room