Anthropic API Billing Bug: Sonnet Model Charged at Opus Rates

Bug Details
A significant billing discrepancy has been identified in the Anthropic API for the claude-sonnet-4-6 model. While the API correctly reports the model as Sonnet in the response, the actual billing calculation uses Opus pricing, resulting in higher charges than expected.
Evidence from Raw Event Data
The bug was discovered through analysis of a high-token request with heavy prompt caching. The specific data points from the raw event are:
- Reported Model: claude-sonnet-4-6
- Input Tokens: 6
- Output Tokens: 4,034
- Cache Creation (Write): 61,920 tokens
- Cache Read: 171,391 tokens
- Billed totalCostUsd: $0.5735755
The user noted that this total cost matches exactly what would be expected for Opus pricing, not Sonnet pricing, creating a significant cost difference for API users.
Impact and Context
This bug affects developers using the Anthropic Claude API with the Sonnet model. Since Opus is Anthropic's most expensive model tier, this discrepancy could result in substantially higher costs than anticipated. The bug appears to be in the billing calculation logic rather than the model selection itself, as the API correctly identifies the model as Sonnet in responses.
For developers monitoring API costs, this means current billing reports may be inaccurate for Sonnet usage. The issue was reported on the ClaudeAI subreddit where users are discussing potential workarounds and monitoring for an official fix from Anthropic.
📖 Read the full source: r/ClaudeAI
👀 See Also

Claude Code v2.1.98 adds Vertex AI wizard, security fixes, and subprocess sandboxing
Claude Code v2.1.98 introduces an interactive Google Vertex AI setup wizard, adds subprocess sandboxing with PID namespace isolation on Linux, and fixes multiple security vulnerabilities including Bash permission bypasses and arbitrary code execution risks.

M5 Max vs M3 Max Inference Benchmarks for Qwen Models on oMLX
Benchmarks comparing M5 Max and M3 Max MacBook Pros running Qwen 3.5 models via oMLX v0.2.23 show M5 Max delivering 1.4-1.7x faster token generation and up to 4x faster prefill at long contexts.

Reddit discussion highlights 68% token reduction for AI agents through infrastructure changes
A Reddit user reports cutting AI agent token usage by 68.5% by switching from standard infrastructure to an agent-native OS with JSON-native state access, reducing state checks from ~9 shell commands to 1 structured call.

Anthropic Pauses Claude Agent SDK Credit Change After User Feedback
Anthropic emailed users today to say they are pausing the planned change that would move Agent SDK, claude-p, and third-party apps to a dedicated monthly credit instead of drawing from subscription rate limits.