fix(pricing): April 2026 drift — Opus 3× over-billing + 11 missing models#336
Merged
Conversation
…DeepSeek-V4 Static pricing table reflected pre-2026 rates. This caused silent over-billing (Opus 4.6/4.7 at $15/$75 instead of $5/$25 since 4.6 shipped), under-billing (Gemini 2.5 Pro output at $5/M instead of $10/M), and complete fallback miss for models with no row at all (GPT-5/5.5, DeepSeek V4, Grok 4.1, Mercury 2). Critical corrections: - claude-opus-4-7 (added at $5/$25) - claude-opus-4-6: $15/$75 → $5/$25 - claude-haiku-4-5: $0.80/$4 → $1/$5 - MiniMax-M2.5: $0.30/$1.20 → $0.15/$0.95 - gemini-2.5-pro: $1.25/$5 → $1.25/$10 - deepseek-chat/reasoner: rerouted to V4-Flash rates ($0.14/$0.28) New entries: - OpenAI: gpt-5, gpt-5.5, gpt-5.5-pro, o1/o1-mini, o3/o3-mini, gpt-oss-20b/120b - DeepSeek: deepseek-v4-flash, deepseek-v4-pro - Z.ai: glm-4.5-flash - MiniMax: M2.7 - Llama: llama-4-scout-17b (Groq free) - Inception: mercury-2 ($0.25/$0.75, supersedes mercury-coder-small) - xAI: grok-4.1-fast - Anthropic: claude-sonnet-4-7 Reasoning-token 3× surcharge (o-series) deferred to follow-up PR introducing CostInputs + cache_read/creation multipliers. Test asserts and one upstream test in features::token_pricing updated to reflect the corrected Opus rates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Static pricing table reflected pre-2026 rates. This caused silent 3× over-billing on Anthropic Opus (4.6 onwards), 2× over-billing on MiniMax M2.5, 2× under-billing on Gemini 2.5 Pro output, and complete fallback miss for models without a row (GPT-5/5.5, DeepSeek V4, Grok 4.1, Mercury 2 —
pricing()returnedNone, breaking spend tracking entirely).Critical corrections
New entries (were returning
None)Deferred
Reasoning-token 3× surcharge for o-series models requires a
CostInputsstruct and is deferred to a follow-up PR that also wires cache_read/cache_creation multipliers (Anthropic prompt cache revenue leak).Test plan
cargo test --lib pricing— 17 new test cases for corrections + new entriescargo test --lib --tests— 263 passed, 0 failedcargo test --doc pricing— 2 doctests passcargo test --test lib enterprise::— 87 passedcargo clippy --lib -- -D warnings— clean🤖 Generated with Claude Code