Gemini API 429 RESOURCE_EXHAUSTED: what it means and the fix
The quota error Google’s own docs hold five of the top nine results for. What the limits are, the backoff its SDK already does, and the fix when the quota itself is the problem: the same Gemini ids on a key with limits you set.
What the client prints
HTTP 429{ "error": { "code": 429, "message": "Resource has been exhausted (e.g. check quota).", "status": "RESOURCE_EXHAUSTED" }}What it means
Google's rate limits page (read 2026-10-31) measures limits in requests per minute (RPM), input tokens per minute (TPM) and requests per day (RPD), per project, and says exceeding any of them triggers a rate limit error. A spend-based limit returns the same 429 RESOURCE_EXHAUSTED.
The free tier is an active project or free trial with no spend-based limits; a paid tier needs billing set up in AI Studio (same page). So on a free key the error is the project's per-minute or per-day quota, and the per-day one does not clear with a retry.
The message, "Resource has been exhausted (e.g. check quota)", is the same whichever dimension tripped; the response does not say which.
The retry rule
Google's troubleshooting guide (read 2026-10-31) recommends exponential backoff for a 429: a short wait before the first retry, longer between later ones, with random jitter, a maximum number of attempts, and retries only on transient errors (429, 408, 5xx). Its Python SDK retries up to four times by default, from about 1 second up to 60.
For a spend-based limit the rate limits page adds: wait and retry, send fewer expensive requests (smaller context, shorter output), and request an increase if it happens in normal use.
Backoff solves a burst. It does not solve a daily cap, and it does not solve a quota sized for a smaller project than yours.
A key that fails over, with limits you set
A retry loop treats the symptom. On this key the next route is tried before the error reaches you, every limit is per key, and a failed request costs nothing. From the OpenAPI document, read 2026-10-31.
- Failover before you see it
- A route that fails with a 5xx or a 429 is retried on the next route for the same model. x-uplink-attempts on the answer counts the tries; the price is the model’s own either way.
- Your own fallback list
- models: [...] names up to 5 models tried in order once every route of the one before has failed before a byte was sent. Each bills at its own price when it answers.
- Failed requests are not charged
- A 429, 502 or 503 from this API charges nothing and carries retry-after: back off that long before trying again.
- Limits per key, set by you
- rpm from 1 to 100,000, tpm from 1 to 50,000,000 and concurrency from 1 to 10,000 on each key. Default: 600 requests a minute per key, 50 in flight per account.
- A budget per key
- budget_usd plus a daily, weekly or monthly spend limit. The key stops at its own line with a 402; the rest of the balance is untouched.
- One request id
- x-uplink-request-id on every answer, errors included. Quote it and we find the call.
Gemini route, right now
From GET https://api.relayswitch.io/v1/status, the public feed behind /status, generated 2026-11-02T06:27:21.000Z.
| Service | State | Last check | Latency | Checks today | Failures today |
|---|---|---|---|---|---|
| Gemini | Operational | Nov 2, 2026, 6:07 AM UTC | — | 7 | 0 |
Every hour the gateway counts the past hour’s real requests to this route: answered or failed. A request answered after a retry counts as answered.
The daily real-model check: 305 of 339 models answered as before, generated 2026-11-02T06:27:21.289Z. Every verdict is on /proof.
The ids this page is about, per million tokens
The Gemini ids on this key, with Google’s list price beside ours where the catalog has it. They take the OpenAI chat format here.
| Model | Input | Output | Developer list in / out |
|---|---|---|---|
| Gemini 4 Argongemini-4-argon | $0.60 | $3.00 | $2.00 / $10.00 |
| Gemini 3.1 Pro Previewgemini-3.1-pro-preview | $1.20 | $7.20 | $2.00 / $12.00 |
| Gemini 3.8 Flashgemini-3.8-flash | $0.4925 | $2.25 | $0.75 / $3.75 |
Read from the catalog at render. A request that fails over bills at the price of the model that answered.
OpenAI SDK: Gemini on this key, with a fallback
from openai import OpenAIimport os client = OpenAI( base_url="https://api.relayswitch.io/v1", api_key=os.environ["RELAYSWITCH_API_KEY"],) reply = client.chat.completions.create( model="gemini-4-argon", messages=[{"role": "user", "content": "Extract the dates from this text."}], extra_body={"models": ["gemini-3.8-flash"]}, # answers if every gemini-4-argon route fails)print(reply.model)The Gemini ids answer the OpenAI chat format on this key, so any OpenAI-compatible client works with a base_url and the key. models names the fallback tried if every route of the first id fails; the answer names which one replied.
Limits are fields on the key: rpm from 1 to 100,000, tpm from 1 to 50,000,000, concurrency from 1 to 10,000, set at creation and changed any time. The key budgets page has the call.
Questions
From what people ask about this error.
A key that does not stop at one host
Failover at the same price, limits and a budget per key, failed requests not charged. Card or crypto, no KYC, no subscription.