Claude Code Billing Explained: Four Token Types and Cache Timing Drive Your Costs

Claude Code charges developers across four token categories — input, output, cache write, and cache read — each priced differently, with output tokens costing roughly five times more than input tokens. Cache read tokens are the cheapest at one-tenth the base input rate, making prompt caching essential for cost efficiency on large codebases. Two cache durations exist: a 5-minute TTL for API key users and a 1-hour TTL for Pro/Max subscribers, with the longer TTL costing 60% more to write but offering greater savings for sessions with natural pauses. Allowing the cache to expire mid-session triggers a full rewrite that can cost up to 20 times more than a simple cache hit, and actions like switching models, running /compact, or toggling plugins also reset the cache. Developers can reduce unexpected costs by enabling finish notifications and monitoring the live status line to stay within their cache window.
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