GuidesHosting choices

Claude Code "Credit balance is too low" on a Pro or Max plan

On a Pro or Max plan, an ANTHROPIC_API_KEY in the environment outranks your sign-in and bills a Console org with no credit. How to find and remove it.

November 14, 2026The Everpod team
The short answer

On a Pro, Max or other paid Claude plan, “Credit balance is too low” usually means Claude Code is not using your plan at all. An ANTHROPIC_API_KEY in the environment outranks the plan’s sign-in, so requests go out on that key and bill the Claude Console organisation it belongs to, which has no prepaid credit. Run /status and look at the API key row. If a key is listed, unset ANTHROPIC_API_KEY, delete the line that sets it, and start claude from a fresh shell.

What the message means

The message comes from the Claude API’s prepaid billing, the Console side of Anthropic, not from your subscription. Anthropic’s error reference gives exactly two causes: “Your Console organization has run out of prepaid credits, or Claude Code is sending your requests with a Console API key when you meant to use your subscription.” A plan that runs out of its allowance hits usage limits, which have their own messages in the same reference. So if you pay for a plan and see a credit balance, the request was billed somewhere you didn’t intend.

Why the key wins over your plan

When more than one credential is present, Claude Code picks one in a fixed order, and the documented order puts your plan last:

  1. Cloud provider credentials (Bedrock, Vertex, Foundry), when selected
  2. ANTHROPIC_AUTH_TOKEN
  3. ANTHROPIC_API_KEY
  4. An apiKeyHelper script’s output
  5. CLAUDE_CODE_OAUTH_TOKEN, the token from claude setup-token
  6. Anthropic profile and federation credentials
  7. The subscription sign-in from /login

The key’s place in that list has two rules that explain most surprises. In an interactive session, Claude Code asks once whether to use a key it finds in the environment and remembers the answer. In -p mode, the docs say, “the key is always used when present.” That is why a server so often shows this error in a script or a timer job while claude typed by hand works: declining the key at the prompt covers interactive sessions only, and the headless run never asks. It is also why a setup token doesn’t rescue the job. It ranks below the key, so the key still has to go.

To change the remembered interactive answer, open /config and use the “Use custom API key” toggle. It is only there while the variable is set.

Confirm which credential is in use

Inside a session, /status is the check. It shows the API key row when a key is in play, and when a login and a key are both configured it marks the one that isn’t in use. Outside a session, check for the variable and for a plan sign-in to fall back to:

env | grep -o '^ANTHROPIC_[A-Z_]*'   # names only, never the key
claude auth status
Copied

claude auth status prints JSON. If it shows "loggedIn": false (and "authMethod": "none", with exit code 1, as on version 2.1.323), there is no plan sign-in on this machine, and removing the key alone leaves you with Not logged in. Sign in with claude auth login, whose default is the Claude subscription; its --console flag is the API-billing sign-in you don’t want here. On a server with no browser, the Linux guide’s sign-in section covers the paste-the-code flow.

Find where the key comes from on a server

Unsetting the variable fixes the current shell; the next login shell or the next run of a job sets it again from wherever it lives. The usual places on Linux:

grep -n ANTHROPIC_API_KEY ~/.bashrc ~/.profile ~/.bash_profile ~/.zshrc /etc/environment 2>/dev/null
grep -rn ANTHROPIC_API_KEY ~/.claude/settings.json .claude/ 2>/dev/null
grep -rln ANTHROPIC_API_KEY .env* 2>/dev/null
systemctl --user cat <your-job>.service | grep -i -e Environment -e ANTHROPIC
Copied

The third line matters on a project that also calls the API from its own code. A .env file only reaches Claude Code if something loads it into the environment first, such as direnv, a Compose file, a systemd EnvironmentFile=, or a wrapper script that sources it, and Claude Code started in that environment inherits the key along with the project’s own process. For a timer job, the unit’s environment is the one that counts, not your interactive shell’s.

Then make the change stick:

unset ANTHROPIC_API_KEY
# delete the export line the grep found, then open a new shell
claude      # and check /status: the plan should be the credential in use
Copied

If the project’s own code needs the key, keep it out of the shell Claude Code starts in. Have the app read it from its own config rather than from a variable exported for the whole session, or start Claude Code with the variable removed: env -u ANTHROPIC_API_KEY claude.

Scheduled runs on your plan

A job that should bill your plan needs a plan credential it can use with nobody at the keyboard, and no key anywhere in its environment. The documented route is a one-year token from claude setup-token, set as CLAUDE_CODE_OAUTH_TOKEN. It needs a Pro, Max, Ultra, Team or Enterprise plan. A job that passes --bare does not read that token, and needs a key instead, which bills the Console. The rest of a timer setup is in running Claude Code headless on a schedule.

When you did mean to use the key

If the key is deliberate, the message is literal: the Console organisation is out of prepaid credit. Add credit on the Console’s billing page, and turn on auto-reload there so the balance refills before it reaches zero. Anthropic also suggests per-workspace spend caps so one project can’t drain the whole organisation. A key bills API rates per token, separate from any plan. Which plans include Claude Code compares the two ways of paying.

Run Claude Code on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.