Repository navigation
fix(model_prices): registry audit 2026-09-23, in-region Bedrock Claude prices - #42779
Conversation
…e and OpenRouter price fixes Absorbs #42698 Co-authored-by: coldStoneSoul <shekharpachlore@gmail.com> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…on parity Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 similar comment
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…und-trip" This reverts commit c71d5a3.
TLDR
Problem this solves:
How it solves it:
anthropic.claude-*Bedrock entriesUser Flow
Before: an app calling an in-region Bedrock Claude model sees spend about 10% below the AWS invoice
"model": "bedrock/anthropic.claude-sonnet-4-6"After: the same request is billed at the in-region rate, matching the AWS invoice
"model": "bedrock/anthropic.claude-sonnet-4-6"Relevant issues
Fixes #42679
Changes by provider
AWS Bedrock (Anthropic)
Source: https://aws.amazon.com/bedrock/pricing/ (Anthropic tab, "Geo and In-region Cross-region Inference" table; the page is JS rendered, so the table was read in the browser after the curl'd HTML and the r.jina.ai render came back without the model rows). Bare model ids are in-region invocations, so they take the in-region rate. The
global.*keys keep the global rate and theus.*,eu.*,apac.*,jp.*,au.*andus-gov*keys already carried these numbers on mainFields set on each bare key:
input_cost_per_token,output_cost_per_token,cache_creation_input_token_cost(5m cache write),cache_creation_input_token_cost_above_1hr(1h cache write),cache_read_input_token_costanthropic.claude-opus-4-5-20251101-v1:0,anthropic.claude-opus-4-6-v1,anthropic.claude-opus-4-7,anthropic.claude-opus-4-8,anthropic.claude-opus-5: $5.50 / $27.50 / $6.875 / $11.00 / $0.55 per 1Manthropic.claude-sonnet-4-5-20250929-v1:0,anthropic.claude-sonnet-4-6: $3.30 / $16.50 / $4.125 / $6.60 / $0.33anthropic.claude-sonnet-5: $2.20 / $11.00 / $2.75 / $4.40 / $0.22anthropic.claude-haiku-4-5-20251001-v1:0: $1.10 / $5.50 / $1.375 / $2.20 / $0.11, batch $0.55 / $2.75anthropic.claude-fable-5: $11.00 / $55.00 / $13.75 / $22.00 / $1.10anthropic.claude-fable-5-1: $11.00 / $55.00 / $13.75 / $22.00 / $0.275anthropic.claude-opus-5-5: $4.40 / $22.00 / $5.50 / $8.80 / $0.22 (same drift as the rows above, found in this audit)anthropic.claude-sonnet-4-5-20250929-v1:0also gets batch $1.65 / $8.25 and the long context (above 200k) fields set to the same values theus.anthropic.claude-sonnet-4-5-20250929-v1:0entry already carries on main: $6.60 in, $24.75 out, $8.25 / $13.20 cache write, $0.66 cache read. The AWS page lists a "Claude Sonnet 4.5 - Long Context" row but its cells did not resolve in the render, so these come from the long context multiplier Anthropic documents (2x input, 1.5x output over the standard rate, https://docs.anthropic.com/en/docs/about-claude/pricing) applied to the in-region rate. Called out under caveatsAbsorbed from #41775 is nothing, see below. Absorbed from #42698 (co-authored): the 11 bare-key price changes listed above, every value re-read from the AWS table and matching the PR. Greptile's finding on that PR (long context rates left at global) is addressed here
OpenRouter
This audit also corrected
openrouter/deepseek/deepseek-v4-flashandopenrouter/z-ai/glm-5.3from GET https://openrouter.ai/api/v1/models, but #42832 landed the same sync on main first (with a newer deepseek-v4-flash price that matches the live API), so after merging main those rows carry main's values and are no longer part of this diffChecked, no change needed
gpt-5-codex,gpt-5.1-codex*,gpt-5.2-codex,o3-deep-research,o4-mini-deep-researchand the*-chat-latestaliases, which chore(cost-map): remove models past their deprecation date #42435 removed as past their deprecation date; not re-added since deprecation handling belongs to that automationclaude-opus-4-1,claude-opus-4,claude-sonnet-4,claude-3-5-haiku, removed by chore(cost-map): remove models past their deprecation date #42435 for the same reason*-latestaliases identical to their dated entriesdeepseek-flashanddeepseek-v4-promatch the peak rates?serverlesscatalog thatscripts/sync_together_ai_models.pytracks, so they are left to that syncNot changed, could not verify
llama-3.1-8b-instant,llama-3.3-70b-versatile,minimaxai/minimax-m2.7: https://console.groq.com/docs/models lists them as Enterprise "Contact Sales", no per-token pricecommand-a-vision-07-2025,command-a-reasoning-08-2025,command-a-translate-08-2025: listed at https://docs.cohere.com/docs/models but https://cohere.com/pricing publishes no per-token price for themgpt-image-2.5-sunburst,gpt-image-2.5-flare,gpt-rosalind-research: on the pricing page but not in the models API, skipped this runOpen registry PRs left alone
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Tests added or changed in
tests/test_litellm/test_utils.py:test_bedrock_bare_claude_id_is_priced_in_region(new, 12 cases): each bareanthropic.claude-*key matches itsus.profile on every cost field (input, output, 5m and 1h cache write, cache read, batch, above 200k) and is priced above itsglobal.profiletest_get_model_info_bedrock_regional_inference_profile_pricing(LIT-4056): probedau.anthropic.claude-opus-4-8vs the bare id and asserted regional > bare, which only held while the bare id carried the global rate. Repointed ateu.amazon.nova-pro-v1:0vsamazon.nova-pro-v1:0, where the regional row still costs more; thebedrock/,bedrock/converse/,bedrock/invoke/key resolution assertions are unchangedLocal checks at the tip:
LITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync pytest -q tests/test_litellm/test_utils.py -k "bare_claude or regional_inference_profile"reports 13 passed,python3 ci_cd/check_files_match.pypasses andLITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync pytest -q tests/test_litellm/test_model_prices_schema.py tests/test_litellm/test_model_cost_aliases.pyreports 73 passed.ci_cd/generate_model_prices_schema.pyproduced no schema changeType
🐛 Bug Fix
Caveats (if any)
Medium
Low
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/2de281eeae484d7e92904c8feaa36330
Open in Devin Desktop: https://app.devin.ai/desktop/session/2de281eeae484d7e92904c8feaa36330?variant=devin