---
title: "Gemini API 429 RESOURCE_EXHAUSTED: meaning and fix"
canonical: https://relayswitch.io/fix/gemini-api-429-resource-exhausted
generated: 2026-11-02T10:52:05.673Z
source: https://api.relayswitch.io/v1/catalog
base_url: https://api.relayswitch.io/v1
---

Fix

# 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.

[Get a key](https://app.relayswitch.io/console)[The switch](#switch)

The error

## What the client prints

json

1`HTTP 429`

2`{`

3 `"error": {`

4 `"code": 429,`

5 `"message": "Resource has been exhausted (e.g. check quota).",`

6 `"status": "RESOURCE_EXHAUSTED"`

7 `}`

8`}`

## What it means

Google's [rate limits page](https://ai.google.dev/gemini-api/docs/rate-limits) (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](https://ai.google.dev/gemini-api/docs/troubleshooting) (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.

The structural fix

## 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.

Live

## Gemini route, right now

From `GET https://api.relayswitch.io/v1/status`, the public feed behind [/status](https://relayswitch.io/status), generated 2026-11-02T10:05:36.547Z.

| Service | State | Last check | Latency | Checks today | Failures today |
| --- | --- | --- | --- | --- | --- |
| Gemini | Operational | Nov 2, 2026, 9:07 AM UTC | — | 10 | 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-02T10:05:36.308Z. Every verdict is on [/proof](https://relayswitch.io/proof).

Live prices

## 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 Argon](https://relayswitch.io/models/gemini-4-argon)gemini-4-argon | $0.60 | $3.00 | $2.00 / $10.00 |
| [Gemini 3.1 Pro Preview](https://relayswitch.io/models/gemini-3.1-pro-preview)gemini-3.1-pro-preview | $1.20 | $7.20 | $2.00 / $12.00 |
| [Gemini 3.8 Flash](https://relayswitch.io/models/gemini-3.8-flash)gemini-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.

The switch

## OpenAI SDK: Gemini on this key, with a fallback

python

1`from openai import OpenAI`

2`import os`

3

4`client = OpenAI(`

5 `base_url="https://api.relayswitch.io/v1",`

6 `api_key=os.environ["RELAYSWITCH_API_KEY"],`

7`)`

8

9`reply = client.chat.completions.create(`

10 `model="gemini-4-argon",`

11 `messages=[{"role": "user", "content": "Extract the dates from this text."}],`

12 `extra_body={"models": ["gemini-3.8-flash"]}, # answers if every gemini-4-argon route fails`

13`)`

14`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](https://relayswitch.io/features/key-budgets) has the call.

Related

-   [Gemini API pricing hub](https://relayswitch.io/pricing/gemini)
-   [Gemini 3 API](https://relayswitch.io/gemini-3-api)
-   [Key budgets and limits](https://relayswitch.io/features/key-budgets)
-   [Routing and fallbacks](https://relayswitch.io/features/routing)
-   [Live status](https://relayswitch.io/status)
-   [Docs](https://relayswitch.io/docs)

Other errors

-   [Claude Code: API Error: Rate limit reached](https://relayswitch.io/fix/claude-code-rate-limit-reached)
-   [OpenRouter 429: Provider returned error](https://relayswitch.io/fix/openrouter-429-provider-returned-error)
-   [Anthropic 529 overloaded\_error](https://relayswitch.io/fix/anthropic-529-overloaded)
-   [OpenRouter: No endpoints found](https://relayswitch.io/fix/openrouter-no-endpoints-found)
-   [All fix guides](https://relayswitch.io/fix)

FAQs

## Questions

From what people ask about this error.

Open the console

A key in under a minute

[Get a key](https://app.relayswitch.io/console)

Or email [hello@relayswitch.io](mailto:hello@relayswitch.io)

### 

### 

### 

### 

## 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.

[Live status](https://relayswitch.io/status)[Get a key](https://app.relayswitch.io/console)

