Billing mode

Claude Code API Key vs Subscription

A Pro or Max subscription can cover Claude Code, but an environment API key can route usage to token billing instead.

Subscription login

Use this path when you want Claude Code to draw from a Pro, Max, Team, or Enterprise subscription. Limits are shared with Claude activity on the same plan.

  • Good for predictable individual usage.
  • Expect reset messages when limits are reached.
  • Monitor plan usage in Claude settings where available.

API key billing

Use this path when you intentionally want pay-as-you-go billing through Console or another supported provider. There may be no subscription-style hard stop.

  • Use /cost during sessions.
  • Set spend limits in the API Console.
  • Clear long sessions to avoid unnecessary token spend.

Quick check

If ANTHROPIC_API_KEY is set on your machine, official Claude docs warn that Claude Code may use that API key for authentication instead of your subscription, causing API usage charges.

Setup checklist

1. Check auth mode

Confirm whether you signed in through Claude or are relying on an API key.

2. Check environment

Look for ANTHROPIC_API_KEY in shell profiles, project env files, CI, and terminal sessions.

3. Check spend

When using API mode, use /cost and Console spend limits before long agentic tasks.