TL;DR — Anthropic's API runs on prepaid credits. When the balance of the billing account behind your API key hits zero, every request fails with a 400: Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits. A Claude Pro/Max subscription does not add API credits — they are separate products. In Claude Code specifically, this error often means the session is silently using an API key (via ANTHROPIC_API_KEY or a helper) when you intended to use your subscription login. Fix: top up credits in the Console, or remove the stray key and re-authenticate with your subscription.
The error
HTTP 400
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits."
}
}
Note the status: 400, not 402 or 429. Generic error handlers that treat 400 as "my request was malformed" send people off debugging JSON bodies that were fine all along. Match on the message or error type, not the status code.
Why it happens
- Prepaid balance ran out. Anthropic API billing is credit-based: you buy credits, usage draws them down, zero balance means hard stop. Agentic coding sessions draw balance down fast because every tool step replays a growing context.
- Subscription ≠ API credits. Claude Pro/Max covers claude.ai and subscription-based Claude Code usage. It does not fund Console API keys. An API key from an unfunded Console org fails immediately, whatever subscription the same email has.
- Wrong org's key. Console accounts can belong to multiple organizations; the key you're using may come from an org whose balance is empty, while the funded org sits unused.
- Auto-reload not set (or its payment failed). Balance quietly hit zero overnight; the first request of the morning is the messenger.
The Claude Code special case
A very common shape of this error in Claude Code: you pay for Claude Max, expect usage to bill against the subscription, and still get the credit-balance error. Cause: an ANTHROPIC_API_KEY environment variable (or an apiKeyHelper in settings) takes precedence, so the session bills the API org instead. The tell — Claude Code asks at startup whether to use the detected API key, or /status shows an API-key auth method when you expected a subscription login.
Fix:
unset ANTHROPIC_API_KEY(and remove it from your shell profile /.envif it's exported there).- Check
~/.claude/settings.jsonfor anapiKeyHelperyou didn't intend. - Run
/loginand authenticate with the subscription account. - Confirm with
/statusthat the auth method is your subscription, not an API key.
The reverse also exists: teams that want API billing should fund the right Console org and verify which org the active key belongs to.
The straightforward fix (API users)
- Open the Anthropic Console → Plans & Billing for the org that issued the failing key.
- Purchase credits, and turn on auto-reload with a sensible threshold so long sessions don't die mid-run.
- Re-test with a minimal request before resuming agent work.
Propagation is quick but not always instant; give it a couple of minutes before concluding the top-up "didn't work."
Prevention
- Auto-reload + a billing alert below your comfort floor: the error should never be how you learn the balance is low.
- Treat this error as terminal in retry logic. Like OpenAI's
insufficient_quota, no amount of backoff fixes an empty balance — halt and alert instead of retrying. - Don't single-thread your coding sessions on one funded account. If an empty balance on one provider stops all work, that's a fragility you can design away by routing across upstreams with independent billing — what a router API should handle for you.
Part of the LLM API Error Reference — errors indexed by their exact strings.