Add Claude Opus 5.5 pricing and Opus fast-mode rates - #260
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe model registry adds Claude Opus 5.5 with standard and Priority pricing. It adds Priority pricing for four existing Opus models, aliases for Opus 5.5, and tests for pricing isolation, alias resolution, and model distinction. ChangesClaude Opus pricing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to Claude Opus 5.5 and Priority usage will receive the new pricing, while existing standard pricing and fallback behavior remain unchanged. No merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the rates tonight Comment |
Why
Claude Opus 5.5 is not announced yet, but it already ships in the model catalog embedded in Claude Code 2.1.280, which means real usage rows carrying
claude-opus-5-5can start appearing in transcripts the moment Anthropic flips the switch. Without an entry here those rows fall through to the unknown-model path and are priced at zero, so a user's most expensive model would silently contribute nothing to their totals on launch day.Opus 5.5 is also the first Opus that gets cheaper than its predecessor — $4/$20 against Opus 5's $5/$25 — so the usual "assume the new Opus costs at least as much as the old one" instinct produces an over-count rather than a safe under-count.
While adding it, the same catalog turned out to carry a complete rate card for Anthropic's
speed: "fast"request option on five Opus models. Splitrail's Piebald analyzer already resolves a"fast"service-tier label toServiceTier::Priority, but no Claude model had aPriorityentry, so every fast-mode row was being billed at standard rates. This PR closes that for the whole family at once rather than leaving four siblings inconsistent with the newest model.What changed
claude-opus-5-5at $4.00/MTok input, $20.00/MTok output, $5.00/MTok cache write, $0.20/MTok cache read.claude-opus-5.5,claude-5.5-opus, the bare mantle IDanthropic.claude-opus-5-5, and all seven Bedrock cross-region forms (us,eu,apac,jp,au,us-gov,global). Model lookup is exact-match with no prefix stripping beyond/, so each spelling needs its own entry.ServiceTier::Priorityrate cards forclaude-opus-5-5,claude-opus-5,claude-opus-4-8,claude-opus-4-7, andclaude-opus-4-6, covering Anthropic'sspeed: "fast"option.Priorityentries do not perturb standard pricing.Cache read is 1/20th of input, not 1/10th
Opus 5.5's vendor pricing tier is named
tier_4_20_cache_read_0_20rather than a plaintier_4_20, because its cache-read rate breaks the ratio every other Claude entry in this file follows:claude-opus-5claude-sonnet-5claude-opus-5-5The test asserts $5.20 for 1M cache writes plus 1M cache reads specifically so that a future change re-deriving cache read from input lands on $5.40 and fails loudly.
Fast-mode multipliers are not uniform
Each of the five cards scales every one of its five components by a single factor, but the factor differs by model:
claude-opus-5-5claude-opus-5claude-opus-4-8claude-opus-4-7claude-opus-4-6The cards are written out per model rather than derived from a multiplier, and both the code comment and the test say why: collapsing this into one factor would misprice fast usage on 4.6/4.7 by 3x.
Compatibility
Standard pricing for every existing model is untouched; the diff adds entries and never edits an existing rate.
pricing_for_service_tierfalls back to standard pricing when a model has no entry for the requested tier, so models without a fast rate card — includingclaude-opus-4-5and every non-Opus Claude model — keep their current behavior. A test asserts that fallback explicitly.The Claude Code analyzer prices every row at
ServiceTier::Standardand is unaffected by thePriorityadditions. Only the Piebald analyzer, which reads a service-tier label from its source data, can select them.Provenance
Opus 5.5 is not on https://docs.claude.com/en/docs/about-claude/pricing yet, so the
// Source:marker that #258 established for the Anthropic section does not cover it. Both new blocks carry their own marker naming the Claude Code 2.1.280 catalog as the source, with a note to move the entry under the section source once the public page lists it.is_estimatedisfalse: these are the exact rates Claude Code itself bills against, not an approximation. If Anthropic publishes different numbers at launch, the fix is the four constants in the model entry plus the matching test values.Out of scope
[1m]long-context suffix handling. Opus 5.5 has a 1M-token native context window, but Splitrail does not currently parse the[1m]model-name suffix for any model, and the vendor catalog lists a single flat tier for Opus 5.5 with no above-200K premium.claude-opus-5-5bare on every provider, matching the Opus 5 / Sonnet 5 / Opus 4.8 convention rather than the datedclaude-haiku-4-5-20251001style, so no launch-date spelling is invented here.Validation
cargo build --quietcargo test --quietcargo clippy --quiet --all-targets -- -D warningscargo doc --quiet --no-depscargo fmt --all --quietSummary by CodeRabbit