litellm - ✅(Solved) Fix [Feat] Add `claude-opus-4-7` to model cost map [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25864Fetched 2026-04-17 08:28:32
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
5
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Anthropic announced Claude Opus 4.7 today: https://www.anthropic.com/news/claude-opus-4-7

Pricing remains the same as Opus 4.6: $5 per million input tokens and $25 per million output tokens.

The model is reachable today via the Claude API alias claude-opus-4-7, plus Amazon Bedrock, Vertex AI, and Microsoft Foundry (per the announcement).

Root Cause

Anthropic announced Claude Opus 4.7 today: https://www.anthropic.com/news/claude-opus-4-7

Pricing remains the same as Opus 4.6: $5 per million input tokens and $25 per million output tokens.

The model is reachable today via the Claude API alias claude-opus-4-7, plus Amazon Bedrock, Vertex AI, and Microsoft Foundry (per the announcement).

Fix Action

Fixed

PR fix notes

PR #25865: [Feat] add claude-opus-4-7 to model cost map

Description (problem / solution / changelog)

[Feat] add claude-opus-4-7 to model cost map

Fixes #25864

Anthropic released Claude Opus 4.7 today: https://www.anthropic.com/news/claude-opus-4-7

Pricing remains the same as Opus 4.6: $5 per million input tokens and $25 per million output tokens.

This PR mirrors the shape of #20506 (which introduced claude-opus-4-6):

  • claude-opus-4-7 (litellm_provider anthropic) — field-for-field identical to claude-opus-4-6
  • azure_ai/claude-opus-4-7 (litellm_provider azure_ai) — field-for-field identical to azure_ai/claude-opus-4-6

No dated variant is included, since Anthropic's docs currently publish claude-opus-4-7 as both the ID and the alias (the same pattern as claude-sonnet-4-6). Bedrock / Vertex / regional / Perplexity / OpenRouter variants can follow in separate PRs, matching the 4.6 rollout.

Both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json receive identical additions.

Pre-Submission checklist

  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • JSON files validated with python -m json.tool
  • New entries byte-for-byte field parity with their claude-opus-4-6 counterparts
  • Unit test — deferred: the equivalent PR #20506 for 4.6 landed with JSON-only changes; happy to add a test if reviewers prefer.

Changed files

  • litellm/model_prices_and_context_window_backup.json (modified, +58/-0)
  • model_prices_and_context_window.json (modified, +58/-0)
RAW_BUFFERClick to expand / collapse

Feature request

Add claude-opus-4-7 (and azure_ai/claude-opus-4-7) to model_prices_and_context_window.json so cost tracking works for Anthropic's newly released Opus 4.7 model.

Context

Anthropic announced Claude Opus 4.7 today: https://www.anthropic.com/news/claude-opus-4-7

Pricing remains the same as Opus 4.6: $5 per million input tokens and $25 per million output tokens.

The model is reachable today via the Claude API alias claude-opus-4-7, plus Amazon Bedrock, Vertex AI, and Microsoft Foundry (per the announcement).

Current behavior

claude-opus-4-7 is not present in the cost map, so downstream tools that rely on LiteLLM pricing (e.g. ccusage) report cost as $0 for any usage attributed to this model.

Proposed fix

Mirror the shape of PR #20506 (which introduced claude-opus-4-6):

  • Add "claude-opus-4-7" under litellm_provider: "anthropic" with identical pricing/capability fields to claude-opus-4-6.
  • Add "azure_ai/claude-opus-4-7" under litellm_provider: "azure_ai" with identical fields to azure_ai/claude-opus-4-6.

Bedrock / Vertex / regional / Perplexity / OpenRouter variants can follow in separate PRs (same pattern as the 4.6 rollout).

PR attached.

extent analysis

TL;DR

Add claude-opus-4-7 and azure_ai/claude-opus-4-7 to model_prices_and_context_window.json with pricing identical to claude-opus-4-6 to enable cost tracking for the newly released Opus 4.7 model.

Guidance

  • Verify that the pricing for claude-opus-4-7 is indeed the same as claude-opus-4-6, which is $5 per million input tokens and $25 per million output tokens.
  • Update model_prices_and_context_window.json by adding the proposed entries for claude-opus-4-7 and azure_ai/claude-opus-4-7 with the confirmed pricing.
  • Test downstream tools like ccusage to ensure they report the correct cost for claude-opus-4-7 usage after the update.
  • Consider prioritizing the update for claude-opus-4-7 and azure_ai/claude-opus-4-7 given the immediate need, and plan separate PRs for other variants as suggested.

Example

No code snippet is provided as the issue implies a straightforward update to a JSON file based on the proposed fix.

Notes

The solution assumes that the pricing information provided in the issue is accurate and that adding these entries to model_prices_and_context_window.json will correctly update cost tracking without affecting other models or functionality.

Recommendation

Apply the proposed workaround by adding the necessary entries to model_prices_and_context_window.json as it directly addresses the issue of cost tracking for the Opus 4.7 model and aligns with the pricing structure of its predecessor, Opus 4.6.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Feat] Add `claude-opus-4-7` to model cost map [1 pull requests, 1 participants]