OverpayingForAIPricing desk

Lesson 2 of 3 · 7 min read · Beginner

The trap: how a $20 subscription turns into an API bill — Claude Code

The single most common Claude Code billing surprise isn't a hidden fee — it's authenticating with an API key instead of your subscription login, which quietly routes usage to a separate, metered bill.

In this lesson you will

  • Explain exactly how the ANTHROPIC_API_KEY trap happens
  • Know what "API-credit continuation" means and why to decline it by default
  • Use the /status command to confirm which billing path you're on

This site's own verified cost trap for Claude Code is specific: assuming the subscription includes unlimited coding, or accidentally authenticating with an ANTHROPIC_API_KEY and paying API charges instead of using plan capacity. Both halves matter, but the API key one is the more mechanical, avoidable mistake — and the one worth understanding exactly.

How the trap actually happens

This is a replay showing the mechanism, not a live shell — the specific prompts and messages can change between Claude Code versions.

recorded session — not a live shell0 / 3
  1. export ANTHROPIC_API_KEY=sk-ant-api03-...This line, often left over from an earlier API project or copied from a tutorial, sets an environment variable most terminals keep active for the whole session.
  2. claudeWhen that environment variable is set, Claude Code uses it automatically — even if you're also logged into a Pro or Max plan. The plan subscription and the API key are two separate billing paths, and the API key takes priority when present.
  3. /statusThe /status command is the direct way to check which billing path is actually active — this is the check to run if a session ever feels like it's costing more than a flat subscription should.

A recorded walkthrough of the exact moment a Pro/Max subscriber can end up on API billing without meaning to.

The other half of the trap is subtler: some flows offer "API-credit continuation" when you hit your plan's shared limit — a prompt to keep going on pay-as-you-go API billing rather than waiting for your allowance to reset. This site's own recommendation is direct: decline it unless you've explicitly budgeted for API charges.

Knowledge check

You hit your Claude Max limit mid-task and Claude Code offers to continue on API-credit billing. What's the recommended default response?

Lesson FAQ

Why is Claude Code charging me for API usage when I have a subscription?

Most often because an ANTHROPIC_API_KEY environment variable is set and active — Claude Code uses it automatically when present, routing that session to separate, metered API billing instead of your Pro or Max plan capacity. Run /status to confirm which billing path is active.

What is API-credit continuation in Claude Code?

A prompt offered when you hit your plan's shared usage limit, letting you keep working on pay-as-you-go API billing instead of waiting for your allowance to reset. This site's own recommendation is to decline it unless you've explicitly budgeted for the extra charges.

How do I check whether Claude Code is billing my plan or the API?

Run the /status command inside Claude Code — it reports which billing path the current session is using, along with an estimated session cost if you're on API billing.

Finished reading?

Mark it done to track your progress through the course.

Save progress across devices

Get a private link that restores your lessons on any device. Email is optional and only used to send you the link.

Compare, calculate, decide — for Claude Code

If our calculators helped you cut down on hidden AI wallet leaks, thanks for using them. A tiny fraction of your savings is what keeps our pricing indexes updated daily.

Not sure which AI is cheapest for your use case? Find out in 30 seconds — no signup required.

AI cost intelligence

Stop overpaying for AI tools

Join the OverpayingForAI list for pricing updates, cheaper alternatives, and practical buying guidance.

Now tracking 50+ AI tools, models, platforms, subscriptions, coding tools, and automation products.

We use your email only for OverpayingForAI updates. Unsubscribe anytime.