Inference APIs
Reference/Errors/Google Gemini

HTTP 429 RESOURCE_EXHAUSTED (Gemini API)

Gemini's free tier is generous per minute and stingy per day, and the error does not say which one you hit unless you read the details array. This entry shows how to tell, what each fix costs, and the one migration path that is only a base-URL change.

Last verified September 16, 2026 against Gemini rate limits, Gemini pricing, Gemini OpenAI compatibility · 5 min read

ProviderGoogle Gemini API (AI Studio keys)
HTTP status429 Too Many Requests
StatusRESOURCE_EXHAUSTED
MessageYou exceeded your current quota, please check your plan and billing details.
When it happensA per-minute (RPM / TPM) or per-day (RPD) quota for the model is used up on your tier — most often the free tier's daily request quota
Can you wait it out?Per-minute quotas: yes — honour retryDelay. Per-day quotas: no — until the daily reset (midnight Pacific)
Short answer
  • Look at details[].violations[].quotaId. …PerMinute… → back off for retryDelay. …PerDay… → you are done for the day on that model.
  • Enable billing to move to the paid tier (much higher quotas, pay per token).
  • Or run an open model on an OpenAI-compatible endpoint with no daily quota — a real option if you do not need Gemini specifically.

What the error looks like

HTTP 429 · Gemini API
{
  "error": {
    "code": 429,
    "message": "You exceeded your current quota, please check your plan and billing details. ...",
    "status": "RESOURCE_EXHAUSTED",
    "details": [
      { "@type": "type.googleapis.com/google.rpc.QuotaFailure",
        "violations": [ { "quotaMetric": "generativelanguage.googleapis.com/generate_content_free_tier_requests",
                          "quotaId": "GenerateRequestsPerDayPerProjectPerModel-FreeTier" } ] },
      { "@type": "type.googleapis.com/google.rpc.RetryInfo", "retryDelay": "41s" }
    ]
  }
}

The two useful fields are quotaId, which names the window (per minute vs per day) and the tier, and retryDelay, which is only meaningful for per-minute quotas.

Which quota did you hit

Gemini enforces requests per minute (RPM), tokens per minute (TPM) and requests per day (RPD), each per model and per project, with separate values for the free tier and paid tiers. The current numbers change with each model release, so read them from Google's rate-limits page rather than from a blog post — including this one. The structure is stable: free tier is meant for testing and caps daily requests per model at a level a small app can exhaust before lunch.

Daily quotas reset at midnight Pacific time. If quotaId contains PerDay, no amount of retrying will help until then.

Fix 1 — Honour retryDelay (per-minute quotas)

The Google SDKs expose the delay; with raw HTTP, parse details for RetryInfo.retryDelay and sleep that long. Add jitter if you run several workers.

Fix 2 — Enable billing (paid tier)

Attaching a billing account to the project moves keys to Tier 1 with far higher RPM/RPD and per-token pricing. This is the intended path and, unlike some providers, it is self-serve and immediate. The trade-off is simply that usage now costs money.

Fix 3 — Run an open model on an endpoint without daily quotas

Gemini is closed-weight, so it cannot be served by anyone else. But if you were using Gemini Flash for general assistant work, summarisation or extraction, current open models (DeepSeek V4 Flash, GPT-OSS 120B, GLM 5.3 Flash) with 1M-token context are competitive and cost a few tenths of a dollar per million tokens. If you already call Gemini through its OpenAI-compatible endpoint, the switch is two lines:

Python · Gemini via its OpenAI-compatible endpoint, then a base-URL switch
from openai import OpenAI
import os

# If you already call Gemini through its OpenAI-compatible endpoint...
gemini = OpenAI(base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
                api_key=os.environ["GEMINI_API_KEY"])

# ...an open model on another OpenAI-compatible endpoint is a two-line change.
other = OpenAI(base_url="https://api.inferenceapis.com/v1", api_key=os.environ["INFERENCEAPIS_KEY"])
resp = other.chat.completions.create(model="deepseek-ai/DeepSeek-V4-Flash",   # 1M context, ~$0.19/$0.38 per 1M
                                     messages=[{"role": "user", "content": "hello"}])

If you use the native google-genai SDK, the change is larger: you would move to the OpenAI SDK or a framework abstraction (LangChain, LiteLLM) first.

Frequently asked questions

Why do I get 429 on the first request of the day?

Shared projects, retries from a previous run, or multiple keys in the same project all draw from one quota. Check the project's quota page in Google Cloud Console for what consumed it.

Does RESOURCE_EXHAUSTED ever mean the service is overloaded rather than my quota?

Occasionally — capacity-related 429s do occur on new models. Those carry no QuotaFailure in details and clear on retry.

Where Inference APIs fits

Option 3 above is honest about being a different model: Gemini is closed-weight and cannot be served elsewhere. If your workload is fine on an open model, Inference APIs serves several with 1M-token context on the OpenAI request format Gemini also supports, billed per request with no daily quota.

Something changed or wrong? Tell us and we will re-verify the entry.