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): correct bedrock_mantle gpt-5.6 terra/luna prices after OpenAI's cut
mubashir1osmani6aea561319e1
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex a431c4b29fc..d5f412b9279 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -45120,10 +45120,10 @@"supports_vision": true},"bedrock_mantle/openai.gpt-5.6-terra": {- "input_cost_per_token": 2.75e-06,- "cache_creation_input_token_cost": 3.4375e-06,- "cache_read_input_token_cost": 2.75e-07,- "output_cost_per_token": 1.65e-05,+ "input_cost_per_token": 2.2e-06,+ "cache_creation_input_token_cost": 2.75e-06,+ "cache_read_input_token_cost": 2.2e-07,+ "output_cost_per_token": 1.32e-05,"litellm_provider": "bedrock_mantle","max_input_tokens": 272000,"max_output_tokens": 128000,@@ -45148,10 +45148,10 @@"supports_vision": true},"bedrock_mantle/openai.gpt-5.6-luna": {- "input_cost_per_token": 1.1e-06,- "cache_creation_input_token_cost": 1.375e-06,- "cache_read_input_token_cost": 1.1e-07,- "output_cost_per_token": 6.6e-06,+ "input_cost_per_token": 2.2e-07,+ "cache_creation_input_token_cost": 2.75e-07,+ "cache_read_input_token_cost": 2.2e-08,+ "output_cost_per_token": 1.32e-06,"litellm_provider": "bedrock_mantle","max_input_tokens": 272000,"max_output_tokens": 128000,diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 184bc69c9e8..e0917ed87b4 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -45241,10 +45241,10 @@"supports_vision": true},"bedrock_mantle/openai.gpt-5.6-terra": {- "input_cost_per_token": 2.75e-06,- "cache_creation_input_token_cost": 3.4375e-06,- "cache_read_input_token_cost": 2.75e-07,- "output_cost_per_token": 1.65e-05,+ "input_cost_per_token": 2.2e-06,+ "cache_creation_input_token_cost": 2.75e-06,+ "cache_read_input_token_cost": 2.2e-07,+ "output_cost_per_token": 1.32e-05,"litellm_provider": "bedrock_mantle","max_input_tokens": 272000,"max_output_tokens": 128000,@@ -45269,10 +45269,10 @@"supports_vision": true},"bedrock_mantle/openai.gpt-5.6-luna": {- "input_cost_per_token": 1.1e-06,- "cache_creation_input_token_cost": 1.375e-06,- "cache_read_input_token_cost": 1.1e-07,- "output_cost_per_token": 6.6e-06,+ "input_cost_per_token": 2.2e-07,+ "cache_creation_input_token_cost": 2.75e-07,+ "cache_read_input_token_cost": 2.2e-08,+ "output_cost_per_token": 1.32e-06,"litellm_provider": "bedrock_mantle","max_input_tokens": 272000,"max_output_tokens": 128000,diff --git a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.pyindex 4dd1c663de0..e808023debe 100644--- a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py+++ b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py@@ -1519,8 +1519,8 @@ class TestBedrockMantleResponsesPricing:"model, input_cost, cache_creation_cost, cache_read_cost, output_cost",[("openai.gpt-5.6-sol", 5.5e-06, 6.875e-06, 5.5e-07, 3.3e-05),- ("openai.gpt-5.6-terra", 2.75e-06, 3.4375e-06, 2.75e-07, 1.65e-05),- ("openai.gpt-5.6-luna", 1.1e-06, 1.375e-06, 1.1e-07, 6.6e-06),+ ("openai.gpt-5.6-terra", 2.2e-06, 2.75e-06, 2.2e-07, 1.32e-05),+ ("openai.gpt-5.6-luna", 2.2e-07, 2.75e-07, 2.2e-08, 1.32e-06),],)def test_gpt_5_6_pricing_and_mode(diff --git a/tests/test_litellm/test_gpt_5_6_model_metadata.py b/tests/test_litellm/test_gpt_5_6_model_metadata.pydeleted file mode 100644index b17ef32a1dc..00000000000--- a/tests/test_litellm/test_gpt_5_6_model_metadata.py+++ /dev/null@@ -1,166 +0,0 @@-import json-from pathlib import Path--import pytest--from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider--GPT_5_6_MODELS = ("gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna")--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),- "gpt-5.6-luna": (1e-06, 6e-06, 1e-07, 1.25e-06),-}--[email protected]("model", GPT_5_6_MODELS)-def test_openai_gpt_5_6_model_info(model):- json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json"- with open(json_path) as f:- model_cost = json.load(f)-- info = model_cost.get(model)- assert info is not None, f"{model} not found in model_prices_and_context_window.json"-- assert info["litellm_provider"] == "openai"- assert info["mode"] == "chat"-- input_cost, output_cost, cache_read_cost, cache_write_cost = OPENAI_STANDARD_PRICING[model]- assert info["input_cost_per_token"] == input_cost- assert info["output_cost_per_token"] == output_cost- assert info["cache_read_input_token_cost"] == cache_read_cost- assert info["cache_creation_input_token_cost"] == cache_write_cost- assert info["cache_creation_input_token_cost"] == pytest.approx(input_cost * 1.25)-- assert info["input_cost_per_token_above_272k_tokens"] == pytest.approx(input_cost * 2)- assert info["output_cost_per_token_above_272k_tokens"] == pytest.approx(output_cost * 1.5)- assert info["cache_read_input_token_cost_above_272k_tokens"] == pytest.approx(cache_read_cost * 2)-- assert info["max_input_tokens"] == 1050000- assert info["max_output_tokens"] == 128000- assert info["max_tokens"] == 128000-- assert info["supports_function_calling"] is True- assert info["supports_prompt_caching"] is True- assert info["supports_reasoning"] is True- assert info["supports_response_schema"] is True- assert info["supports_tool_choice"] is True- assert info["supports_vision"] is True- assert info["supports_web_search"] is True- assert info["supports_none_reasoning_effort"] is True- assert info["supports_xhigh_reasoning_effort"] is True- assert info["supports_minimal_reasoning_effort"] is False-- assert info["supported_endpoints"] == ["/v1/chat/completions", "/v1/batch", "/v1/responses"]- assert info["supported_modalities"] == ["text", "image"]- assert info["supported_output_modalities"] == ["text"]-- routed_model, provider, _, _ = get_llm_provider(model=f"openai/{model}")- assert routed_model == model- assert provider == "openai"---AZURE_GLOBAL_MODELS = (- "azure/gpt-5.6",- "azure/gpt-5.6-sol",- "azure/gpt-5.6-terra",- "azure/gpt-5.6-luna",-)--AZURE_REGIONAL_MODELS = tuple(- f"azure/{region}/{tier}"- for region in ("us", "eu")- for tier in ("gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna")-)---def _tier_key(azure_model):- return azure_model.split("/")[-1]---def _load_main():- json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json"- with open(json_path) as f:- return json.load(f)--[email protected]("model", AZURE_GLOBAL_MODELS)-def test_azure_gpt_5_6_global_model_info(model):- model_cost = _load_main()- info = model_cost.get(model)- assert info is not None, f"{model} not found in model_prices_and_context_window.json"-- assert info["litellm_provider"] == "azure"- assert info["mode"] == "chat"-- input_cost, output_cost, cache_read_cost, _ = AZURE_STANDARD_PRICING[_tier_key(model)]- assert info["input_cost_per_token"] == input_cost- assert info["output_cost_per_token"] == output_cost- assert info["cache_read_input_token_cost"] == cache_read_cost-- assert info["input_cost_per_token_above_272k_tokens"] == pytest.approx(input_cost * 2)- assert info["output_cost_per_token_above_272k_tokens"] == pytest.approx(output_cost * 1.5)- assert info["input_cost_per_token_priority"] == pytest.approx(input_cost * 2)- assert info["output_cost_per_token_priority"] == pytest.approx(output_cost * 2)- assert info["input_cost_per_token_above_272k_tokens_priority"] == pytest.approx(input_cost * 4)- assert info["output_cost_per_token_above_272k_tokens_priority"] == pytest.approx(output_cost * 3)-- assert info["max_input_tokens"] == 1050000- assert info["max_output_tokens"] == 128000- assert info["supports_reasoning"] is True-- routed_model, provider, _, _ = get_llm_provider(model=model)- assert provider == "azure"--[email protected]("model", AZURE_REGIONAL_MODELS)-def test_azure_gpt_5_6_regional_model_info(model):- model_cost = _load_main()- info = model_cost.get(model)- assert info is not None, f"{model} not found in model_prices_and_context_window.json"-- assert info["litellm_provider"] == "azure"- assert info["mode"] == "chat"-- 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)- assert info["cache_read_input_token_cost"] == pytest.approx(cache_read_cost * 1.1)- assert info["input_cost_per_token_above_272k_tokens"] == pytest.approx(input_cost * 2.2)- assert info["output_cost_per_token_above_272k_tokens"] == pytest.approx(output_cost * 1.65)- assert info["input_cost_per_token_priority"] == pytest.approx(input_cost * 2.75)- assert info["output_cost_per_token_priority"] == pytest.approx(output_cost * 2.75)-- assert info["max_input_tokens"] == 1050000- assert info["max_output_tokens"] == 128000- assert info["supports_reasoning"] is True-- _, provider, _, _ = get_llm_provider(model=model)- assert provider == "azure"---def test_gpt_5_6_backup_matches_main():- """Ensure the bundled model cost map stays in sync with the canonical file."""- repo_root = Path(__file__).parents[2]- main_path = repo_root / "model_prices_and_context_window.json"- backup_path = repo_root / "litellm" / "model_prices_and_context_window_backup.json"-- with open(main_path) as f:- main_cost = json.load(f)- with open(backup_path) as f:- backup_cost = json.load(f)-- for model in GPT_5_6_MODELS + AZURE_GLOBAL_MODELS + AZURE_REGIONAL_MODELS:- assert backup_cost.get(model) == main_cost.get(model), (- f"{model} differs between main and backup model cost maps"- )