How to cut your Claude Code and Claude API bill
An API bill comes down to three numbers: tokens you send, tokens you get back and the model that handles them. Here is how to estimate it up front and where the savings are.
What you pay for
- Input tokens: your prompt, chat history, files and system prompt. Usually the biggest share.
- Output tokens: the model’s reply. Usually several times the input price.
- Cache: a repeated prefix (the same project code, say) costs a fraction when the model caches it.
A worked example
An agent in Claude Code sends about 200 requests a working day, 30,000 input tokens each, and gets 1,500 output tokens back. That is 6M input and 0.3M output tokens a day. Multiply by your model’s prices and 22 working days for the monthly bill. The calculator on the home page does it for you and shows the saving.
Five ways to pay less
- Match the model to the task. Haiku or DeepSeek for small edits and drafts, Sonnet for everyday code, Opus and Fable only for hard architecture.
- Use the cache. Keep the unchanging part of the prompt first so it is served from cache.
- Trim the context. The whole history is sent again with every request. In Claude Code,
/clearbetween tasks helps. - Cap the reply. max_tokens stops the model from rambling.
- Buy tokens for less. On KLINCH the same models cost about a tenth of the official price.
Connection details: Claude API and Claude Code without a Max plan.