Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Google Gemini API error

Gemini API 429 RESOURCE_EXHAUSTED: what it means and how to fix it

Error message
429 RESOURCE_EXHAUSTED

Retry? YesLast verified 4 documented fixes3 sources

What it means

generateContent API: you have exceeded one of the API rate limits (RPM, TPM, RPD, spend, and so on). Spend-based limits are evaluated over a rolling 10-minute window per usage tier and also return this error.

Causes

  • Sending too many requests
  • Using too many tokens
  • Exceeding spend-based limits for your billing history and tier

How to fix it

  1. Fix 1.

    Verify that you are within the model's rate limits (viewable in Google AI Studio).

  2. Fix 2.

    Wait and retry after a short period, using exponential backoff with jitter.

  3. Fix 3.

    Reduce the rate or size of your requests, for example smaller context windows or shorter outputs.

  4. Fix 4.

    Request a rate limit increase if needed.

Seen in coding agents

These coding agent messages pass this Gemini API error through. Each page has the agent-specific fix.

More Gemini API errors

All 30 Gemini API errors

HTTP 429 at other providers

Compare 429 across providers

FAQ

What does the Gemini API error "429 RESOURCE_EXHAUSTED" mean?

generateContent API: you have exceeded one of the API rate limits (RPM, TPM, RPD, spend, and so on). Spend-based limits are evaluated over a rolling 10-minute window per usage tier and also return this error.

How do I fix Gemini API "429 RESOURCE_EXHAUSTED"?

There are 4 documented fixes. Start with the first: Verify that you are within the model's rate limits (viewable in Google AI Studio).

Should I retry Gemini API "429 RESOURCE_EXHAUSTED"?

Yes. The official docs treat this error as retryable.

Which other AI APIs return HTTP 429?

Per their official error docs: Amazon Bedrock (429 ThrottlingException; 429 ModelNotReadyException), Anthropic API (429 rate_limit_error; 429 rate_limit_error (enforced_spend_limit_reached)), Azure OpenAI (429 Too Many Requests (Rate limit is exceeded); 429 Too Many Requests (System is experiencing high demand); 429 Too Many Requests (temporary rate limit adjustment); 429 Too Many Requests (token budget exceeded by request parameters)), Cohere API (429 Too Many Requests), DeepSeek API (429 - Rate Limit Reached), Groq API (429 Too Many Requests), Mistral API (429 Too many requests), OpenAI API (429 credit_balance_exhausted; 429 Rate limit reached for requests; 429 rate_limit_error slow_down; 429 organization_spend_limit_exceeded; 429 project_spend_limit_exceeded; 429 organization_usage_limit_exceeded), OpenRouter (429 rate_limit_exceeded), Vertex AI (429 RESOURCE_EXHAUSTED; 429 Resource exhausted, please try again later; 429 Too many requests. Exceeded the Provisioned Throughput), xAI API (429 Too Many Requests).

Sources

Last verified against 3 sources: Gemini API's official docs and official SDK repositories.

Newsletter

Know when the APIs change

One email per week. New model releases, API changes, what broke, and how developers are working around it.