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

Google Gemini API error

Gemini API 402 payment_required: what it means and how to fix it

Error message
402 payment_required

Retry? 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

  1. Fix 1.

    Add credits to your billing account, or turn on auto-reload.

  2. Fix 2.

    Do not retry: the request will not succeed until credits are added.

More Gemini API errors

All 30 Gemini API errors

HTTP 402 at other providers

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.

Newsletter

Know when the APIs change

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