feat(pricing): add azure data-zone and long-context pricing for gpt-5.4/5.5 - #32279
Conversation
….4/5.5 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:
|
|
Mubashir Osmani seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Greptile SummaryAdds Azure Data Zone (
Confidence Score: 5/5Pure pricing data addition — no logic changes, no regressions possible from existing model resolution paths. The change is limited to two JSON data files. All eight new entries have been cross-checked: token costs match the values documented in the PR description, above-threshold keys are included exactly where Azure publishes a corresponding row (gpt-5.5 only), and capability flags align with the existing base entries for each model. The backup file is an exact mirror of the main file. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds 8 new Data Zone pricing entries (us/eu variants of gpt-5.4, gpt-5.4-2026-03-05, gpt-5.5, gpt-5.5-2026-04-23); prices match stated Azure source, above_272k fields correctly included for gpt-5.5 and omitted for gpt-5.4, and capability flags are consistent with their corresponding base entries. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the same 8 new Data Zone entries as the main JSON; diff confirms both files received identical additions. |
Reviews (2): Last reviewed commit: "chore(pricing): drop azure data-zone pri..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Verified against the Azure OpenAI pricing page. Azure only offers Data Zone for gpt-5.4 (<272k) and gpt-5.5, and a Long Context Data Zone tier only for gpt-5.5; mini, nano and pro are Global-only and mini/nano have no long-context tier. Drop the incorrectly-added mini/nano/pro data-zone variants and the mini/nano long-context keys, and set the gpt-5.4/5.5 us and eu entries to the exact published standard and priority prices (gpt-5.4 has no data-zone long context, gpt-5.5 does). Tests now assert the published values rather than a flat 1.1x multiplier. 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>
mateo-berri
left a comment
There was a problem hiding this comment.
Missing test coverage for dated long-context variants
test_regional_long_context_surcharge_presentonly parametrizes the un-dated aliases (azure/gpt-5.4-mini,azure/gpt-5.4-nano), but the PR description explicitly calls out four entries that were corrected — includingazure/gpt-5.4-mini-2026-03-17andazure/gpt-5.4-nano-2026-03-17. The dated variants do carry the right values in the JSON (verified), but no test directly asserts the specific numeric rates for them; they are only indirectly covered bytest_backup_matches_main, which only checks that main and backup agree — not that the values are correct.
@mubashir1osmani why did you resolve this. Is this not a real concern? I just want to know why. Going forward, please leave your explanation as a reply in thread
|
bugbot run |
|
@coderabbitai review (just testing coderabbit; don't treat its concerns as blocking) |
|
✅ Action performedReview finished.
|
|
✅ Action performedReview finished.
|
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 99f2887. Configure here.
its just a sanity check if dated model variants assert an accurate price per token. i dont think we write tests for model cost map because verifying it from the provider would suffice |
📝 WalkthroughWalkthroughUpdates two model pricing/config JSON files to replace single Azure model entries for gpt-5.4, gpt-5.4-2026-03-05, gpt-5.5, and gpt-5.5-2026-04-23 with region-specific azure/us and azure/eu entries, each carrying pricing, token limits, endpoints, modalities, and capability flags. ChangesAzure region-scoped pricing split
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@litellm/model_prices_and_context_window_backup.json`:
- Around line 6186-6263: The dated Azure gpt-5.5-2026-04-23 model entries are
missing the same reasoning-effort capability flags exposed by the gpt-5.5 alias,
which causes inconsistent capability checks. Update both
azure/us/gpt-5.5-2026-04-23 and azure/eu/gpt-5.5-2026-04-23 in
model_prices_and_context_window_backup.json to include
supports_none_reasoning_effort, supports_xhigh_reasoning_effort, and
supports_minimal_reasoning_effort alongside the existing capability fields so
the pinned snapshot matches the alias behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cc2ca8bf-1767-44e3-9ce6-27bffc3227d5
📒 Files selected for processing (2)
litellm/model_prices_and_context_window_backup.jsonmodel_prices_and_context_window.json
Relevant issues
Linear ticket
Resolves LIT-4225
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays 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
These models have no reachable public endpoint and a real Data Zone call needs the customer's Azure deployment credentials, so the proxy runs against this PR's bundled cost map (
LITELLM_LOCAL_MODEL_COST_MAP=True) in front of a tiny local OpenAI-compatible upstream that returns fixed token usage (1000 prompt / 500 completion for the base tier on port 8801, and 300000 prompt / 1000 completion for long context on port 8802), so the emittedx-litellm-response-costheader is deterministic and hand-checkable. That header is the exact value written to spend logs, so it is what the customer seesOutput:
Before this change the
-usand-eurows resolved to the base entry and billed the Global rateType
🆕 New Feature
Changes
Azure customers on the gpt-5.4 and gpt-5.5 families were seeing spend discrepancies because the Data Zone deployment variants were missing from the cost map, so a request to
azure/us/gpt-5.5fell through to the base entry and was billed at the Global rate instead of the Data Zone rateEvery number here was transcribed field by field from the Azure OpenAI pricing page rather than derived from a flat multiplier, which matters because the Azure Data Zone surface is not uniform across the family. Azure only publishes a Data Zone column for
gpt-5.4(under 272k context) andgpt-5.5, and it only publishes a Long Context (over 272k) Data Zone row forgpt-5.5. The mini, nano and pro members are Global only, and mini/nano have no long-context tier at all. An earlier revision of this branch had wrongly generated Data Zone entries for mini/nano/pro and a long-context tier for mini/nano by scaling everything by 1.1x; verifying against the page removed those invented entriesConcretely this adds eight entries to both
model_prices_and_context_window.jsonand the bundledlitellm/model_prices_and_context_window_backup.json: theusandeuData Zone variants ofazure/gpt-5.4,azure/gpt-5.4-2026-03-05,azure/gpt-5.5andazure/gpt-5.5-2026-04-23. Each carries the standard on-demand and priority processing token costs from the page, plus the over-272k tier for the gpt-5.5 pair only. Thegpt-5.4Data Zone entries deliberately omit anyabove_272kkeys, so a prompt past 272k on a gpt-5.4 Data Zone deployment bills the flat Data Zone rate rather than a surcharge that Azure does not offerThe Global entries and the mini/nano/pro entries already matched the page and are left untouched
Sources
Prices verified against the Azure OpenAI pricing page at https://azure.microsoft.com/en-us/pricing/details/azure-openai/ (Standard on-demand and Priority Processing columns; the Long Context rows for the over-272k tier). The relevant rows, per 1M tokens:
For the resolution logic these entries rely on, cost lookup walks the
provider/modelthenmodelthen stripped variants inlitellm/litellm_core_utils/get_model_cost_map.pyandlitellm/cost_calculator.py, and the over-272k tier is selected by_parse_above_token_thresholdwhenprompt_tokenscrosses 272000Link to Devin session: https://app.devin.ai/sessions/c00b3c0e15884513955dfc03d3e25a7b
Requested by: @mubashir1osmani
Note
Low Risk
Data-only cost-map additions with no runtime logic changes; main risk is incorrect published rates affecting billing estimates for those model IDs.
Overview
Adds eight new model cost-map entries in
model_prices_and_context_window.jsonand the bundled backup so Azure US/EU Data Zone deployments (azure/us/...,azure/eu/...) for gpt-5.4, gpt-5.4-2026-03-05, gpt-5.5, and gpt-5.5-2026-04-23 resolve to Azure’s Data Zone rates instead of falling through to the Globalazure/gpt-5.*rows.Each new entry includes on-demand and priority token pricing (and cache-read where applicable). gpt-5.5 Data Zone rows also define >272k input/output/cache tiers; gpt-5.4 Data Zone rows intentionally omit
above_272kfields so long prompts bill at the flat Data Zone rate Azure publishes for that family.Reviewed by Cursor Bugbot for commit 99f2887. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit