Repository navigation
fix(pricing): add missing cache_creation_input_token_cost to azure/gpt-5.6* entries - #37773
Closed
connectsudhindra wants to merge 3 commits into
Closed
connectsudhindra wants to merge 3 commits into
connectsudhindra wants to merge 3 commits into
Conversation
…t-5.6* entries Every azure/gpt-5.6* price map entry (base, azure/us/*, azure/eu/*) was missing cache_creation_input_token_cost and its above_272k/priority variants, while the non-Azure counterparts had them. Since generic_cost_per_token resolves a missing key to no rate, Azure cache-write tokens for this model family were billed at zero instead of the 1.25x-input rate Azure charges, same as OpenAI. Filled in the missing keys using the same 1.25x-of-input ratio already present on the OpenAI entries, and regenerated the JSON schema for the one new field-suffix combination this introduces.
|
= 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. |
Contributor
|
Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance and include this reference: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
added 2 commits
August 21, 2026 00:09
…del_cost writes The test-quality gate (TQ004/TQ005) flags raw os.environ assignments and litellm.<attr> module-global mutation in tests, since the write outlives the test. Switch to monkeypatch.setenv/setattr, which the existing autouse teardown already relies on elsewhere in this file.
tests/test_litellm/test_utils.py validates the price map against a hardcoded jsonschema that has no property for cache_creation_input_token_cost_above_272k_tokens_priority -- that combined suffix has no precedent anywhere else in the file (OpenAI's own gpt-5.6 entries only go up to cache_creation_input_token_cost_priority), so CI's model-prices validation rejected it as an unknown field. Keep the fix to the three suffixes that already have OpenAI precedent (base, above_272k_tokens, priority) and drop the fourth. Schema regenerates back to the committed baseline with no changes.
1 task done
Author
|
Pls review and merge |
6 tasks done
Contributor
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
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:
How it solves it:
User Flow
Before: a platform team charging back Azure OpenAI spend per team sees almost nothing billed for requests with a large cached system prompt
"model": "azure-gpt-5.6-sol"and a large system prompt"usage": {"prompt_tokens": 2219, "prompt_tokens_details": {"cache_write_tokens": 2217}}After: the same request is billed using the cache-write rate
"model": "azure-gpt-5.6-sol"and the same system promptRelevant issues
Fixes #37631
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/test_cost_calculator.py -vScreenshots / Proof of Fix
I don't have a live Azure OpenAI gpt-5.6 deployment or API key in this environment to curl against, so I can't capture real before/after spend the way this template asks for. The added regression test (
tests/test_litellm/test_cost_calculator.py::test_azure_gpt_5_6_cache_creation_pricing_matches_openai) reproduces the issue's own repro numbers and fails without this fix, passes with it:If you have a live Azure OpenAI gpt-5.6 deployment, the issue's own repro (POST a ~2,200-token system prompt to trigger a cache write, then check
/spend/logs) would be the real before/after.Type
🐛 Bug Fix
Caveats (if any)
Final Attestation