The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(pricing): adjust gpt-5.6-terra and gpt-5.6-luna prices according to OpenAI's latest article (#35258)
lihugangf1b781d06b61
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex cc418c9c428..a431c4b29fc 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -23782,29 +23782,29 @@"supports_xhigh_reasoning_effort": true},"gpt-5.6-terra": {- "cache_creation_input_token_cost": 3.125e-06,- "cache_creation_input_token_cost_above_272k_tokens": 6.25e-06,- "cache_creation_input_token_cost_flex": 1.5625e-06,- "cache_creation_input_token_cost_priority": 6.25e-06,- "cache_read_input_token_cost": 2.5e-07,- "cache_read_input_token_cost_above_272k_tokens": 5e-07,- "cache_read_input_token_cost_flex": 1.25e-07,- "cache_read_input_token_cost_priority": 5e-07,- "input_cost_per_token": 2.5e-06,- "input_cost_per_token_above_272k_tokens": 5e-06,- "input_cost_per_token_batches": 1.25e-06,- "input_cost_per_token_flex": 1.25e-06,- "input_cost_per_token_priority": 5e-06,+ "cache_creation_input_token_cost": 2.5e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 5e-06,+ "cache_creation_input_token_cost_flex": 1.25e-06,+ "cache_creation_input_token_cost_priority": 5e-06,+ "cache_read_input_token_cost": 2e-07,+ "cache_read_input_token_cost_above_272k_tokens": 4e-07,+ "cache_read_input_token_cost_flex": 1e-07,+ "cache_read_input_token_cost_priority": 4e-07,+ "input_cost_per_token": 2e-06,+ "input_cost_per_token_above_272k_tokens": 4e-06,+ "input_cost_per_token_batches": 1e-06,+ "input_cost_per_token_flex": 1e-06,+ "input_cost_per_token_priority": 4e-06,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 1.5e-05,- "output_cost_per_token_above_272k_tokens": 2.25e-05,- "output_cost_per_token_batches": 7.5e-06,- "output_cost_per_token_flex": 7.5e-06,- "output_cost_per_token_priority": 3e-05,+ "output_cost_per_token": 1.2e-05,+ "output_cost_per_token_above_272k_tokens": 1.8e-05,+ "output_cost_per_token_batches": 6e-06,+ "output_cost_per_token_flex": 6e-06,+ "output_cost_per_token_priority": 2.4e-05,"regional_processing_uplift_multiplier_eu": 1.1,"regional_processing_uplift_multiplier_us": 1.1,"supported_endpoints": [@@ -23835,29 +23835,29 @@"supports_xhigh_reasoning_effort": true},"gpt-5.6-luna": {- "cache_creation_input_token_cost": 1.25e-06,- "cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,- "cache_creation_input_token_cost_flex": 6.25e-07,- "cache_creation_input_token_cost_priority": 2.5e-06,- "cache_read_input_token_cost": 1e-07,- "cache_read_input_token_cost_above_272k_tokens": 2e-07,- "cache_read_input_token_cost_flex": 5e-08,- "cache_read_input_token_cost_priority": 2e-07,- "input_cost_per_token": 1e-06,- "input_cost_per_token_above_272k_tokens": 2e-06,- "input_cost_per_token_batches": 5e-07,- "input_cost_per_token_flex": 5e-07,- "input_cost_per_token_priority": 2e-06,+ "cache_creation_input_token_cost": 2.5e-07,+ "cache_creation_input_token_cost_above_272k_tokens": 5e-07,+ "cache_creation_input_token_cost_flex": 1.25e-07,+ "cache_creation_input_token_cost_priority": 5e-07,+ "cache_read_input_token_cost": 2e-08,+ "cache_read_input_token_cost_above_272k_tokens": 4e-08,+ "cache_read_input_token_cost_flex": 1e-08,+ "cache_read_input_token_cost_priority": 4e-08,+ "input_cost_per_token": 2e-07,+ "input_cost_per_token_above_272k_tokens": 4e-07,+ "input_cost_per_token_batches": 1e-07,+ "input_cost_per_token_flex": 1e-07,+ "input_cost_per_token_priority": 4e-07,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 6e-06,- "output_cost_per_token_above_272k_tokens": 9e-06,- "output_cost_per_token_batches": 3e-06,- "output_cost_per_token_flex": 3e-06,- "output_cost_per_token_priority": 1.2e-05,+ "output_cost_per_token": 1.2e-06,+ "output_cost_per_token_above_272k_tokens": 1.8e-06,+ "output_cost_per_token_batches": 6e-07,+ "output_cost_per_token_flex": 6e-07,+ "output_cost_per_token_priority": 2.4e-06,"regional_processing_uplift_multiplier_eu": 1.1,"regional_processing_uplift_multiplier_us": 1.1,"supported_endpoints": [diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex c4628fecdb8..184bc69c9e8 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -23857,29 +23857,29 @@"supports_xhigh_reasoning_effort": true},"gpt-5.6-terra": {- "cache_creation_input_token_cost": 3.125e-06,- "cache_creation_input_token_cost_above_272k_tokens": 6.25e-06,- "cache_creation_input_token_cost_flex": 1.5625e-06,- "cache_creation_input_token_cost_priority": 6.25e-06,- "cache_read_input_token_cost": 2.5e-07,- "cache_read_input_token_cost_above_272k_tokens": 5e-07,- "cache_read_input_token_cost_flex": 1.25e-07,- "cache_read_input_token_cost_priority": 5e-07,- "input_cost_per_token": 2.5e-06,- "input_cost_per_token_above_272k_tokens": 5e-06,- "input_cost_per_token_batches": 1.25e-06,- "input_cost_per_token_flex": 1.25e-06,- "input_cost_per_token_priority": 5e-06,+ "cache_creation_input_token_cost": 2.5e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 5e-06,+ "cache_creation_input_token_cost_flex": 1.25e-06,+ "cache_creation_input_token_cost_priority": 5e-06,+ "cache_read_input_token_cost": 2e-07,+ "cache_read_input_token_cost_above_272k_tokens": 4e-07,+ "cache_read_input_token_cost_flex": 1e-07,+ "cache_read_input_token_cost_priority": 4e-07,+ "input_cost_per_token": 2e-06,+ "input_cost_per_token_above_272k_tokens": 4e-06,+ "input_cost_per_token_batches": 1e-06,+ "input_cost_per_token_flex": 1e-06,+ "input_cost_per_token_priority": 4e-06,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 1.5e-05,- "output_cost_per_token_above_272k_tokens": 2.25e-05,- "output_cost_per_token_batches": 7.5e-06,- "output_cost_per_token_flex": 7.5e-06,- "output_cost_per_token_priority": 3e-05,+ "output_cost_per_token": 1.2e-05,+ "output_cost_per_token_above_272k_tokens": 1.8e-05,+ "output_cost_per_token_batches": 6e-06,+ "output_cost_per_token_flex": 6e-06,+ "output_cost_per_token_priority": 2.4e-05,"regional_processing_uplift_multiplier_eu": 1.1,"regional_processing_uplift_multiplier_us": 1.1,"supported_endpoints": [@@ -23910,29 +23910,29 @@"supports_xhigh_reasoning_effort": true},"gpt-5.6-luna": {- "cache_creation_input_token_cost": 1.25e-06,- "cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,- "cache_creation_input_token_cost_flex": 6.25e-07,- "cache_creation_input_token_cost_priority": 2.5e-06,- "cache_read_input_token_cost": 1e-07,- "cache_read_input_token_cost_above_272k_tokens": 2e-07,- "cache_read_input_token_cost_flex": 5e-08,- "cache_read_input_token_cost_priority": 2e-07,- "input_cost_per_token": 1e-06,- "input_cost_per_token_above_272k_tokens": 2e-06,- "input_cost_per_token_batches": 5e-07,- "input_cost_per_token_flex": 5e-07,- "input_cost_per_token_priority": 2e-06,+ "cache_creation_input_token_cost": 2.5e-07,+ "cache_creation_input_token_cost_above_272k_tokens": 5e-07,+ "cache_creation_input_token_cost_flex": 1.25e-07,+ "cache_creation_input_token_cost_priority": 5e-07,+ "cache_read_input_token_cost": 2e-08,+ "cache_read_input_token_cost_above_272k_tokens": 4e-08,+ "cache_read_input_token_cost_flex": 1e-08,+ "cache_read_input_token_cost_priority": 4e-08,+ "input_cost_per_token": 2e-07,+ "input_cost_per_token_above_272k_tokens": 4e-07,+ "input_cost_per_token_batches": 1e-07,+ "input_cost_per_token_flex": 1e-07,+ "input_cost_per_token_priority": 4e-07,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 6e-06,- "output_cost_per_token_above_272k_tokens": 9e-06,- "output_cost_per_token_batches": 3e-06,- "output_cost_per_token_flex": 3e-06,- "output_cost_per_token_priority": 1.2e-05,+ "output_cost_per_token": 1.2e-06,+ "output_cost_per_token_above_272k_tokens": 1.8e-06,+ "output_cost_per_token_batches": 6e-07,+ "output_cost_per_token_flex": 6e-07,+ "output_cost_per_token_priority": 2.4e-06,"regional_processing_uplift_multiplier_eu": 1.1,"regional_processing_uplift_multiplier_us": 1.1,"supported_endpoints": [diff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.pyindex d282e656ce8..1ad271900f6 100644--- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py+++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py@@ -611,8 +611,8 @@ def test_generic_cost_per_token_gpt55_pro():[("gpt-5.6", 5e-6, 3e-5, 5e-7, 6.25e-6),("gpt-5.6-sol", 5e-6, 3e-5, 5e-7, 6.25e-6),- ("gpt-5.6-terra", 2.5e-6, 1.5e-5, 2.5e-7, 3.125e-6),- ("gpt-5.6-luna", 1e-6, 6e-6, 1e-7, 1.25e-6),+ ("gpt-5.6-terra", 2e-6, 1.2e-5, 2e-7, 2.5e-6),+ ("gpt-5.6-luna", 2e-7, 1.2e-6, 2e-8, 2.5e-7),],)def test_generic_cost_per_token_gpt56(diff --git a/tests/test_litellm/test_gpt_5_6_model_metadata.py b/tests/test_litellm/test_gpt_5_6_model_metadata.pyindex 5a7b621d521..b17ef32a1dc 100644--- a/tests/test_litellm/test_gpt_5_6_model_metadata.py+++ b/tests/test_litellm/test_gpt_5_6_model_metadata.py@@ -7,7 +7,14 @@ from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_providerGPT_5_6_MODELS = ("gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna")-STANDARD_PRICING = {+OPENAI_STANDARD_PRICING = {+ "gpt-5.6": (5e-06, 3e-05, 5e-07, 6.25e-06),+ "gpt-5.6-sol": (5e-06, 3e-05, 5e-07, 6.25e-06),+ "gpt-5.6-terra": (2e-06, 1.2e-05, 2e-07, 2.5e-06),+ "gpt-5.6-luna": (2e-07, 1.2e-06, 2e-08, 2.5e-07),+}++AZURE_STANDARD_PRICING = {"gpt-5.6": (5e-06, 3e-05, 5e-07, 6.25e-06),"gpt-5.6-sol": (5e-06, 3e-05, 5e-07, 6.25e-06),"gpt-5.6-terra": (2.5e-06, 1.5e-05, 2.5e-07, 3.125e-06),@@ -27,7 +34,7 @@ def test_openai_gpt_5_6_model_info(model):assert info["litellm_provider"] == "openai"assert info["mode"] == "chat"- input_cost, output_cost, cache_read_cost, cache_write_cost = STANDARD_PRICING[model]+ input_cost, output_cost, cache_read_cost, cache_write_cost = OPENAI_STANDARD_PRICING[model]assert info["input_cost_per_token"] == input_costassert info["output_cost_per_token"] == output_costassert info["cache_read_input_token_cost"] == cache_read_cost@@ -95,7 +102,7 @@ def test_azure_gpt_5_6_global_model_info(model):assert info["litellm_provider"] == "azure"assert info["mode"] == "chat"- input_cost, output_cost, cache_read_cost, _ = STANDARD_PRICING[_tier_key(model)]+ input_cost, output_cost, cache_read_cost, _ = AZURE_STANDARD_PRICING[_tier_key(model)]assert info["input_cost_per_token"] == input_costassert info["output_cost_per_token"] == output_costassert info["cache_read_input_token_cost"] == cache_read_cost@@ -124,7 +131,7 @@ def test_azure_gpt_5_6_regional_model_info(model):assert info["litellm_provider"] == "azure"assert info["mode"] == "chat"- input_cost, output_cost, cache_read_cost, _ = STANDARD_PRICING[_tier_key(model)]+ input_cost, output_cost, cache_read_cost, _ = AZURE_STANDARD_PRICING[_tier_key(model)]assert info["input_cost_per_token"] == pytest.approx(input_cost * 1.1)assert info["output_cost_per_token"] == pytest.approx(output_cost * 1.1)