Claude Opus vs Sonnet: what each costs per coding task
Opus 4.8, Opus 5.5, Sonnet 4.6 and Sonnet 5.5 priced on the same modelled PR, bug fix, refactor and migration, at list prices including cache reads and writes.
List prices per million tokens
| Model | Input | Output | Cache write | Cache read |
|---|---|---|---|---|
| Claude Sonnet 4.6 | $3 | $15 | $3.75 | $0.3 |
| Claude Sonnet 5.5 | $2 | $10 | $2.5 | $0.1 |
| Claude Opus 4.8 | $5 | $25 | $6.25 | $0.5 |
| Claude Opus 5.5 | $4 | $20 | $5 | $0.2 |
First-party API list prices as of 2026-11-09. Cache write is the 5-minute write; OpenAI models have no write premium.
Claude Sonnet 4.6 per task
Worked example · modelled, not measured| Task | Calls | Tidy | Messy |
|---|---|---|---|
| pull request | 38 | $1.36 | $1.74 |
| bug fix | 26 | $0.75 | $1.04 |
| refactor | 55 | $2.72 | $3.31 |
| test suite | 44 | $2.11 | $2.61 |
| migration | 80 | $4.74 | $5.52 |
| ticket | 32 | $1.04 | $1.37 |
Claude Sonnet 5.5 per task
Worked example · modelled, not measured| Task | Calls | Tidy | Messy |
|---|---|---|---|
| pull request | 38 | $0.66 | $0.89 |
| bug fix | 26 | $0.38 | $0.55 |
| refactor | 55 | $1.27 | $1.62 |
| test suite | 44 | $1.04 | $1.34 |
| migration | 80 | $2.08 | $2.54 |
| ticket | 32 | $0.52 | $0.72 |
Claude Opus 4.8 per task
Worked example · modelled, not measured| Task | Calls | Tidy | Messy |
|---|---|---|---|
| pull request | 38 | $2.27 | $2.91 |
| bug fix | 26 | $1.26 | $1.73 |
| refactor | 55 | $4.54 | $5.52 |
| test suite | 44 | $3.51 | $4.35 |
| migration | 80 | $7.90 | $9.21 |
| ticket | 32 | $1.73 | $2.28 |
Claude Opus 5.5 per task
Worked example · modelled, not measured| Task | Calls | Tidy | Messy |
|---|---|---|---|
| pull request | 38 | $1.33 | $1.79 |
| bug fix | 26 | $0.77 | $1.11 |
| refactor | 55 | $2.54 | $3.24 |
| test suite | 44 | $2.07 | $2.67 |
| migration | 80 | $4.16 | $5.09 |
| ticket | 32 | $1.03 | $1.43 |
Which one should you use?
Per token, the top tier costs more, but a stronger model can finish in fewer calls and with fewer retry loops, and the number of calls drives the bill. Compare cost per finished task, not per token: itemize a few of your own sessions on each model and look at the receipts side by side.
Itemize your own session
Drop a Claude Code or Codex log. It is parsed in your browser, and you get your real numbers instead of a model.
Drop a session log here
Claude Code ~/.claude/projects/…/*.jsonl, a Codex rollout ~/.codex/sessions/…/rollout-*.jsonl, or the claude-code-action execution file.
Parsed in your browser. Your prompts and code never leave this tab.