Claude Code Using API Credits Instead of Pro or Max
Prepared and checked using AI. Sources are linked in the article.
If Claude Code is using API credits instead of your Max subscription, check for ANTHROPIC_API_KEY: an environment API key can override your subscription even while you are logged in. Interactive sessions ask you to approve the key once; non-interactive runs with -p use it whenever it is present. To restore subscription usage, remove the override, sign in with your paid Claude account, and verify the authentication method before sending another coding request.
Check which credentials the session uses
Inside the affected Claude Code session, run /status to see the active authentication method:
/status
Check the account and authentication information. Being signed in does not, by itself, establish that your subscription is the active credential.
From a terminal outside Claude Code, check authentication with claude auth status --text:
claude auth status --text
Without --text, the command returns JSON. Its authMethod can be none, claude.ai, oauth_token, api_key, api_key_helper, or third_party.
Use /status in the affected session as well as checking from the terminal you intend to launch from. Avoid copying raw API key values into screenshots, issue reports, or chat messages.
Remove the API key and reconnect your subscription
These steps assume Claude Code is already installed and you have an active Pro or Max subscription.
1. Clear the key from the launch environment
Exit the affected session. In a macOS or Linux terminal using Bash or zsh, remove the variable:
unset ANTHROPIC_API_KEY
For Windows PowerShell:
Remove-Item Env:ANTHROPIC_API_KEY
For Windows Command Prompt:
set ANTHROPIC_API_KEY=
These commands remove the variable from the current shell environment. Also remove its persistent definition if you want future launches to use your subscription. Check shell startup configuration, such as ~/.zshrc for zsh or ~/.bash_profile for Bash; on Windows, delete the variable from Environment Variables settings.
Restart your terminal or launcher after making the persistent change, then start a new session. Do not rely on an already-running session to verify the fix.
2. Sign in with the account that owns the plan
Pro and Max include Claude Code when you authenticate with the same Claude account that owns the subscription. If your existing login uses Claude Console billing, switch it.
From the terminal:
claude auth logout
claude auth login
claude
Choose your Claude subscription account during authentication. Do not add --console to the login command: that flag selects Console authentication for API usage billing.
Inside the new session, run /status again. Confirm that the active credential and account match your intended subscription before continuing work.
If API authentication keeps returning
Check Claude Code settings
Claude Code reads user, shared project, local project, and managed settings. Inspect the applicable files:
| Scope | Settings location |
|---|---|
| User | ~/.claude/settings.json |
| Shared project | .claude/settings.json |
| Local project | .claude/settings.local.json |
| Managed | Your organization’s managed settings sources |
Look for an API key in the env object or an apiKeyHelper that supplies credentials. An env entry can set variables for Claude Code sessions; apiKeyHelper runs a command to produce an API credential. Clearing a shell variable does not remove either configuration.
Remove unintended credential entries while preserving unrelated settings. If an organization manages the configuration, identify the enforced source before trying further local changes.
Check other credential overrides
Several credential sources take precedence over the subscription login created by /login, including:
ANTHROPIC_AUTH_TOKEN, commonly used for bearer-token authentication through a gateway.- An approved
ANTHROPIC_API_KEY. - An
apiKeyHelper. CLAUDE_CODE_OAUTH_TOKEN, which can select a different OAuth credential.- Cloud-provider configuration selected through
CLAUDE_CODE_USE_BEDROCK,CLAUDE_CODE_USE_VERTEX, orCLAUDE_CODE_USE_FOUNDRY.
For interactive use, /config has a “Use custom API key” toggle while ANTHROPIC_API_KEY is set. Turning it off can change the interactive choice, but removing the variable is the more durable approach when scripts also launch Claude Code: -p uses a present API key without that approval prompt.
Subscription usage can still have additional charges
Correct subscription authentication does not rule out separately enabled overage spending. Usage credits let Claude Code continue at standard API rates after your included plan limits are reached. They are charged separately from the subscription and are distinct from Console API credits.
To stay within your included allocation:
- Disable usage credits in your Claude account under Settings > Usage.
- Decline offers to continue through Console API credits.
- Wait for your included usage to reset.
If you intentionally use Console billing, review its auto-reload settings too: auto-reload can purchase additional API credits when the balance runs low. For broader planning, see our guide to the cost of running multiple AI agents.
Where Parallel Code fits
Parallel Code is our free, open-source (MIT) desktop app for macOS and Linux that runs several AI coding agents in parallel, each isolated in its own git worktree. It runs locally and launches the agent CLIs you already use, so no extra subscription is required. Make authentication verification part of your setup before starting several sessions.