Gemini API error 402 Payment Required? Your prepaid credits ran out
Ship ItChecked against the official source
Source checked 6 Oct 2026 · Published 21 Oct 2026 · Last reviewed 21 Oct 2026 · By Ctrl+Z Therapy (how we test)
The short answer
Prepay and Postpay billing plans for the Gemini API started taking effect March 23, 2026, and new users default to Prepay. On Prepay you buy credits first. When the credit balance on your billing account hits $0, all API keys in all projects linked to that billing account stop working at once, and requests fail with HTTP 402 Payment Required (payment_required: "Your Prepay credit balance is depleted."). Don't retry: Google says the request won't succeed until credits are added.
What to do
- In Google AI Studio, open the Billing page and buy credits. The minimum purchase is $5.
- Set up auto-reload with a monthly auto-charge limit, so automatic reloads can't run away.
- Not every account is on Prepay yet, so check your billing plan in AI Studio.
Good to know
- 402 and 429 are different. 402 means no credits, so don't retry. 429 RESOURCE_EXHAUSTED is a rate limit, so wait and retry.
- Unused credits expire after 12 months.
- Using Gemini through Firebase AI Logic or Vertex AI? Their billing wasn't checked for this answer.
Source
Checked on 6 Oct 2026. Prices, limits and settings change, so check the source before you rely on them.