Skip to content

Gemini API errorGemini API 429 RESOURCE_EXHAUSTED: which limit, and the fix

Your app’s Gemini calls fail with HTTP 429 and RESOURCE_EXHAUSTED. Google’s docs list several limits behind that one status. Here’s how to tell which one you hit, in Google’s own words, or hand it over at a fixed price.

Short answer

A 429 from the Gemini API means the project went over one of its limits: requests or input tokens per minute, requests per day, or, for some accounts, a spend-based limit over a rolling 10 minutes. Limits apply per project, not per API key, so another key in the same project doesn’t help. Retry with exponential backoff and jitter, cut expensive requests, check your active limits in AI Studio, and request an increase if normal usage keeps hitting one.

Which limit it is, and the fix

  1. 01

    Over a per-minute limit

    “Your usage is evaluated against each limit, and exceeding any of them will trigger a rate limit error.” Google, Rate limits

    Limits are usually measured in requests per minute, input tokens per minute and requests per day, and going over any one of them triggers the error. Google’s example: with a limit of 20 requests per minute, the 21st request in that minute fails even if you’re under your token limit.

  2. 02

    The daily quota ran out

    “Requests per day (RPD) quotas reset at midnight Pacific time.” Google, Rate limits

    Requests per day reset at midnight Pacific time. For a daily quota error, Google’s fix is to wait until the quota resets or request a quota increase.

  3. 03

    Spreading calls across API keys

    “Rate limits are applied per project, not per API key.” Google, Rate limits

    Limits are counted per project, so spreading calls across several keys in one project doesn’t raise them. Check the project’s active limits in Google AI Studio.

  4. 04

    A spend-based limit over 10 minutes

    “If you hit a spend-based rate limit, the API returns a 429 RESOURCE_EXHAUSTED error.” Google, Rate limits

    Depending on your billing history and usage tier, the Gemini API also limits spend over a rolling 10-minute window, and the cap is higher on higher usage tiers. Google’s fix is to wait and retry, send fewer expensive requests (smaller context windows or shorter outputs), and request a rate limit increase if normal usage keeps hitting it.

  5. 05

    Retrying immediately after a 429

    “Only retry on transient errors (like 429, 408, or 5xx).” Google, Troubleshooting guide

    Retry a 429 with exponential backoff (Google’s example waits 1 second, then 2, 4 and 8) plus random jitter, and set a maximum number of retries. Google’s official SDKs already retry 429 and 5xx errors with backoff by default. Don’t retry 400, 402 or 403 errors, which point to an invalid API key, depleted Prepay credits or bad syntax.

Checked against the vendor’s docs on : Gemini API docs: Rate limits; Gemini API docs: Troubleshooting guide; Gemini API docs: API errors.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: OpenAI 429 insufficient_quota · Anthropic API 529 overloaded_error · Unexpected Gemini API charges

Questions

More on this error

Will a new Gemini API key fix the 429?

Not in the same project. Google applies rate limits per project, not per API key, so a new key shares the same limits.

Why do I hit it more often on a preview model?

Google says rate limits are more restricted for experimental and preview models. Check that model’s limits in AI Studio.

What do you need to fix a Gemini 429?

The code that calls Gemini and a copy of the error response. We add backoff, cut expensive requests where we can, and send it as a pull request you review and deploy.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.