Demo, all content is generated
Question

Claude Code cost me $140 in a week on API billing, would Max be cheaper?

Open · 2106 views · asked by theo_side · edited

I've been using Claude Code with an API key from the Console. Last week: $140. I thought I was on my Pro subscription the whole time, turns out it's using the API key.

Two questions: how do I make it use my subscription instead, and is Max worth it compared to API at this usage?

What I’ve tried

Ran /cost which shows the session cost, which is how I noticed. Removed the key from the project .env but it still says it's using API billing.

Comment
Check your shell profile, ~/.zshrc or similar. Bet ANTHROPIC_API_KEY is exported there. jonah_b · edited
Same thing happened to me, $60. Great question to have public. pedro_the_pm · edited

3 answers

thandeka · edited

If ANTHROPIC_API_KEY is set in the environment, Claude Code uses it over your subscription login. Removing it from the project .env isn't enough if your shell also exports it.

  1. echo $ANTHROPIC_API_KEY in a new terminal. If it prints something, remove the export from ~/.zshrc / ~/.bashrc, open a new terminal.
  2. Run /status in Claude Code to see which auth it's using, /login with your Claude account if needed.

On the math: $140/week is ~$600/month of API usage. Max at $100 or $200 is much cheaper at that level, as long as the limits fit your work pattern.

Comment
it was in .zshrc from some tutorial months ago. /status now shows my Claude account. ugh, that key cost me a lot theo_side · edited
told you 😄 jonah_b · edited
sergio_ruiz · edited

Worth noting API billing isn't wrong per se, it's just pay-per-token. The same habits that cut API cost (clear often, point at files, Sonnet by default) are what keep you under Max limits too.

Comment
yeah I also let it read the whole repo every time. two problems then theo_side · edited
chloe_d · edited

Also for anyone reading: set a monthly spend limit on the Console workspace. Would have capped this at whatever you set.

Comment