fix(pricing): add azure gpt-5.6 cache write rates and correct data zone priority - #38370
Merged
mateo-berri merged 4 commits intoAug 26, 2026
Merged
Conversation
Contributor
Greptile SummaryThis PR corrects Azure GPT-5.6 cache-write and Data Zone priority pricing metadata.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported combined cache-rate omission is fixed in both pricing maps and the runtime resolver selects the newly supplied field.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds the complete cache-write pricing ladder and corrects US/EU priority rates; the previously missing combined key is present across all affected entries. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the corrected Azure GPT-5.6 rates and combined long-context priority keys from the primary pricing map. |
| model_prices_and_context_window.schema.json | Adds schema support for the combined above-272k priority cache-creation field. |
| tests/test_litellm/test_cost_calculator.py | Adds cache-write cost and pricing-map invariant tests covering all twelve Azure GPT-5.6 variants. |
| tests/test_litellm/test_utils.py | Extends the test-side pricing schema to recognize the new combined cache-creation rate key. |
Reviews (4): Last reviewed commit: "test(utils): add priority cache write ti..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
1 task
Contributor
Author
Contributor
Author
|
bugbot run |
Contributor
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 c5e3b21. Configure here.
Contributor
Author
mateo-berri
enabled auto-merge
August 26, 2026 19:17
yucheng-berri
approved these changes
Aug 26, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
cache_write_tokens, and bills them at 1.25x inputHow it solves it:
cache_creation_input_token_cost(1.25x input) to every tier variant of all 12 entriesUser Flow
Before: a developer running an agent workload on an azure gpt-5.6-luna deployment sees gateway spend far below their Azure bill, because every prompt cache write is billed at $0
{"model": "azure-gpt-5.6-luna", ...}and a long system promptprompt_tokens_details.cache_write_tokens: 1313, which Azure bills at $0.25 per million tokensx-litellm-response-cost-inputheader reads $0.0000006: only the 3 non-cached tokens were priced, the 1313 cache-write tokens cost $0After: the same requests price cache writes and Data Zone priority exactly as the Azure price page does
{"model": "azure-gpt-5.6-luna", ...}and the same long system promptprompt_tokens_details.cache_write_tokens: 1313x-litellm-response-cost-inputheader now reads about $0.000329: 3 tokens at $0.20/M plus 1313 cache-write tokens at $0.25/MRelevant issues
Fixes #37631
Fixes #37268
Linear ticket
Resolves LIT-6178
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)Screenshots / Proof of Fix
Live proxy A/B against a real Azure Foundry gpt-5.6-luna deployment, both legs booted with
--num_workers 2andLITELLM_LOCAL_MODEL_COST_MAP=True: before at the merge base 95285c3, after at this PR's tip b349b9b. Five cases per leg, identical flow: a ~1300-token system prompt led by a fresh random cache-buster forces a cache WRITE on each of /v1/chat/completions, /v1/messages, and /v1/responses, repeating the chat prompt gets the cache READ, and a short prompt is the no-cache control. Azure's published Luna rates: input 2e-07, cache write 2.5e-07 (1.25x input), cache read 2e-08, output 1.2e-06Exemplar request (same shape on both legs, only the port and buster differ):
Before (95285c3): cache-write tokens billed $0
chat_write came back with
"prompt_tokens": 1703, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 1700, ...}andcost-input 6e-07 is exactly the 3 uncached text tokens at 2e-07; the 1700 cache-write tokens contributed $0. The published-rate input side is 3 x 2e-07 + 1700 x 2.5e-07 = 4.256e-04, a ~650x input-side underbill. Same story on every write surface:
After (b349b9b): cache writes billed at 2.5e-07, exact
chat_write came back with 1627 cache-write tokens and
1627 x 2.5e-07 = 4.0675e-04, exactly the cache-creation amount. Every case matches the published-rate arithmetic:
The first chat_read attempt (2s after the write) was a server-side cache miss, reported as a second write, and billed as one at 2.5e-07, correctly; the 10s retry hit the cache
Observations from the legs (all pre-existing, this PR leaves them alone):
Commits since this run: 8d750a2 only regenerates model_prices_and_context_window.schema.json (a generated file consumed by CI validation alone), e97a84a only adds the us/eu above-272k priority rates plus a stricter key-set test, and c5e3b21 only adds that key name to the test-side schema. The QA cases are all sub-272k standard-tier requests, so none of these commits change any behavior they exercise and the proof above stands; the above-272k priority path is pinned by the regression tests against the Azure price page.
Type
🐛 Bug Fix
Caveats (if any)
Low
Final Attestation
The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
b349b9b passes /live-pr-risk
8d750a2 passes /live-pr-risk
e97a84a passes /live-pr-risk
c5e3b21 passes /live-pr-risk
Note
Medium Risk
Changes only static pricing metadata but directly affects reported spend and budgets for Azure GPT-5.6 cache writes and Data Zone priority; incorrect rates would under- or over-bill customers.
Overview
Fixes Azure GPT-5.6 cost map entries so prompt cache-write tokens and US/EU Data Zone tiers match Azure’s published pricing.
All 12
azure/.../gpt-5.6*variants (global, sol, terra, luna × global/us/eu) now definecache_creation_input_token_cost(and matching priority / above-272k suffix keys) at 1.25× the corresponding input rate, socache_creation_input_tokens/ cache-write usage is no longer priced at $0 or at plain input when the calculator readsmodel_prices_and_context_window.json.For
azure/us/andazure/eu/entries, priority (and newly filled above-272k priority) input, output, cache-read, and cache-creation rates are corrected from an erroneous 1.25× Global to 1.1× Global, aligned with the Data Zone uplift on standard tiers.The JSON schema gains
cache_creation_input_token_cost_above_272k_tokens_priority, and regression tests assert cache-write billing forazure/gpt-5.6-lunaplus map invariants across all twelve keys.Reviewed by Cursor Bugbot for commit c5e3b21. Bugbot is set up for automated code reviews on this repo. Configure here.