This error has nothing to do with your code: the prepaid balance behind the key is empty (or your monthly spend cap tripped). Here's how the billing models differ between Anthropic Console and gateways, and the alarms that stop it recurring at 2 a.m.
The error
// Anthropic Console (HTTP 400):
{"type":"error","error":{"type":"invalid_request_error",
"message":"Your credit balance is too low to access the Anthropic API..."}}
// OpenAI-compatible gateways, e.g. Kunavo (HTTP 402):
{"error":{"message":"Wallet balance is too low for this request. Top up at https://kunavo.com/app/billing",
"type":"insufficient_quota","code":"insufficient_quota","param":null}}Causes and fixes at a glance
| Cause | Fix |
|---|---|
| Prepaid balance actually at zero | Top up. On Anthropic: Console → Plans & billing. On Kunavo: /app/billing (balance never expires). |
| Auto-reload off (or its card expired) | Enable auto-reload / update the card so spikes don't drain to zero unnoticed. |
| Monthly spend cap reached | Raise or clear the per-key / per-workspace cap if the spend was legitimate. |
| Wrong workspace's key | Keys draw from the workspace that minted them — a funded org doesn't fund a different workspace's key. |
Confirm it's balance, not auth
401 = key problem; 400 "credit balance too low" / 402 insufficient_quota = money problem. Don't rotate keys for a billing error — the new key reads the same empty wallet.
Top up, then verify with one cheap call
Balances apply immediately on both Anthropic and Kunavo — no redeploy needed. Verify with a minimal request before unpausing your workers:
curl -s https://api.kunavo.com/v1/chat/completions \
-H "Authorization: Bearer $KUNAVO_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"claude-haiku-4-5","max_tokens":8,"messages":[{"role":"user","content":"ok?"}]}'Seeing it in Claude Code?
Claude Code prints this message when it runs on an Anthropic API key whose Console balance is empty — a Pro or Max login runs into usage limits instead and never shows it. Top up the Console, or keep working on a pay-as-you-go endpoint: Claude Code reads ANTHROPIC_BASE_URL natively, so the switch is a few environment variables. Keep the four model lines — Claude Code's default and its opus and sonnet aliases follow Anthropic's newest models, and the sonnet alias asks for Sonnet 5.5, which Kunavo does not serve.
export ANTHROPIC_BASE_URL=https://api.kunavo.com
export ANTHROPIC_AUTH_TOKEN=sk-kn-...
export ANTHROPIC_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5Make the next one boring
Set a low-balance alert (email) and, if your provider supports it, auto-reload with a sane monthly cap. Fail-closed billing is correct — you just want the warning before the wall, not the wall.
On Kunavo: read the 402, or let it top itself up
A Kunavo wallet 402 says so in machine-readable form: error.code is insufficient_balance, error.balance_usd and error.needed_usd give the gap, and error.topup_url and error.auto_recharge_url open the billing page with the fix preselected — neither link charges anything. With optional auto-recharge on, the wallet tops itself up by an amount you choose, from $10 and within a monthly cap you set, whenever it falls below your threshold, so a request that would have been refused is served instead — as long as the charge goes through and the cap has room. While such a top-up is still in flight the 402 carries Retry-After: retry after it, and stop retrying on a 402 without it.
If you’re calling through Kunavo
Kunavo fails closed at zero with an explicit 402 insufficient_quota (never a vague 500), failed requests aren't billed, and active accounts get a low-balance email with their own burn-rate runway before they hit the wall. Balance is a prepaid wallet from $10 that never expires, topped up at /app/billing with cards, with Apple Pay, Google Pay or Link outside India, or with a local rail Stripe shows in your currency such as Pix, WeChat Pay, UPI or KakaoPay. How far a given top-up goes depends entirely on which model you point at, and the per-model rates are in the Anthropic Claude API price list.
Frequently asked questions
I topped up — why am I still getting the error?
Check you funded the same account/workspace that minted the key, and that a monthly spend cap isn't the real blocker. Balance application itself is immediate on both Anthropic and Kunavo.
Does Claude's API have a free tier?
No — Anthropic bills every API call from the first token (Claude.ai consumer plans are separate from API credit). Gateways are also pay-as-you-go; Kunavo starts at a $10 top-up with rates under list.
“Credit balance is too low” in Claude Code — but I pay for Pro. Why?
Because Claude Code is using an API key, not your subscription. While ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is set, Claude Code bills the key and parks the Pro or Max login, and that key draws on a separate prepaid Console balance. Run /status to see which credential is live; unset the variable to go back to the plan, or top up the key's balance.
OpenClaw says “API provider returned a billing error” — is that the same thing?
Yes. That is OpenClaw's wording for a billing refusal from the model provider: the API key has run out of credits or has an insufficient balance. Top up that provider, or switch OpenClaw to a different one — the related guides below compare the options.
Related guides
- Anthropic Claude API pricing October 2026 (official rates)
- Claude Code API key — where to get one, where to put it, and why the wrong variable fails silently
- Is Claude Code free? What's free, what isn't, and what a month costs
- Best API for OpenClaw: choose a provider and model by task
- “Your organization has disabled Claude subscription access for Claude Code” — the three causes and what works
More error semantics live in the error reference; getting a key takes a minute via signing up and the authentication guide.