Cost price-map wrong in CLI 2.1.159: claude-opus-4-8 billed 3× high, claude-sonnet-4-5 1.67× high

Resolved 💬 3 comments Opened Jun 2, 2026 by kpiotr Closed Jun 25, 2026

CLI: 2.1.159 (also reproduced on 2.1.156; no pricing-map change in the 2.1.157–2.1.160 changelogs). Auth: Anthropic API (first-party — not Bedrock/Vertex).

The CLI's embedded cost price-map has wrong entries for two current models, so total_cost_usd, modelUsage[].costUSD, the /cost display, and OTel cost metrics over-report spend on them. Actual API billing is correct — only the reported number is wrong.

| Model | CLI charges (in / out / cacheRead / cacheWrite, per Mtok) | Published | Status |
| --- | --- | --- | --- |
| claude-opus-4-8 | $15 / $75 / $1.50 / $18.75 | $5 / $25 / $0.50 / $6.25 | 3.00× over |
| claude-sonnet-4-5 | $5 / $25 / $0.50 / $6.25 | $3 / $15 / $0.30 / $3.75 | 1.67× over |
| claude-opus-4-6 | $5 / $25 / $0.50 / $6.25 | $5 / $25 / $0.50 / $6.25 | correct |
| claude-haiku-4-5 | $1 / $5 / $0.10 / $1.25 | $1 / $5 / $0.10 / $1.25 | correct |

claude-opus-4-8 is getting the pre-4.5 legacy Opus rate; claude-sonnet-4-5 is getting the Opus rate instead of the Sonnet rate. Opus 4.6/4.7 and Haiku 4.5 are mapped correctly.

Confirmed against the billing console

For a run the billing console billed claude-opus-4-8 at $1.77, the CLI reported costUSD $5.32 for that model — exactly 3.00×.

Repro — per-model usage from one result message

modelUsage["claude-opus-4-8"]            = { inputTokens: 4226, outputTokens: 10815,
                                             cacheReadInputTokens: 1045838,
                                             cacheCreationInputTokens: 153229, costUSD: 5.316 }
modelUsage["claude-sonnet-4-5-20250929"] = { inputTokens: 26, outputTokens: 2755,
                                             cacheReadInputTokens: 106836,
                                             cacheCreationInputTokens: 53261, costUSD: 0.455 }

Backing the implied input rate out of each via the standard 1 : 5 : 0.1 : 1.25
weighting gives $15.0/Mtok for claude-opus-4-8 (should be $5) and $5.0/Mtok
for claude-sonnet-4-5 (should be $3).

Impact

Every consumer of total_cost_usd / modelUsage[].costUSD over-reports spend on
these two models — /cost and session cost, OTel cost-by-model, and SDK result
messages. Actual billing is unaffected.

Suggested fix

Correct the embedded price-map entries:

  • claude-opus-4-8$5 / $25 / $0.50 / $6.25 per Mtok (match 4.6/4.7).
  • claude-sonnet-4-5$3 / $15 / $0.30 / $3.75 per Mtok (standard Sonnet rate).

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗