Skip to content

Routing and reliabilityGuide

Gemini API 429 RESOURCE_EXHAUSTED: which limit, and what to do

A 429 RESOURCE_EXHAUSTED from the Gemini API means your project ran out of one specific limit, not that Google is down. This guide shows how to tell the limits apart, when backoff helps, and when you need another connection or another model.

By INFRO Editorial

Published

11 min read

Luminous routing paths connecting one application node to many AI model endpoints

In short

A Gemini 429 RESOURCE_EXHAUSTED means your project exceeded one of its limits for that model: requests per minute, input tokens per minute, requests per day, or a spend window. Back off for the per-minute kind; for a spent daily limit, retrying cannot help, so wait for the reset, raise the tier, or send the request to another project, Vertex AI or another model. 2

Key takeaways

  • Gemini rate limits are measured as requests per minute, input tokens per minute and requests per day, per model, and they apply per project, not per API key.
  • Exceeding any one limit returns the 429, even if the other two have headroom; there is also a rolling 10-minute spend limit on paid tiers.
  • Retry per-minute 429s with exponential backoff and jitter; do not retry a spent daily limit, because it resets at midnight Pacific time.
  • Adding keys inside one Google project does not raise any limit, because the limit belongs to the project.
  • A 429 is about your quota and a 503 is about service capacity, so the first is fixed by quota changes or another project, and the second by retrying or moving to another model.

What a 429 RESOURCE_EXHAUSTED tells you

The Gemini API returns 429 RESOURCE_EXHAUSTED when your project has used up a limit. It is a statement about your quota, not about Google's capacity. Google's own retry guidance names 429 RESOURCE_EXHAUSTED and 503 UNAVAILABLE together as errors that call for exponential backoff,1 but the two have different causes and, as later sections show, different fixes.

Three facts decide almost everything that follows:

  • Limits are measured per project, not per API key.2
  • Limits differ per model, and per usage tier of the project.2
  • Exceeding any single limit triggers the error, even if the others have room.2

So the first question is never "should I retry?". It is "which limit, on which model, in which project?" The rest of this guide answers that, then covers what to do, and only at the end how a gateway can carry the failover decision so that application code does not have to.

The three limits, and the ones around them

Google measures rate limits across three dimensions: requests per minute (RPM), input tokens per minute (TPM) and requests per day (RPD).2 The docs give the arithmetic plainly: with an RPM limit of 20, the 21st request inside a minute fails, even if your token and daily limits are untouched.2

LimitWindowWhat exhausts itResets
RPMOne minuteMany small requests, a retry storm, parallel workersRolling, within about a minute
TPM (input)One minuteA few very large prompts, long context, big documentsRolling, within about a minute
RPDOne daySteady volume over the day, or a batch job that ran earlyMidnight Pacific time2
Spend limitRolling 10 minutesExpensive requests in a burstRolling2
The limits that return a 429 on the Gemini API, as described in Google's rate-limit page.

There are limits beyond the three. Image models have images per minute, some models have a tokens-per-day limit, and built-in tools carry their own: Grounding with Google Search on Gemini 3 and newer has a default of 1,500 requests per day per project on the Gemini Developer API.2 Preview and experimental models have more restricted limits,2 which is why a call that works on a stable model can 429 on a preview one at the same traffic. Priority inference holds its own limits, by default 0.3x the standard limit for each model and tier.2

The spend-based limit surprises people. On paid tiers it is evaluated over a rolling 10-minute window: $10 on Tier 1 and $200 on Tier 2 and Tier 3, with no such limit on the free tier. Whether it applies to a given account depends on billing history and standing.2 When you hit it, the API still returns 429 RESOURCE_EXHAUSTED. A burst of long-context requests can trip it while your RPM and TPM look fine.

Google also says the specified limits are not guaranteed and actual capacity may vary.2 Treat the numbers as a budget, not a promise.

How to tell which limit you hit

The error status alone does not say. The docs separate the cases in the Interactions API error reference: one 429 code for exceeding a per-minute or per-second request or token limit, one for exceeding the daily quota, and one for too many requests in a short period.3 If the API gives you that code or a quota name in the message, log it. Do not write logic that depends on message wording, though; it can change. Instead, diagnose from your own data.

  1. Open the AI Studio rate-limit page for the project. Google points to it for your active limits per model and tier, with usage over the last 28 days.2 Read the limit for the exact model in the failing call.
  2. Count requests in the last minute for that model and project. If the count is at or near the RPM limit, it is RPM. Include every service and developer laptop that shares the project.
  3. Sum input tokens for the same minute. If requests are well under RPM but a few carry large prompts, it is TPM.
  4. Check the day. If the 429s began at some point in the day and never cleared until after midnight Pacific, it is RPD.
  5. Check the 10-minute spend. If requests and tokens are in bounds but cost per request is high, compare against the spend limit for your tier.

The pattern over time is the fastest tell. Per-minute limits clear in under a minute. A daily limit stays until the reset. A spend limit clears as the 10-minute window rolls forward.

Usage tiers and how a project moves up

Rate limits are tied to the project's usage tier, and the project is upgraded automatically as usage and spend grow.2 The tiers and their qualifications, as the docs list them:

TierQualificationBilling tier cap
FreeAn active project or free trial; some projects need verificationN/A
Tier 1Set up and link an active billing account$250
Tier 2Paid $100 plus 3 days from first successful payment$2,000
Tier 3Paid $1,000 plus 30 days from first successful payment$20,000 to $100,000+
Gemini API usage tiers and what qualifies a project, per Google's rate-limit page.

Tiers 2 and 3 are based on total cumulative spending on Google Cloud services, not just the Gemini API, for the billing account linked to the project.2 A move from Free to Tier 1 typically takes effect instantly; later upgrades take effect within 10 minutes.2 Meeting the criteria is generally sufficient, though Google notes an upgrade can in rare cases be denied after review.2

Two practical consequences. First, the quickest fix for a free-tier 429 is to link billing, which moves the project to Tier 1. Second, a project that hits its paid-tier limits can ask for more through Google's rate limit increase form, with no guarantee: Google says it will do its best to review the request.2 That is a slow path at best, so it is a capacity plan, not an incident response.

When backoff works, and when retrying is wasted

Backoff works for limits that clear on their own within seconds: RPM, TPM and the rolling spend window. Google recommends exponential backoff starting around 1 second (then 2, 4, 8), random jitter so clients do not retry in lockstep, a maximum number of attempts, and retrying only transient errors such as 429, 408 and 5xx.1 The official SDKs already do this: the Python SDK retries transient errors up to four times with an initial delay of about 1 second and a maximum of 60 seconds.1 If you use an SDK, check before adding your own loop on top, or you will multiply attempts and keep the project pinned at its limit.

Backoff does not work when the daily limit is spent. Google's error reference gives different actions for the two: wait and retry with exponential backoff for the per-minute code, but wait until the quota resets or request an increase for the daily one.3 RPD resets at midnight Pacific time.2 Retrying a spent daily limit only burns client time and keeps the failure visible to users for hours.

gemini_retry.py
import random, time

class DailyQuotaSpent(Exception):
    pass

def call_with_backoff(send, max_attempts=4, base=1.0, cap=60.0):
    """send() returns (status, body). Retry only what can clear soon."""
    for attempt in range(max_attempts):
        status, body = send()
        if status < 400:
            return body
        if status == 429 and daily_quota_spent(body):
            # Do not wait for midnight Pacific inside a request path.
            raise DailyQuotaSpent(body)
        if status not in (408, 429, 500, 502, 503, 504):
            raise RuntimeError(f"not retryable: {status}")
        delay = min(cap, base * 2 ** attempt)
        time.sleep(random.uniform(0, delay))  # full jitter
    raise RuntimeError("retries exhausted")

daily_quota_spent is yours to write. The reliable version compares your own per-model, per-project request count for the current Pacific-time day against the limit shown in AI Studio, rather than parsing message text. Raise DailyQuotaSpent to a layer that can pick another target, or queue the work for after the reset.

Do not retry 400, 402 or 403: they point to bad syntax, a payment problem or a restricted project or key, and Google says not to retry them.1

Spreading across keys does not raise a project limit

The common first response to a 429 is to create more API keys and rotate through them. Inside one Google project it does nothing. Rate limits are applied per project, not per API key,2 so ten keys in one project share one RPM, one TPM and one RPD. The same logic applies to the free-tier eligibility check, which Google evaluates at the project level: a new key in the same project does not resolve a restriction.1

What does add headroom:

  • A key in a different project that has its own tier and its own per-model limits. Each project needs billing linked to reach a paid tier.
  • A higher tier for the project you already have.
  • A different model whose limits have room, since limits are per model.2
  • A different route to the same model family, such as Gemini on Vertex AI, which is a separate quota system. See Vertex AI 429 resource exhausted: two causes, two fixes for how those limits behave.

Whether more projects are acceptable is a policy and terms question for your organization, not just a technical one. Splitting traffic purely to dodge limits can also complicate attribution and billing. Check your agreement before building that. For the general version of this mistake across providers, see Load balancing LLM API keys: what adds capacity and what doesn't.

429 RESOURCE_EXHAUSTED vs 503 UNAVAILABLE

Both are on Google's backoff list,1 but they mean different things.

Question429 RESOURCE_EXHAUSTED503 UNAVAILABLE
Whose limitYour project's, for that modelThe service is temporarily overloaded or down3
CauseOver RPM, TPM, RPD or spendCapacity or an outage on Google's side
Another key, same projectSame resultMay or may not recover
Another projectOften succeedsOften the same failure
Another modelOften succeedsDepends on whether the model is the affected one
RetryYes for per-minute; not for spent dailyYes, with backoff
How the two errors differ and what each calls for.

The practical split: with a 429, the failing resource is your allocation, so capacity elsewhere in your accounts is useful. With a 503, the failing resource is Google's serving capacity for that model or region, so a second key or project on the same model often hits the same problem. A 503 is the case for a different model or a different serving path; a 429 is the case for more quota. Log both separately, and do not let a circuit breaker treat a 429 as an unhealthy provider. A rate limit on one model says nothing about whether your next request to another model will work. Circuit breakers for LLM providers: throttling is not failure covers that distinction.

When the answer is a second connection or another model

Sort the 429 by what clears it:

  1. Per-minute limits, short bursts. Backoff, plus smoothing on your side. Queue and pace requests to stay under RPM and TPM.
  2. Per-minute limits, sustained. Backoff will not close a structural gap. You need a higher tier, a second project, or a second path. Raise the tier first, because it needs no architecture work.
  3. Spent daily limit. Move the remaining traffic to a target that has room: a different project, Gemini on Vertex AI, or another model. Queue anything that can wait until the reset.
  4. Spend window. Reduce per-request cost (smaller context, shorter outputs), or move large requests to a target with a higher ceiling.

When you fail over to another model, the change is not neutral. Prices differ, caches are cold, and outputs differ. Is your fallback model good enough? Test fallback equivalence and What does failover do to your bill? cover what to check before the failover is needed. Decide which requests deserve a fallback and which should wait; Provider quota is short: which AI requests should survive? is the triage for that.

Doing the failover through one route

You can write all of this in application code, but then every service repeats the classification of 429s, the secondary targets and the daily-limit check. A gateway can hold it in configuration instead. With INFRO, which sits in front of provider accounts you already hold, the pieces map like this:

  • Connection failover. With a model named directly, INFRO tries your enabled, healthy connections that serve that vendor. Keys that just answered 429 are tried last, and a provider 429 does not count against the connection's health. Every upstream failure before the first token, 429 included, moves to the next connection, and your client sees only a slightly higher time to first token.4 With one connection there is nothing to fail over to.4
  • Model fallbacks. A fallbacks array of up to five catalog model IDs is tried in order once every connection for the primary model has failed before the first token.4
  • Routes. A named route your application sends as model resolves to ordered or weighted targets over your own connections, and a priority route walks targets in order, using the first that answers.5 Routes can also carry if-rules and failure rules, which decide per failure kind whether to retry, move on or stop, so a spent daily limit can go straight to the next target instead of waiting.
  • Visibility. When your own provider returns the 429, INFRO's error uses the code provider_rate_limited,6 so you can tell a provider limit from INFRO's own refusals in your logs.

Failover only helps if a second target exists with its own headroom. Two keys in the same Google project count as one for Gemini's limits, even though INFRO spreads requests across a provider's keys:4 give the route a second target that sits in a different project, a different serving path or a different model. INFRO's gateway keys also take limits you control: an hourly spending limit per key bounds a burst from one caller, and key limits restrict which providers a key may use. Those protect the shared Gemini project from one noisy service eating the whole RPM.

A checklist for the next 429

  • Note the model, project and time of the failing call.
  • Read the project's limits for that model in AI Studio.
  • Classify: RPM, TPM, RPD or spend window.
  • Per-minute: back off with jitter and a retry cap; confirm no second retry loop sits above the SDK's own.
  • Daily: stop retrying, queue what can wait, move the rest to another target.
  • Check whether billing is linked and the tier is what you expect.
  • Confirm any "extra" keys are in different projects.
  • Keep 429 and 503 in separate metrics, and do not trip a breaker on 429.

Questions readers ask

Is Gemini API quota exceeded the same as 429 RESOURCE_EXHAUSTED?
Usually yes. Google's error reference lists three 429 codes: one for per-minute or per-second request or token limits, one for an exceeded daily quota, and one for too many requests in a short period. 3 The first and third resolve with backoff; the daily one resolves at the reset or with a higher limit.
Does Gemini 429 Too Many Requests mean I should just retry?
Retry only if the limit is a per-minute one. Google's guidance is exponential backoff with jitter and a maximum number of attempts. 1 If the daily quota is spent, every retry fails until the reset at midnight Pacific time. 2
Will a new API key fix a Gemini RESOURCE_EXHAUSTED error?
Not if the new key is in the same project. Gemini rate limits are applied per project, not per API key. 2 A key in a different project has its own limits, subject to that project's tier.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Automatic failover

    Available with a plan

    A route that times out or 5xxs before the response starts is retried elsewhere without your client seeing it.

    Read the documentation for Automatic failover
  • Health-aware routing

    Available with a plan

    Named routes use priority or weighted targets over your own connections, with health checks, retries and failover.

    Read the documentation for Health-aware routing
  • Key limits and rotation

    Available with a plan

    Limit a gateway key to chosen providers or IP ranges, and rotate it with an overlap window so the old key keeps working while you deploy the new one.

    Read the documentation for Key limits and rotation
  • Hourly key limits

    Available with a plan

    A spending limit per gateway key that resets every hour, to bound a burst.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Troubleshooting guide - Gemini API (opens in a new tab) — Google AI for Developers. Accessed Nov 26, 2026.
  2. 2.Rate limits - Gemini API (opens in a new tab) — Google AI for Developers. Accessed Nov 26, 2026.
  3. 3.API errors - Gemini API (opens in a new tab) — Google AI for Developers. Accessed Nov 26, 2026.
  4. 4.Failover & fallbacks (opens in a new tab) — INFRO. Accessed Nov 26, 2026.
  5. 5.Routes (opens in a new tab) — INFRO. Accessed Nov 26, 2026.
  6. 6.Errors - API reference (opens in a new tab) — INFRO. Accessed Nov 26, 2026.

About this article

Read Google's Gemini API rate limits, troubleshooting and API errors pages on 2026-11-26, plus INFRO's failover, routes and errors docs. The Vertex AI quotas page returned only navigation text, so no Vertex quota numbers are stated; per-model limit values are left to the AI Studio rate-limit page, which the docs say is the source of truth.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.