Claude Code dies with ANTHROPIC_API_KEY in cloud environment
4 comments
I once followed their docs and added it to my Claud Code Web to call their API. Unbeknownst to me they started charging me for all Claude Code calls by passing them to the API. They refused to refund me, but did update their docs at some point to remove the faulty instructions I followed.
> Unbeknownst to me
Isn't that literally what the point of this environment variable is for?
ie to provide your Anthropic API key to Claude Code so it uses that for billing
Isn't that literally what the point of this environment variable is for?
ie to provide your Anthropic API key to Claude Code so it uses that for billing
Maybe I wasn’t clear. I was following the docs on their SDK. See here: https://platform.claude.com/docs/en/api/sdks/typescript
This is for their API, and I was on Claude Code Web.
It wasn’t clear to me that following the SDK docs and introducing the environment variable as in the examples would magically enable API billing for Claude Code.
This is for their API, and I was on Claude Code Web.
It wasn’t clear to me that following the SDK docs and introducing the environment variable as in the examples would magically enable API billing for Claude Code.
So you were using it because your tests are going to look for it, think again, find another way.
Also, I suspect that is why I had a lot of "Extra usage".
For the whole long history:
https://github.com/anthropics/claude-code/issues/54497
Hope this saves some others a lot of headaches!