← Back to Blog

Fix: "Your credit balance is too low to access the Anthropic API" — Claude 400 Error

2026-09-09·4 min read·CodeRouter Team
your credit balance is too lowanthropic credit balance too lowclaude api credit errorclaude code credit balance erroranthropic api billing errorplans and billing upgrade or purchase credits

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

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:

  1. unset ANTHROPIC_API_KEY (and remove it from your shell profile / .env if it's exported there).
  2. Check ~/.claude/settings.json for an apiKeyHelper you didn't intend.
  3. Run /login and authenticate with the subscription account.
  4. Confirm with /status that 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)

  1. Open the Anthropic Console → Plans & Billing for the org that issued the failing key.
  2. Purchase credits, and turn on auto-reload with a sensible threshold so long sessions don't die mid-run.
  3. 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

Part of the LLM API Error Reference — errors indexed by their exact strings.

Ready to Reduce Your AI API Costs?

CodeRouter routes every API call to the optimal model — automatically. Start saving today.

Get Started Free →

Get weekly AI cost optimization tips

Join 2,000+ developers saving on LLM costs