Independent community project. Not affiliated with or endorsed by Google.
ModelCraft modelcraft.dev
← All Fix Guides
critical ✓ Verified: 2026-11-26 gemini-cli 0.71.1 / AGY v2.35.2
quota google agygemini-cligemini-api

429 RESOURCE_EXHAUSTED with limit: 0 or Phantom Exhaustion

429 RESOURCE_EXHAUSTED limit: 0
Matching Symptoms
  • • UI meter shows 95-99% quota remaining, yet requests immediately fail with 429.
  • • API error payload reports `limit: 0` on a paid project or newly upgraded Pro/Ultra account.
  • • Switching between OAuth login and `GEMINI_API_KEY` triggers sudden rate-limit errors.
Root Cause

Entitlement or billing project desync: rate limits apply per GCP project (not per API key), so an unbilled project (`limit: 0`), Tier 1 10-min $10 spend cap, or an accidental `GEMINI_API_KEY` env override causes immediate 429s.

Step-by-Step Fix

  1. 1 Check whether GEMINI_API_KEY or GOOGLE_API_KEY is accidentally exported in your shell and overriding OAuth.
  2. 2 Inspect the 429 JSON RetryInfo and quotaMetric: if limit: 0, your selected GCP project lacks active billing or Free Tier eligibility.
  3. 3 In Antigravity / Gemini CLI, run Reset Onboarding or re-link the active paid Google Cloud billing project (verify Tier 1/2/3 spend cap).
  4. 4 Run npx agycraft-mcp doctor to verify env conflicts without exposing secret values.

Copyable Commands

Check env conflict (boolean only, never prints values) (unix)
node -e '["GEMINI_API_KEY","GOOGLE_API_KEY","GOOGLE_CLOUD_PROJECT"].forEach(k=>console.log(k, Boolean(process.env[k])))'
Temporarily unset API key override to use OAuth plan (unix)
unset GEMINI_API_KEY GOOGLE_API_KEY
Run offline preflight audit (all)
npx agycraft-mcp doctor

Verify Fix

Verify
gemini --version && npx agycraft-mcp doctor