[BUG] claude-sonnet-5 reported cost inflated exactly 1.5x — CLI pricing table uses $3/$15 instead of the (now permanent) $2/$10 first-party rates

Status Open
Reported on v2.1.197
Maintainer reply None cached
Activity 0 comments · opened Aug 19, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The CLI's internal pricing table prices claude-sonnet-5 at $3 / $15 per MTok (with proportionally scaled cache rates) for first-party API usage, while the API actually bills $2 / $10. As a result, the CLI-reported values — total_cost_usd, modelUsage[].costUSD, and /cost — are inflated exactly 1.5x for every Sonnet 5 session. Actual billing is unaffected; this is a reporting bug.

$3/$15 was the standard price originally scheduled for September 1, 2026, after the introductory period. Two problems with hardcoding this rate:

  1. It was applied during the introductory period (observed 2026-08-18, before Aug 31) — the CLI's own CHANGELOG for 2.1.197 states "promotional pricing of $2/$10 per Mtok through August 31".
  2. Anthropic announced on 2026-08-10 that the introductory pricing is now permanent and the increase will not occur (also noted on the pricing page).

What Should Happen?

The CLI's cost reporting for claude-sonnet-5 first-party usage should use the permanent $2/$10 rates (with standard cache multipliers), so reported costs match actual billing.

Steps to Reproduce

  1. Run claude -p "1+1?" --model claude-sonnet-5 --output-format json
  2. From modelUsage["claude-sonnet-5"] in the output, compute (inputTokens×2 + outputTokens×10 + cacheCreationInputTokens×2.5 + cacheReadInputTokens×0.2) / 1e6 (for 1-hour cache writes, use ×4 instead of ×2.5)
  3. costUSD does not match — it matches the same formula with $3/$15 rates (×3, ×15, ×3.75, ×0.3) instead

Observed data

Real session (Claude Code 2.1.228, first-party API), modelUsage["claude-sonnet-5"]:

| field | value |
|---|---|
| inputTokens | 26 |
| outputTokens | 22,349 |
| cacheCreationInputTokens | 137,441 |
| cacheReadInputTokens | 385,474 |
| reported costUSD | 0.9663589499999999 |

  • At $3/$15: (26×3 + 22,349×15 + 137,441×3.75 + 385,474×0.3) / 1e6 = 0.96635895 → matches exactly
  • At $2/$10 (actual billing): 0.6442393 → what should have been reported

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Claude Code Version

2.1.235 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Non-interactive/CI environment

Additional Information

Also reproduced on 2.1.228 (linux-x64, bundled in claude-code-action v1.0.191, 2026-08-18). Sonnet 5 support was added in 2.1.197. Related but distinct: #77095 reports Sonnet 5 costs on Vertex AI matching Opus-tier rates — a separate rate-table error.

View original on GitHub ↗