In this guide
What does the error mean?
Google’s API errors table lists code payment_required, HTTP 402 Payment Required, with the description Your Prepay credit balance is depleted. Its advice is not to retry, because the request won’t succeed until credits are added.
On Google’s developer forum the response body shows up as "code": 402 with "status": "RESOURCE_EXHAUSTED" and a message that starts Your prepayment credits are depleted. That status is easy to mistake for a rate limit. The 402 is what tells you it’s billing.
The stop is account-wide. When the Prepay balance on a billing account reaches $0, all API keys in all linked projects stop working at the same moment.
Your AI bill, with ernd
What could your AI bill earn?
Enter an amount from $0 to $100,000,000.
back a year at 4%
For US companies. No annual fee. Illustration based on AI vendor spend only. Rewards are points redeemable as cash back.
How do you fix it?
- Turn off automatic retries for 402s. They can’t succeed yet.
- Open the AI Studio Billing page and buy credits. The page shows the minimum for your region and tier.
- Wait for the purchase to confirm. Card payments are usually instant, while bank transfers can take several days, and service only resumes once the payment clears.
- Retry. If the balance went negative while usage was still being counted, that amount comes out of the purchase.
A 403 PERMISSION_DENIED that mentions an outstanding balance is a different problem. That’s the Payment needed project status. Clear the past-due balance or update the payment method on the AI Studio or Cloud Billing page, and access comes back once the account is in good standing.
How do you keep it from coming back?
Set up auto-reload. In the Available credits card on the Billing page, click Setup auto-reload and choose the payment method, the reload amount and the minimum balance that triggers a reload. You can also set a monthly auto-charge limit, after which auto-reload switches off until the next month.
Leave room for lag. Google says Prepay is subject to overages during roughly 10 minutes of billing pipeline delay, so set the trigger well above zero.
A Cloud budget alert at 50% and 90% of your expected month gives you a second warning. An alerts-only budget won’t cap spend.
The reload is only as good as the card behind it. ernd is a card for AI spend with 4% back on AI vendor bills.
The ernd card
Once your billing is back on track.
The card earns rewards on AI spend. It does not bypass provider quotas, fix account restrictions or change provider prices.
Request your cardThe ernd card is a credit card for US companies, with partners across the AI stack built in.
Common questions.
Does my project drop to the Gemini free tier when credits run out?
No. Google says projects aren't automatically downgraded to the Free Tier. They stay paid and stop until you buy more credits.
How much can I prepay for the Gemini API?
Google's billing docs give a $5 minimum and a $5,000 maximum, and say the AI Studio page shows the minimum for your region and tier.
Do Gemini Prepay credits expire?
Yes, 12 months after the purchase date. They're non-refundable unless you switch to a Postpay account.
Sources & methodology
Checked . Providers change prices and terms; the linked official page is the final word. This guide is published by ernd.
ernd is run by Provenance Research Inc.
