Claude Code CLI runs same AI eval for $0 vs $9.14 on Anthropic API
A developer found that running a 27-call board evaluation through Anthropic's Claude Code CLI cost nothing, while the same workload billed $9.14 via the API, with both using the claude-opus-4 model. The CLI logs what the run would have cost on the API but charges the user's subscription instead. The developer also noted that using structured JSON output with a relaxed schema improved format reliability from 7 out of 15 to a perfect 15 out of 15. A critical warning was flagged: if an Anthropic API key is present in the child process environment, the CLI silently bills the API account rather than the subscription, with no errors or warnings until the invoice arrives. The developer emphasized that while using the CLI for local development loops is within Anthropic's terms, deploying it as a shipped service is not, advising teams to iterate on the CLI but ship on the API.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in