In this guide
Disclosure: ernd partners with Wafer.
What does the error mean?
Wafer’s error table lists 402 with code insufficient_credits and the meaning Your credit balance is too low for the request. Its retry column says to retry after a top-up.
Serverless on Wafer is prepaid. Before a request runs, Wafer works out its maximum possible cost and compares it with your balance. The estimate assumes the request generates its full max_tokens, multiplied by n. The error body carries credits_available_cents and credits_required_cents_estimate, so you can see the gap.
Wafer says the wording of message can change, so match on the code field.
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?
- Add credits at app.wafer.ai.
- Retry the request. Requests rejected before generation starts aren’t charged, so the failed one cost nothing.
- If you can’t top up right now, set a smaller
max_tokens. Without one, Wafer uses the model’s default output length for the estimate, which can be large. - If the code is
member_spend_limitinstead, the account has a spend limit for that member, and whoever manages the account’s limits has to raise it.
Don’t loop on the 402. Wafer’s docs say to add credits first.
How do you keep it from coming back?
Wafer’s docs don’t describe auto-reload or low-balance alerts, so watch the balance yourself. The dashboard at app.wafer.ai shows it, and GET https://api.wafer.ai/v1/usage returns tokens and cost per model that your monitoring can poll.
Always send max_tokens. It keeps the up-front estimate close to what you really use, so a modest balance covers more requests.
Pay for credits on a card you keep for AI vendors. ernd cardholders earn 10% back on Wafer spend.
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.
Am I charged for a request that fails with insufficient_credits?
No. Wafer doesn't charge requests that are rejected before generation starts. A stream that fails after it starts may be charged for tokens already generated.
Why does a short prompt fail with a 402 on a small balance?
Wafer's estimate assumes the full max_tokens, times n. Leave max_tokens out and it uses the model's default, which Wafer says can run from tens of cents to over a dollar per request.
What is member_spend_limit?
Another Wafer 402 code. It means a spend limit set on your account for that member has been reached, so whoever manages spend limits on the account has to raise it.
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.
