Repository navigation
fix(model_prices): registry audit 2026-09-10, absorb open pricing PRs - #40581
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR updates model registry metadata and regression coverage to align billing and reasoning-effort validation with current provider behavior.
Confidence Score: 5/5The PR appears safe to merge with no outstanding correctness, security, or repository-rule issues. The new Jina test exercises the actual rerank billing path and verifies the corrected total-token charge, while the registry and GPT-5 test updates consistently encode the intended provider behavior. The previous Jina coverage thread is resolved and no new actionable failures remain.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Corrects Jina pricing, adds GPT-5.6 Sol metadata, and updates GPT-5 reasoning capability flags. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary model registry changes without divergence. |
| tests/test_litellm/llms/openai/test_gpt5_transformation.py | Updates reasoning-effort tests to verify rejection or dropping of unsupported minimal effort. |
| tests/test_litellm/test_cost_calculator.py | Adds a focused behavioral test for Jina input-only rerank billing. |
| litellm/llms/jina_ai/rerank/transformation.py | Removes a stale hardcoded pricing docstring while retaining existing input-only cost behavior. |
Reviews (3): Last reviewed commit: "test(cost): assert jina rerank spend at ..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 996ca7c. Configure here.
c1a83fc
into
litellm_internal_staging
TLDR
Problem this solves:
openrouter/openai/gpt-5.6-solmissing from the catalogminimaleffort, OpenAI lists no such levelHow it solves it:
minimalflip to dated snapshots, gpt-5.2 and gpt-5.4-prominimaldropped or rejected for those modelsThis is the rolling registry PR for the 2026-09-10 audit run. No older open Devin registry PR existed, so this one was opened fresh
User Flow
Before: a gateway user is billed the wrong amount for Jina reranking, cannot add GPT-5.6 Sol via OpenRouter, and sends
minimalto a model that rejects it"model": "jina-reranker-v2-base-multilingual"and 1,000 query plus document tokens, and the logs page at https://litellm-domain/ui/?page=logs shows $0.000036 spend (input and output both charged at $0.018/M)openrouter/openai/gpt-5.6-sol, and get no match"model": "gpt-5.4", "reasoning_effort": "minimal"anddrop_paramson, and the gateway forwardsminimalunchanged, so OpenAI returns a 400 about an unsupported reasoning effortAfter: spend matches the Jina invoice, GPT-5.6 Sol is selectable, and
minimalis dropped before it reaches OpenAIopenrouter/openai/gpt-5.6-solwith a 1,050,000 token window and $2/M in, $10/M outdrop_paramson hasreasoning_effortremoved and returns 200; withoutdrop_paramsthe gateway returns a 400 naming the unsupportedminimallevel before calling OpenAIRelevant issues
Fixes #40102
Fixes #40473
Supersedes #40569, #40183 and #40547 (their registry changes are carried here)
Supports #26900
Linear ticket
Sources for every changed value
Jina
jina-reranker-v2-base-multilingual(input 5e-08, output 0.0,source): https://api.jina.ai/v1/models returns"pricing": {"prompt": "0.00000005", "completion": "0"}forjina-ai/jina-reranker-v2-base-multilingualOpenRouter
openrouter/openai/gpt-5.6-sol(all 25 fields): https://openrouter.ai/api/v1/models entryopenai/gpt-5.6-sol:context_length: 1050000,top_provider.max_completion_tokens: 128000,pricing.prompt 0.000002 / completion 0.00001 / input_cache_read 0.0000002 / input_cache_write 0.0000025, override atmin_prompt_tokens: 272000withprompt 0.000004 / completion 0.000015 / input_cache_read 0.0000004 / input_cache_write 0.000005,input_modalities ["file","image","text"],supported_parametersincludetools,tool_choice,structured_outputs,reasoning_effort. Human page: https://openrouter.ai/openai/gpt-5.6-sol. Reasoning levels and default from https://developers.openai.com/api/docs/models/gpt-5.6-sol: "Reasoning.effort supports: none, low, medium (default), high, xhigh, and max."OpenAI
supports_minimal_reasoning_effort: false, raw model pages fetched with curl:gpt-5.1,gpt-5.1-2025-11-13)gpt-5.2,gpt-5.2-2025-12-11)gpt-5.4,gpt-5.4-2026-03-05)gpt-5.4-pro,gpt-5.4-pro-2026-03-05)For contrast https://developers.openai.com/api/docs/models/gpt-5 still says "Reasoning.effort supports: minimal, low, medium, and high.", so
gpt-5keepsminimaland the dict-form test now uses itAbsorbed, dropped, and left alone
Absorbed: #40569 (Jina, all 3 fields), #40183 (OpenRouter GPT-5.6 Sol, all 25 fields), #40547 (gpt-5.1 and gpt-5.4 minimal flag plus its test changes, widened to the dated snapshots, gpt-5.2 and gpt-5.4-pro)
Not carried from #40183: its
test_model_prices_schema.pyaddition only re-asserts the JSON constants, which the repo test rules disallow (never test structure only)Dropped as unverifiable: #40368 (Bedrock Claude 3 Haiku cache pricing). The AWS Bedrock pricing feed at https://b0.p.awsstatic.com/pricing/2.0/meteredUnitMaps/bedrockfoundationmodels/USD/current/bedrockfoundationmodels.json, joined to the table on https://aws.amazon.com/bedrock/pricing/, shows the Claude 3 Haiku row as
0.25 | 1.25 | N/A (5m cache write) | N/A (1h cache write) | N/A (cache read). AWS publishes no cache rate for this model, so neither the current nor the proposed values can be confirmed from AWS. Left open for the authorDropped as not yet verifiable: the 5 remaining changes in #40018 (Gemini Live preview cache fields,
azure/gpt-realtime-2cached audio write). The Gemini pricing page renders the Live API table with JavaScript and the model card URL cited in the PR returns 404 in a raw fetch, and the Azure pricing page is JS-only. Nothing to compare against, so left open for the author. Its other 7 changes are already on the base branchLeft alone as code/behavior PRs that only incidentally touch the JSON: #39834 (Bedrock sampling params), #40376 (Vertex Claude max tokens, JSON already on base), plus the new-provider and code PRs (#40579, #40493, #40370, #40367, #40354, #40238, #40199, #40101, #39907, #39897, #39861, #39799, #39785, #39775, #39732)
Deprecation audit
Compared OpenAI, Anthropic, Gemini API, Vertex, Bedrock and Azure retirement tables (raw HTML rows, jina cross-check) against every
deprecation_datein the file. All provider-scoped keys already match. The only gaps are baregemini-*keys, which carrylitellm_provider: vertex_ai-language-models, where only the Gemini API page (not Vertex) announces a shutdown, andcomputer-use-preview(anazurekey) where only OpenAI announces a date. Those were left untouched because the matching platform page does not confirm the date. No new deprecation dates this runPre-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)Screenshots / Proof of Fix
QA run at 996ca7c (the tip) against the merge base e5da593. Two detached worktrees, each with its own venv, its own Postgres 16 container and its own random port, both booted with
--num_workers 2,LITELLM_LOCAL_MODEL_COST_MAP=True(so the tree under test is the cost map under test) andPYTHONPATHpointing at the worktree, withlitellm.__file__asserted to sit inside it. Same config on both sides, real OpenAI, OpenRouter and Jina keys, real spendBefore is
http://127.0.0.1:21210, After ishttp://127.0.0.1:21427. Every spend row below is read throughGET /spend/logs?request_id=<id>with the master key, the same route the logs page usesBefore (e5da593)
jina-rerank-spend
44 billed tokens at $0.000000018 each, the old $0.018/M rate
gpt56sol-dropdown
Open
http://127.0.0.1:21210/ui/, log in withadminand the master key, go to Models + Endpoints, click the Add Model tab, pick providerOpenrouter, open the LiteLLM Model Name(s) dropdown and typegpt-5.6-sol262 OpenRouter options, no match for
gpt-5.6-solgpt56sol-chat-cost
The number is right only because OpenRouter reports its own
usage.costand the proxy passes it through; the registry has no entry (see model-group-info below)gpt54-minimal-chat
Same request with
"model":"gpt-5.4-drop"(drop_params on):The registry says gpt-5.4 supports
minimal, sodrop_paramskeeps it and OpenAI rejects the callgpt54-minimal-responses
Same with
gpt-5.4-drop: status=400, same OpenAI errorgpt54-minimal-messages
Adaptive thinking with
minimalis forwarded as is, since the registry claims gpt-5.4 supports itmodel-group-info
curl -sS http://127.0.0.1:21210/model_group/info -H 'Authorization: Bearer sk-qa40581'gpt56sol-above-272k
Same chat call to
gpt-5.6-solwith a 1.66 MB repeated-sentence prompt (max_tokens: 8)Again OpenRouter's own
usage.costpassed through; the registry has nothing to compute frombaseline-chat
gpt-5.4, noreasoning_effort,max_tokens: 16: status=200, cost 9.5e-05, spend row spend=9.5e-05 total_tokens=13After (996ca7c)
jina-rerank-spend
44 billed tokens at $0.00000005 each, the $0.05/M input rate Jina invoices, output free. The Models page row for
jina-rerankshows IN $0.05 / OUT $0.00 per 1Mgpt56sol-dropdown
Same URL, clicks and search on
http://127.0.0.1:21427/ui/openrouter/openai/gpt-5.6-solis listed and selectablegpt56sol-chat-cost
Now computed from the registry: 8 x $2/M + 6 x $10/M = 7.6e-05, equal to what OpenRouter charged
gpt54-minimal-chat
The gateway rejects
minimalitself, no OpenAI call. Same request with"model":"gpt-5.4-drop"(drop_params on):reasoning_effortwas removed from the OpenAI request entirely (the proxy log line has noreasoning_effortkey)gpt54-minimal-responses
Same with
gpt-5.4-drop: status=400, same OpenAI error. Unchanged from Before: the Responses route only gatesnone, it never consulted theminimalflag, so this PR leaves it alone (see Caveats)gpt54-minimal-messages
thinking.enabledwithbudget_tokens: 1024: status=200, cost 0.00011, proxy sentreasoning_effort=low, same as Beforethinking.adaptivewithoutput_config.effort: minimal:With the registry no longer claiming
minimal, the Messages route degrades it tolowinstead of forwarding it, and OpenAI answersmodel-group-info
gpt56sol-above-272k
Computed from the registry's above-272k tier: 300214 cache-write tokens x $5/M + 3 x $4/M + 5 x $15/M = 1.501157, to the cent what OpenRouter charged
baseline-chat
gpt-5.4, noreasoning_effort,max_tokens: 16: status=200, cost 9.5e-05, spend row spend=9.5e-05 total_tokens=13Verdict
PASS. Before bills Jina rerank at $0.018/M, hides
gpt-5.6-solfrom the dropdown and the registry, and forwardsminimalto OpenAI even withdrop_params. After bills at $0.05/M input, lists and pricesgpt-5.6-sol(flat and above-272k tiers match OpenRouter's own charge), rejectsminimalat the gateway, strips it withdrop_params, and degrades it tolowon/v1/messagesObservations from the run:
/v1/responsesforwardsminimalon both sides;drop_paramsdoes nothing there/v1/messagesoutput_config.effortis ignored withoutthinking.adaptive; both sidesType
🐛 Bug Fix
Caveats (if any)
Low
minimalafter this flip:gpt-5.1-chat-latest,gpt-5.2-chat-latest,gpt-5.3-chat-latest,gpt-5.1-codex,gpt-5.1-codex-max,gpt-5.1-codex-mini,gpt-5.2-codex,gpt-5.3-codex,gpt-5.2-pro(plus its dated snapshot), and the 11azure/andazure_ai/gpt-5.1 and gpt-5.4 keys. The OpenAI pages for the pro and codex models list no effort levels and the Azure docs were not checked this run, so there is no source to cite for them. A user of those keys sendingminimalgets the same provider 400 they got before this PR, nothing gets worse. Left for the next audit run rather than flipped here unsourced, since each key needs its own live probe and the flip would re-open both bot reviews and the QA legs on a data-only PRminimalat the gateway changes the 400's shape for callers withoutdrop_params: the message now readsUnsupportedParamsError: reasoning_effort=minimal is not supported for this modelwithparam: null, where OpenAI's own 400 carriedparam: "reasoning_effort". Still a 400 with the sameinvalid_request_errortype, and the same shape every other unsupported effort already gets on chat completions, so not worth a code change in a registry PR/v1/responsesstill forwardsreasoning.effort: minimalto OpenAI for these models, with or withoutdrop_params, because that route only gatesnoneand never reads the flag this PR flips; pre-existing on both sides and tracked in /v1/responses forwards a reasoning effort the model map marks unsupported #38530, so a data-only PR leaves it aloneFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/b83355ae1f9d4219a941bdbacb43a8b1
Open in Devin Desktop: https://app.devin.ai/desktop/session/b83355ae1f9d4219a941bdbacb43a8b1?variant=devin
Requested by: @mateo-berri
Note
Medium Risk
Changes affect reported spend (Jina rerank) and which reasoning_effort values reach OpenAI for GPT-5.1/5.2/5.4; registry-only for most paths but billing and request validation are user-visible.
Overview
This model registry audit aligns pricing and capability flags with provider docs and adds missing catalog entries.
Jina rerank billing:
jina-reranker-v2-base-multilingualis updated to $0.05/M input only (output0.0), with a Jina API source URL. A spend test asserts rerankcompletion_costbillsmeta.billed_units.total_tokensat the input rate only; the hardcoded pricing comment is removed fromcalculate_rerank_cost(logic unchanged).OpenRouter: Adds
openrouter/openai/gpt-5.6-solwith context, tiered costs above 272k, reasoning levels, and modality flags.GPT-5 reasoning effort: Sets
supports_minimal_reasoning_effort: falseon gpt-5.1, 5.2, and 5.4 families (including dated/pro variants) sominimalis dropped withdrop_paramsor rejected locally. Tests are flipped from “allows minimal” to “rejects/drops minimal” for those models; dict-formminimalcoverage moves to basegpt-5, which still supports it.Root
model_prices_and_context_window.jsonand the bundled backup stay in sync.Reviewed by Cursor Bugbot for commit 996ca7c. Bugbot is set up for automated code reviews on this repo. Configure here.