Google Gemini API error
Gemini API 402 payment_required: what it means and how to fix it
402 payment_requiredRetry? NoLast verified 2 documented fixes2 sources
What it means
Your Prepay credit balance is depleted.
Causes
- The billing account has run out of Prepay credits
How to fix it
- Fix 1.
Add credits to your billing account, or turn on auto-reload.
- Fix 2.
Do not retry: the request will not succeed until credits are added.
More Gemini API errors
All 30 Gemini API errorsHTTP 402 at other providers
402 billing_errorRetry? Not statedAnthropic API402 Payment RequiredRetry? Not statedCohere API402 - Insufficient BalanceRetry? Not statedDeepSeek API402 Payment requiredRetry? Not statedMistral API402 payment_requiredRetry? NoOpenRouter402 in_flight_budget_exhaustedRetry? YesOpenRouter402 weight_exceeds_budgetRetry? NoOpenRouter
FAQ
What does the Gemini API error "402 payment_required" mean?
Your Prepay credit balance is depleted.
How do I fix Gemini API "402 payment_required"?
There are 2 documented fixes. Start with the first: Add credits to your billing account, or turn on auto-reload.
Should I retry Gemini API "402 payment_required"?
No. The official docs treat this error as not retryable: fix the cause before sending the request again.
Which other AI APIs return HTTP 402?
Per their official error docs: Anthropic API (402 billing_error), Cohere API (402 Payment Required), DeepSeek API (402 - Insufficient Balance), Mistral API (402 Payment required), OpenRouter (402 payment_required; 402 in_flight_budget_exhausted; 402 weight_exceeds_budget).
Sources
Last verified against 2 sources: Gemini API's official docs and official SDK repositories.
- ai.google.devhttps://ai.google.dev/gemini-api/docs/api-errors
- ai.google.devhttps://ai.google.dev/gemini-api/docs/troubleshooting
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.