feat(anthropic): add Claude 5 family pricing & align current rates#1767
Merged
chopratejas merged 1 commit intoJul 3, 2026
Merged
Conversation
Add metadata for the Claude 5 generation and correct the Claude 4.x / Haiku 4.5 rates to Anthropic's current published pricing (platform.claude.com/docs/en/about-claude/pricing, 2026-07-04): - claude-fable-5: 1M context, $10 in / $50 out / $1 cache-read - claude-opus-4-8: 1M context, $5 in / $25 out / $0.50 cache-read - claude-sonnet-5: 1M context, $3 in / $15 out / $0.30 cache-read - Opus 4.5-4.8 aligned to the current Opus tier ($5/$25/$0.50) - Sonnet 4.5/4.6 pinned to the Sonnet tier ($3/$15/$0.30) - Haiku 4.5 corrected to $1/$5/$0.10 - opus pattern-default fallback aligned to the current Opus tier Update the provider and fallback-model tests to pin the new values so the provider-specific and generic fallback suites agree (addresses CI red on stale $15/$75 Opus assertions and the $22.5 estimate fixture).
Contributor
PR governanceThis PR does not yet satisfy the required template fields:
Please update the PR body, or move the PR back to draft while it is still in progress. |
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
Adds Claude 5 generation metadata and aligns the Anthropic fallback pricing / context-limit tables in
headroom/providers/anthropic.pywith current Anthropic pricing (verified 2026-07-04). Several Claude 4.x entries carried stale rates, the new Claude 5 models (Fable 5, Opus 4.8, Sonnet 5) had no metadata, and the generic fallback tests disagreed with the provider tests.Supersedes #1485 (rebased onto latest
main, squashed to one commit, extended with Sonnet 5 / Fable 5 and the requested fallback-test fixes).Changes
All values
$ / MTok;cached_input= prompt-cache read = 0.1× input.claude-fable-5claude-opus-4-8claude-opus-4-7claude-opus-4-6claude-opus-4-5-20251101claude-sonnet-5claude-sonnet-4-6claude-sonnet-4-5claude-haiku-4-5-20251001claude-sonnet-4-20250514and all Claude 3.x / 3.5.x entries were already correct — left unchanged.The 1M-context entries (Fable 5, Opus 4.8, Sonnet 5, Sonnet 4.6) are functional, not cosmetic: they ship in the long-context tier, and without explicit entries the
sonnet/opuspattern defaults would report 200K.Sonnet 5 is pinned to the standard Sonnet tier ($3 / $15 / $0.30); Anthropic's introductory rate ($2 / $10 through Aug 31 2026) is intentionally not encoded to avoid a time-dependent fixture.
Fallback-model tests (addresses review on #1485)
_PATTERN_DEFAULTS["opus"]is aligned to the current Opus tier ($5 / $25 / $0.50) so the generic fallback suite and the provider-specific suite agree:test_pricing_for_known_models— Opus 4.5 pins $5 / $25 / $0.50test_pattern_based_inference_opus— unknown-opus fallback now $5 / $25test_cost_estimation_for_new_models— fixture estimate corrected $22.5 → $7.5test_pattern_based_inference_sonnet— retargeted toclaude-sonnet-6-*(the oldclaude-sonnet-5-*probe now prefix-matches the realclaude-sonnet-5key)New provider coverage:
test_get_context_limit_claude_5_family— Fable 5 / Opus 4.8 / Sonnet 5 all 1Mtest_pricing_claude_5_family— exact rate table for the 3 new modelsFull suite: 48 passed.
Source
https://platform.claude.com/docs/en/about-claude/pricing