Skip to content

feat(models): add missing openrouter Claude entries (sonnet-5, opus-4.8/-fast, opus-4.7-fast, fable-5) - #33069

Closed
sushantlokhande14 wants to merge 1 commit into
BerriAI:mainfrom
sushantlokhande14:feat/openrouter-claude-5-family-catalog
Closed

sushantlokhande14 wants to merge 1 commit into
BerriAI:mainfrom
sushantlokhande14:feat/openrouter-claude-5-family-catalog

Conversation

@sushantlokhande14

Copy link
Copy Markdown

Relevant issues

Fixes #33068

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests (data-only catalog addition — every value verified against OpenRouter's live API below; both files re-parsed as valid JSON)
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

OpenRouter serves five Claude models that had no openrouter/* catalog entry, so litellm resolved no pricing or token limits for them (cost tracking silently empty; get_model_info() raises). This PR adds them.

Live OpenRouter data (source of every value in the new entries):

$ curl -s https://openrouter.ai/api/v1/models | jq '.data[] | select(.id | startswith("anthropic/claude")) | select(.id | test("sonnet-5|opus-4.8|opus-4.7-fast|fable")) | {id, ctx: .context_length, max_out: .top_provider.max_completion_tokens, prompt: .pricing.prompt, completion: .pricing.completion, cache_read: .pricing.input_cache_read, cache_write: .pricing.input_cache_write}'
{"id":"anthropic/claude-fable-5","ctx":1000000,"max_out":128000,"prompt":"0.00001","completion":"0.00005","cache_read":"0.000001","cache_write":"0.0000125"}
{"id":"anthropic/claude-opus-4.7-fast","ctx":1000000,"max_out":128000,"prompt":"0.00003","completion":"0.00015","cache_read":"0.000003","cache_write":"0.0000375"}
{"id":"anthropic/claude-opus-4.8","ctx":1000000,"max_out":128000,"prompt":"0.000005","completion":"0.000025","cache_read":"0.0000005","cache_write":"0.00000625"}
{"id":"anthropic/claude-opus-4.8-fast","ctx":1000000,"max_out":128000,"prompt":"0.00001","completion":"0.00005","cache_read":"0.000001","cache_write":"0.0000125"}
{"id":"anthropic/claude-sonnet-5","ctx":1000000,"max_out":128000,"prompt":"0.000002","completion":"0.00001","cache_read":"0.0000002","cache_write":"0.0000025"}

Cross-check: the non-fast prices match this catalog's existing first-party claude-sonnet-5, claude-opus-4-8, and claude-fable-5 entries exactly (OpenRouter passes Anthropic pricing through 1:1).

Before/after:

import litellm
# before: raises "model isn't mapped" for all five
litellm.get_model_info("openrouter/anthropic/claude-sonnet-5")
# after (this branch):
litellm.get_model_info("openrouter/anthropic/claude-sonnet-5")["max_output_tokens"]  # 128000
litellm.get_model_info("openrouter/anthropic/claude-opus-4.8")["input_cost_per_token"]  # 5e-06

Entry schema mirrors the existing openrouter/anthropic/claude-opus-4.7 entry (same capability flags; supports_assistant_prefill: false since prefill is removed on the 4.7+/5 family), each with a source link to its OpenRouter model page. Pure additions: +120/−0 in each of model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json, inserted in alphabetical key order; both files parse as valid JSON.

Type

🆕 New Feature (model catalog addition)

Changes

New catalog entries (root + backup, identical):

  • openrouter/anthropic/claude-sonnet-5
  • openrouter/anthropic/claude-opus-4.8
  • openrouter/anthropic/claude-opus-4.8-fast
  • openrouter/anthropic/claude-opus-4.7-fast
  • openrouter/anthropic/claude-fable-5

….8/-fast, opus-4.7-fast, fable-5)

OpenRouter serves these five models but the catalog had no openrouter/*
entries for them, so litellm resolved no pricing or token limits.
Entries mirror the existing openrouter/anthropic/claude-opus-4.7 schema
with limits and pricing from OpenRouter's /api/v1/models (which match
the catalog's first-party anthropic entries for the same models).

Backup catalog updated identically.

Fixes BerriAI#33068
@sushantlokhande14

Copy link
Copy Markdown
Author

@greptileai

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds five missing openrouter/anthropic Claude model entries to both catalog JSON files (claude-sonnet-5, claude-opus-4.8, claude-opus-4.8-fast, claude-opus-4.7-fast, claude-fable-5), fixing a gap where get_model_info() raised for these models and cost tracking returned nothing. All pricing values are sourced from OpenRouter's live API and cross-checked against the existing first-party entries.

  • Both model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json receive identical additions and remain valid JSON.
  • All five entries follow the same schema as the existing openrouter/anthropic/claude-opus-4.7 entry, with the addition of a source URL field.
  • The PR description claims entries are inserted "in alphabetical key order," but the actual insertion positions in the file do not maintain alphabetical order (e.g., claude-fable-5 lands before claude-3.5-sonnet); this is functionally harmless since the JSON is read as a dict, and the surrounding pre-existing entries were already out of order.

Confidence Score: 4/5

Safe to merge; purely additive catalog data with no code changes and both JSON files kept in sync.

The change is a straightforward data addition. Prices for all five models match what OpenRouter's live API returns, schemas mirror existing entries, and both catalog files are identical. The only item worth a second look before merging is the claude-opus-4.7-fast price being 6× the non-fast version — unusual enough to warrant a quick recheck against OpenRouter to confirm no temporary mis-listing.

The claude-opus-4.7-fast entry in both catalog files deserves a spot-check to confirm the $30/M input price is stable on OpenRouter before merging.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds 5 new openrouter/anthropic Claude catalog entries (claude-sonnet-5, claude-opus-4.8, claude-opus-4.8-fast, claude-opus-4.7-fast, claude-fable-5) with pricing verified from OpenRouter's live API; the insertion positions are not strictly alphabetical despite the PR's claim.
litellm/model_prices_and_context_window_backup.json Identical 5 new catalog entries as model_prices_and_context_window.json; both files are kept in sync correctly.

Reviews (1): Last reviewed commit: "feat(models): add missing openrouter Cla..." | Re-trigger Greptile

Comment on lines 28789 to +28818
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
},
"openrouter/anthropic/claude-opus-4.7-fast": {
"supports_adaptive_thinking": true,
"cache_creation_input_token_cost": 3.75e-05,
"cache_read_input_token_cost": 3e-06,
"input_cost_per_token": 3e-05,
"litellm_provider": "openrouter",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 0.00015,
"source": "https://openrouter.ai/anthropic/claude-opus-4.7-fast",
"supports_assistant_prefill": false,
"supports_computer_use": true,
"supports_function_calling": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
},
"openrouter/anthropic/claude-opus-4.8": {
"supports_adaptive_thinking": true,
"cache_creation_input_token_cost": 6.25e-06,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 claude-opus-4.7-fast pricing is 6× higher than the non-fast counterpart

openrouter/anthropic/claude-opus-4.7 is priced at input_cost_per_token: 5e-06 ($5/M), while claude-opus-4.7-fast is 3e-05 ($30/M) — six times more expensive. For reference, claude-opus-4.8-fast is only 2× its non-fast sibling. The PR's curl output confirms this is what OpenRouter reports today, but given how unusual the pattern is (a "fast" variant costing 6× the base), it's worth double-checking that OpenRouter hasn't temporarily mis-listed these prices, to avoid users being silently overcharged on cost tracking.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fills in five missing OpenRouter catalog entries so that get_model_info() and cost-tracking work correctly for those models. All pricing values were verified against OpenRouter's live /api/v1/models endpoint and match the first-party Anthropic entries exactly; capability flags mirror the existing openrouter/anthropic/claude-opus-4.7 template.

  • Adds openrouter/anthropic/claude-fable-5, claude-sonnet-5, claude-opus-4.7-fast, claude-opus-4.8, and claude-opus-4.8-fast to both model_prices_and_context_window.json and its backup, keeping both files in sync.
  • Each new entry includes supports_assistant_prefill: false (correct for the 4.7+/5 reasoning family), full cache pricing, and a source URL linking to the OpenRouter model page.

Confidence Score: 5/5

Pure catalog addition — no logic changes, no regressions possible.

All five new entries carry pricing values that match OpenRouter's live API output (as reproduced in the PR description), capability flags that follow the established openrouter/anthropic pattern, and both the primary and backup JSON files are kept in sync. There are no code changes, no test modifications, and no schema violations.

No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds 5 new openrouter/anthropic entries (claude-fable-5, claude-sonnet-5, claude-opus-4.7-fast, claude-opus-4.8, claude-opus-4.8-fast) with pricing verified against OpenRouter's live API and capability flags consistent with the existing claude-opus-4.7 openrouter template.
litellm/model_prices_and_context_window_backup.json Backup copy of the catalog; identical additions to the primary file — all 5 new entries present and fully in sync.

Reviews (2): Last reviewed commit: "feat(models): add missing openrouter Cla..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing sushantlokhande14:feat/openrouter-claude-5-family-catalog (ee045c7) with main (10d5804)

Open in CodSpeed

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant