Skip to content

Bug: claude-sonnet-5 cost is calculated with stale ($3/$15) pricing instead of its actual ($2/$10) rate #175

Description

@mir-tazbinur-enosis

Summary

The "Cost by Model" breakdown appears to be pricing claude-sonnet-5 usage at the old Sonnet 4.x rate ($3 / MTok input, $15 / MTok output) instead of Sonnet 5's actual, permanent rate ($2 / MTok input, $10 / MTok output). This overstates Sonnet 5's estimated cost by roughly 50%.

Evidence

Row from the dashboard for claude-sonnet-5:

Field Value
Turns 8.4K
Input 75.5K
Output 4.96M
Cache Read 1.99B
Cache Creation 28.81M
Displayed Est. Cost $779.2297

Recomputing with Sonnet 5's official current pricing (per Anthropic's pricing page: $2/MTok input, $2.50/MTok 5-min cache write, $0.20/MTok cache read, $10/MTok output):

Line item Calculation Cost
Input 75,500 × $2 / 1,000,000 $0.15
Output 4,960,000 × $10 / 1,000,000 $49.60
Cache read 1,990,000,000 × $0.20 / 1,000,000 $398.00
Cache creation (5m) 28,810,000 × $2.50 / 1,000,000 $72.03
Total ≈ $519.78

That's a ~$259.45 overcount (~50%) on this row alone.

For comparison, if you apply the old Sonnet 4.x rate ($3/$3.75/$0.30/$15) to the same token counts, you get ≈ $779.67 — which matches the dashboard's displayed value almost exactly. This strongly suggests the cost calculator still has Sonnet 5 mapped to the previous Sonnet pricing tier.

Every other row in the same table (Opus 5, Haiku 4.5, Sonnet 4.6, Opus 4.6) reconciles correctly against their documented per-model rates, so this looks isolated to the claude-sonnet-5 price mapping specifically.

Expected behavior

claude-sonnet-5 usage should be billed/estimated at $2 / MTok input, $2.50 / MTok 5-min cache write, $4 / MTok 1-hour cache write, $0.20 / MTok cache read, $10 / MTok output — its actual, permanent rate (the planned increase to $3/$15 on Sept 1, 2026 was cancelled; $2/$10 is the standing price, not a temporary introductory rate).

Actual behavior

claude-sonnet-5 usage is being priced as if it were still $3 / MTok input, $15 / MTok output.

Suggested fix

Update the pricing table/lookup used by the cost calculator so claude-sonnet-5 (and any alias/model-string variants) maps to the $2/$10 rate rather than falling through to the legacy Sonnet 4.x rate.

Reference

https://platform.claude.com/docs/en/about-claude/pricing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions