All articles
AIClaude

Claude Code Credit Balance Is Too Low on Pro/Max? 3 Easy Steps to Fix It

claude code credit balance is too low on Pro or Max usually means ANTHROPIC_API_KEY is still set. Check /status, unset the key, then /login. Verified fix.

Also available in

Claude Code shows Credit balance is too low when the request went through a Claude Console account that has run out of prepaid credits. If you pay for Pro or Max, the subscription itself does not produce this error. The usual cause is a leftover ANTHROPIC_API_KEY in your environment: Claude Code sends requests with that key and bills the API account, which is empty. The fix takes three steps: run /status to see which credential is active, unset ANTHROPIC_API_KEY and delete it from your shell profile, then relaunch Claude Code and run /login with your subscription. This guide covers claude code credit balance is too low on the CLI and in VS Code. We checked the exact message and every step against the official Claude Code error reference on November 4, 2026.

claude code credit balance is too low: an API key taking priority over the subscription

What claude code credit balance is too low means

The message is a single line:

Credit balance is too low

The official docs list two causes:

  • your Claude Console organization has run out of prepaid credits;
  • Claude Code is sending your requests with a Console API key when you meant to use your subscription.

Pro and Max users almost always hit the second one. Many people once added export ANTHROPIC_API_KEY=... to ~/.zshrc or ~/.bashrc to test the API or run another tool, then bought a subscription and forgot about it. That API account has no balance left, so every request fails.

Why Claude Code uses the API key on a Pro or Max plan

Claude Code picks credentials in a fixed order. According to the authentication precedence docs, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY and apiKeyHelper all rank above the subscription login from /login, which comes last.

  • In interactive mode, Claude Code asks once whether to use ANTHROPIC_API_KEY. If you approved it, it keeps using it.
  • In non-interactive mode (claude -p), the key is always used when present. There is no prompt.
  • The VS Code extension reads the same variable, so the fix below also applies when the extension shows credit balance is too low.

How to fix claude code credit balance is too low

Step 1: check the active credential with /status

Type /status inside Claude Code and look at the API key row. When a login and an API key are both configured, /status marks the one that isn’t in use. If the API key is the active one, you have found the cause.

Step 2: remove ANTHROPIC_API_KEY

On macOS, Linux or WSL, run this in the current terminal:

unset ANTHROPIC_API_KEY

In Windows PowerShell:

Remove-Item Env:ANTHROPIC_API_KEY

That only affects the current window. To make it permanent, delete the export ANTHROPIC_API_KEY=... line from ~/.zshrc, ~/.bashrc or ~/.profile. On Windows, also check $PROFILE and your User environment variables. This finds the file that sets it:

grep -n "ANTHROPIC_API_KEY" ~/.zshrc ~/.bashrc ~/.profile 2>/dev/null

Step 3: relaunch Claude Code and run /login

Quit and start claude again. If you have never signed in with your subscription, run /login and pick your Claude account. Run /status once more to confirm the subscription login is active.

If you want to keep the variable for other tools, turn off “Use custom API key” in /config instead. The toggle only appears while ANTHROPIC_API_KEY is set. claude -p ignores the toggle and uses the key whenever it exists.

If you do use the API: add credits

If you meant to pay per use with an API key, the balance really is empty:

  • add credits at platform.claude.com/settings/billing and consider turning on auto-reload so the balance refills before it hits zero;
  • set per-workspace spend caps in the Console so one project can’t drain the whole organization.

Spend caps produce a different error, covered in Claude Code monthly spend limit. For how subscription usage is counted, see Claude usage limits explained.

Quick checklist

  1. /status shows an API key in use: remove the variable and log in again as above.
  2. /status shows the subscription and the error persists: look for an apiKeyHelper or ANTHROPIC_AUTH_TOKEN. This is our inference: both rank above the subscription, but the error page only names ANTHROPIC_API_KEY.
  3. The error only appears in claude -p, CI or scripts: check the variables in that environment, since non-interactive runs never ask.
  4. You really are on the API: add credits.

For expired logins see Claude Code API Error 401 OAuth token has expired, and for everything else see the Claude Code error list.

FAQ

I have Max. Do I need to buy API credits?

No. The subscription and the Claude Console are billed separately, and Max usage never shows up as API balance. Once ANTHROPIC_API_KEY is gone, Claude Code uses your subscription.

The error came back after I opened a new terminal

unset only applies to the current window. A new terminal reads your shell profile again, so delete the export line from the file.

Can a work API key and a personal subscription live on one machine?

Yes, but Claude Code uses one at a time. Remove the variable to use the subscription. To switch back, export the key again and turn on “Use custom API key” in /config.