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(bedrock_mantle): 1M context window and long-context pricing for GPT-5.6 Sol/Terra/Luna
mateoef305fe4ab56
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex b12e4a9fea3..9570c8d15de 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -45804,11 +45804,15 @@},"bedrock_mantle/openai.gpt-5.6-sol": {"input_cost_per_token": 5.5e-06,+ "input_cost_per_token_above_272k_tokens": 1.1e-05,"cache_creation_input_token_cost": 6.875e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 1.375e-05,"cache_read_input_token_cost": 5.5e-07,+ "cache_read_input_token_cost_above_272k_tokens": 1.1e-06,"output_cost_per_token": 3.3e-05,+ "output_cost_per_token_above_272k_tokens": 4.95e-05,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",@@ -45832,11 +45836,15 @@},"bedrock_mantle/openai.gpt-5.6-terra": {"input_cost_per_token": 2.2e-06,+ "input_cost_per_token_above_272k_tokens": 4.4e-06,"cache_creation_input_token_cost": 2.75e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,"cache_read_input_token_cost": 2.2e-07,+ "cache_read_input_token_cost_above_272k_tokens": 4.4e-07,"output_cost_per_token": 1.32e-05,+ "output_cost_per_token_above_272k_tokens": 1.98e-05,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",@@ -45860,11 +45868,15 @@},"bedrock_mantle/openai.gpt-5.6-luna": {"input_cost_per_token": 2.2e-07,+ "input_cost_per_token_above_272k_tokens": 4.4e-07,"cache_creation_input_token_cost": 2.75e-07,+ "cache_creation_input_token_cost_above_272k_tokens": 5.5e-07,"cache_read_input_token_cost": 2.2e-08,+ "cache_read_input_token_cost_above_272k_tokens": 4.4e-08,"output_cost_per_token": 1.32e-06,+ "output_cost_per_token_above_272k_tokens": 1.98e-06,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex b12e4a9fea3..9570c8d15de 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -45804,11 +45804,15 @@},"bedrock_mantle/openai.gpt-5.6-sol": {"input_cost_per_token": 5.5e-06,+ "input_cost_per_token_above_272k_tokens": 1.1e-05,"cache_creation_input_token_cost": 6.875e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 1.375e-05,"cache_read_input_token_cost": 5.5e-07,+ "cache_read_input_token_cost_above_272k_tokens": 1.1e-06,"output_cost_per_token": 3.3e-05,+ "output_cost_per_token_above_272k_tokens": 4.95e-05,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",@@ -45832,11 +45836,15 @@},"bedrock_mantle/openai.gpt-5.6-terra": {"input_cost_per_token": 2.2e-06,+ "input_cost_per_token_above_272k_tokens": 4.4e-06,"cache_creation_input_token_cost": 2.75e-06,+ "cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,"cache_read_input_token_cost": 2.2e-07,+ "cache_read_input_token_cost_above_272k_tokens": 4.4e-07,"output_cost_per_token": 1.32e-05,+ "output_cost_per_token_above_272k_tokens": 1.98e-05,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",@@ -45860,11 +45868,15 @@},"bedrock_mantle/openai.gpt-5.6-luna": {"input_cost_per_token": 2.2e-07,+ "input_cost_per_token_above_272k_tokens": 4.4e-07,"cache_creation_input_token_cost": 2.75e-07,+ "cache_creation_input_token_cost_above_272k_tokens": 5.5e-07,"cache_read_input_token_cost": 2.2e-08,+ "cache_read_input_token_cost_above_272k_tokens": 4.4e-08,"output_cost_per_token": 1.32e-06,+ "output_cost_per_token_above_272k_tokens": 1.98e-06,"litellm_provider": "bedrock_mantle",- "max_input_tokens": 272000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "responses",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 158cdb45f6b..5983607d708 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@@ -485,6 +485,70 @@ def test_generic_cost_per_token_minimax_m3_above_512k_tokens():assert round(completion_cost, 10) == round(expected_completion, 10)+ "model",+ [+ "bedrock_mantle/openai.gpt-5.6-sol",+ "bedrock_mantle/openai.gpt-5.6-terra",+ "bedrock_mantle/openai.gpt-5.6-luna",+ ],+)+def test_generic_cost_per_token_bedrock_mantle_gpt56_long_context(model):+ """Bedrock GPT-5.6 supports a 1M context window, billed at the long-context rates above 272K."""+ os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"+ litellm.model_cost = litellm.get_model_cost_map(url="")++ model_cost_map = litellm.model_cost[model]+ assert model_cost_map["max_input_tokens"] == 1000000++ cached_tokens = 100000+ completion_tokens = 1000++ short_prompt_tokens = 272000+ short_usage = Usage(+ prompt_tokens=short_prompt_tokens,+ completion_tokens=completion_tokens,+ total_tokens=short_prompt_tokens + completion_tokens,+ prompt_tokens_details=PromptTokensDetailsWrapper(cached_tokens=cached_tokens),+ )+ short_prompt_cost, short_completion_cost = generic_cost_per_token(+ model=model,+ usage=short_usage,+ custom_llm_provider="bedrock_mantle",+ )+ assert round(short_prompt_cost, 10) == round(+ model_cost_map["input_cost_per_token"] * (short_prompt_tokens - cached_tokens)+ + model_cost_map["cache_read_input_token_cost"] * cached_tokens,+ 10,+ )+ assert round(short_completion_cost, 10) == round(+ model_cost_map["output_cost_per_token"] * completion_tokens, 10+ )++ long_prompt_tokens = 900000+ long_usage = Usage(+ prompt_tokens=long_prompt_tokens,+ completion_tokens=completion_tokens,+ total_tokens=long_prompt_tokens + completion_tokens,+ prompt_tokens_details=PromptTokensDetailsWrapper(cached_tokens=cached_tokens),+ )+ long_prompt_cost, long_completion_cost = generic_cost_per_token(+ model=model,+ usage=long_usage,+ custom_llm_provider="bedrock_mantle",+ )+ assert round(long_prompt_cost, 10) == round(+ model_cost_map["input_cost_per_token_above_272k_tokens"]+ * (long_prompt_tokens - cached_tokens)+ + model_cost_map["cache_read_input_token_cost_above_272k_tokens"]+ * cached_tokens,+ 10,+ )+ assert round(long_completion_cost, 10) == round(+ model_cost_map["output_cost_per_token_above_272k_tokens"] * completion_tokens, 10+ )++def test_generic_cost_per_token_honors_non_standard_above_threshold():"""Regression for #30344: get_model_info must keep arbitraryinput/output_cost_per_token_above_<N>_tokens thresholds, not only the hard-coded