Gemini 429 RESOURCE_EXHAUSTED Errors: Rate Limits, Retries and Cross-Provider Fallback
When calling Google's Gemini API, hitting a rate limit or quota ceiling returns HTTP 429 with status RESOURCE_EXHAUSTED. Because Gemini enforces limits across multiple dimensions at once—requests per minute (RPM), tokens per minute (TPM) and requests per day (RPD)—a burst of traffic or a long context prompt can trigger a 429 even when your overall usage looks low. This guide explains what causes RESOURCE_EXHAUSTED, how to retry safely, and how to fail over to another provider with SentioGate. We build SentioGate, so we note our own stake and limits clearly.
As of 2026-10-26. Gemini tier limits change; check Google's official rate-limit documentation linked in the sources for current numbers.
Why Gemini returns 429 RESOURCE_EXHAUSTED
According to the Gemini API rate limits documentation, limits are applied per Google Cloud project, not per individual API key:
| Dimension | What triggers RESOURCE_EXHAUSTED | What to do |
|---|---|---|
| Requests per minute (RPM) | Short traffic bursts exceeding your tier's per-minute cap | Wait and retry with exponential backoff + jitter (honor Retry-After if present) |
| Tokens per minute (TPM) | Large prompts or high concurrency consuming the minute's token budget | Trim context or route long prompts to another provider |
| Requests per day (RPD) | Hitting the daily ceiling (especially common on the Free tier) | Stop retrying that project today; switch to a paid tier or fail over to another provider |
Creating a second API key inside the same Google Cloud project does not give you a fresh quota, because all keys in a project share the same pool.
Why client-side retries aren't enough
Client-side backoff helps when you clip a brief per-minute limit, provided your retry logic honors Retry-After and avoids tight loops. It does not help when your Google Cloud project hits its daily ceiling or when a user-facing request cannot wait through a multi-second pause. Failing over across projects and across providers with shared cooldown state is where a dedicated gateway is required.
Cross-provider fallback with SentioGate
SentioGate is a hosted, OpenAI-compatible BYOK router. You add your Gemini key alongside keys from OpenAI, Groq, Mistral, DeepSeek or OpenRouter in the encrypted Vault, enable the models you want in your pool, and call model: "auto":
- Shared cooldowns across requests. When Gemini returns 429, SentioGate places that model/key into a cooldown honoring
Retry-Afterso concurrent requests skip straight to a healthy option. - Key failover, then model failover. If you have keys from separate projects, it tries the next key first; with
model: "auto", it then fails over to your next enabled model on another provider. - Zero token markup. Providers bill you directly on your own keys.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.sentiogate.dev/v1",
api_key=os.environ["SENTIOGATE_API_KEY"],
)
resp = client.chat.completions.create(
model="auto", # routes across your enabled Gemini, OpenAI, Groq, etc. models
messages=[{"role": "user", "content": "Summarize these release notes in 3 bullets."}],
)
print(resp.choices[0].message.content)
SentioGate's limits
- Model outputs aren't identical. Test your prompts across every backup model you enable in the Vault.
- Hosted only, with no Anthropic
/v1/messagesendpoint and no MCP gateway today. See our gateway comparison if you need self-hosting. - Community pool is for evaluation only: without BYOK keys, requests use a shared community evaluation tier (150 requests per 5 hours per user during beta).
See also our guides on OpenAI 429 errors, Groq rate limits and OpenRouter free-tier 429s.
Sources
All accessed 2026-10-26.
- Google AI for Developers: Gemini API rate limits, OpenAI compatibility
- SentioGate: docs, pricing