Running Claude Code on a budget: where the tokens go
Coding agents are the most expensive way to use an LLM, and the reason is not the reasoning. It is context: reading files, re-reading them after an edit, and carrying a growing conversation forward on every turn.
Three costs that dominate an agent session
- Re-sent context. Each turn re-sends the conversation, including the files the agent already read. A 20-turn session can pay for the same 30k tokens twenty times.
- File reads. Whole files are cheaper to read than to guess, so agents read them - and then read them again after the edit.
- Retries after a failed patch. The plan, the surrounding code and the error all get re-sent. Failure is the expensive path.
What actually reduces the bill
- Prompt caching, where available. A stable prefix billed at the cache-read rate is the single biggest lever. If your provider does not expose it, that matters more than a few percent of per-token price.
- Smaller context windows per step. Give the agent the file it needs, not the repository.
- Model routing. Summarising a diff or classifying an error does not require a flagship model. Escalate only the step that has to reason.
Practical numbers
| Model | Official (in/out per 1M) | Tapix AI (in/out per 1M) | Below list |
|---|---|---|---|
claude-sonnet-5 | $2 / $10 | $1.4 / $7 | 30% |
claude-opus-5 | $5 / $25 | $3.5 / $17.5 | 30% |
gpt-6.1-terra | $1 / $5 | $0.4299 / $1.45 | 57% |
kimi-k3 | $3 / $15 | $2.4 / $12 | 20% |
deepseek-v4-pro | $0.9553 / $1.91 | $0.7728 / $2.32 | 19% |
About tooling compatibility
Claude Code talks the Anthropic Messages API. An OpenAI-compatible endpoint is not a drop-in replacement for it - translators exist, and some gateways take care of that translation for you. Test the tool-call path before you migrate a workflow, not after.
Prices above come from the live catalogue; the pricing page is the source of truth.
Get $1 free creditSee all models