From 6b959f92c4a82ccbed6d4ca7e6f2b8e75efe943b Mon Sep 17 00:00:00 2001 From: Ritwij Aryan Parmar Date: Tue, 26 May 2026 02:01:01 -0400 Subject: [PATCH] fix: allow tiered cache creation pricing --- tests/test_litellm/test_utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index e646c75eda0..2b42d2950f1 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -939,6 +939,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid(): }, "input_cost_per_token": {"type": "number"}, "output_cost_per_token": {"type": "number"}, + "cache_creation_input_token_cost": {"type": "number"}, "cache_read_input_token_cost": {"type": "number"}, "output_cost_per_reasoning_token": {"type": "number"}, "max_results_range": { @@ -957,6 +958,23 @@ def test_aaamodel_prices_and_context_window_json_is_valid(): }, } + validate( + { + "tiered-cache-creation-regression": { + "tiered_pricing": [ + { + "range": [0, 128000], + "input_cost_per_token": 0.0000008, + "output_cost_per_token": 0.000002, + "cache_creation_input_token_cost": 0.000001, + "cache_read_input_token_cost": 0.0000002, + } + ], + } + }, + INTENDED_SCHEMA, + ) + prod_json = os.path.join( os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json" )