python3 <(curl -sL https://raw.githubusercontent.com/jriso/claude-code-cost/main/cost.py)
Run this on the machine where you use Claude Code.
~/.claude/projects/. Each assistant message includes a usage object — the same one Anthropic's API returns for billing. This tool scans those files and aggregates by model, deduplicating by requestId.cache_read_input_tokens but increasing output_tokens. Naively summing overcounts by ~1.5x. We keep the last event per requestId.| Model | Input | Output | Cache Read | CW 5m | CW 1h |
|---|---|---|---|---|---|
| Opus 4.6 | $5 | $25 | $0.50 | $6.25 | $10 |
| Sonnet 4.6 | $3 | $15 | $0.30 | $3.75 | $6 |
| Haiku 4.5 | $1 | $5 | $0.10 | $1.25 | $2 |
| Opus 4.5 | $5 | $25 | $0.50 | $6.25 | $10 |
| Opus 4.1 | $15 | $75 | $1.50 | $18.75 | $30 |
| Sonnet 4.5 | $3 | $15 | $0.30 | $3.75 | $6 |
| Sonnet 4 | $3 | $15 | $0.30 | $3.75 | $6 |
| Opus 4 | $15 | $75 | $1.50 | $18.75 | $30 |
| Haiku 3.5 | $0.80 | $4 | $0.08 | $1 | $1.60 |
| Haiku 3 | $0.25 | $1.25 | $0.03 | $0.30 | $0.50 |
| Opus 3 | $15 | $75 | $1.50 | $18.75 | $30 |
| Sonnet 3.5v2 | $3 | $15 | $0.30 | $3.75 | $6 |
| Sonnet 3.5 | $3 | $15 | $0.30 | $3.75 | $6 |