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(cost-map): match Bedrock GPT effort flags to what Bedrock accepts
mateo-berridbc57c13d431
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex a55cb6b571e..be4badedee4 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -55360,6 +55360,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55401,6 +55402,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55507,6 +55509,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55538,6 +55541,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55566,6 +55570,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55594,6 +55599,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55622,6 +55628,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55650,6 +55657,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55678,6 +55686,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55711,7 +55720,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,@@ -55742,7 +55753,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_tool_choice": true,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55772,7 +55785,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_tool_choice": true,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55809,7 +55824,6 @@"text"],"supports_function_calling": true,- "supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,@@ -55847,7 +55861,6 @@"text"],"supports_function_calling": true,- "supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex a55cb6b571e..be4badedee4 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -55360,6 +55360,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55401,6 +55402,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55507,6 +55509,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55538,6 +55541,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55566,6 +55570,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55594,6 +55599,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55622,6 +55628,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55650,6 +55657,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55678,6 +55686,7 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,"supports_tool_choice": true,"supports_reasoning": true,@@ -55711,7 +55720,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,@@ -55742,7 +55753,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_tool_choice": true,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55772,7 +55785,9 @@"text"],"supports_function_calling": true,+ "supports_max_reasoning_effort": true,"supports_minimal_reasoning_effort": false,+ "supports_none_reasoning_effort": false,"supports_tool_choice": true,"supports_prompt_caching": true,"supports_reasoning": true,@@ -55809,7 +55824,6 @@"text"],"supports_function_calling": true,- "supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,@@ -55847,7 +55861,6 @@"text"],"supports_function_calling": true,- "supports_minimal_reasoning_effort": false,"supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,diff --git a/tests/test_litellm/test_model_prices_schema.py b/tests/test_litellm/test_model_prices_schema.pyindex 69ee999f066..fcdb89003ac 100644--- a/tests/test_litellm/test_model_prices_schema.py+++ b/tests/test_litellm/test_model_prices_schema.py@@ -4,6 +4,7 @@ import importlib.utilimport jsonimport refrom pathlib import Path+from types import MappingProxyTypefrom typing import Finalimport jsonschema@@ -220,23 +221,47 @@ def test_chat_latest_declares_the_one_effort_openai_accepts(prices: dict):assert resolve_supported_reasoning_efforts(prices["chat-latest"], deployment_is_mapped=True) == ("medium",)-BEDROCK_OPENAI_XHIGH_MARKERS: Final = ("openai.gpt-5.4", "openai.gpt-5.5", "openai.gpt-5.6", "openai.gpt-6-astra")+BEDROCK_OPENAI_GPT_MARKERS: Final = ("openai.gpt-5.4", "openai.gpt-5.5", "openai.gpt-5.6", "openai.gpt-6-astra")BEDROCK_PROVIDERS: Final = frozenset(("bedrock", "bedrock_converse", "bedrock_mantle"))+BEDROCK_ROW_PREFIXES: Final = ("bedrock_mantle/", "us.", "global.")+GPT_5_4_BEDROCK_LADDER: Final = ("none", "minimal", "low", "medium", "high", "xhigh")+GPT_5_6_BEDROCK_LADDER: Final = ("none", "low", "medium", "high", "xhigh", "max")+GPT_6_ASTRA_BEDROCK_LADDER: Final = ("low", "medium", "high", "xhigh", "max")+BEDROCK_OPENAI_GPT_LADDERS: Final = MappingProxyType(+ {+ "bedrock_mantle/openai.gpt-5.4": GPT_5_4_BEDROCK_LADDER,+ "bedrock_mantle/openai.gpt-5.5": GPT_5_4_BEDROCK_LADDER,+ **{+ f"{prefix}openai.gpt-5.6-{variant}": GPT_5_6_BEDROCK_LADDER+ for prefix in BEDROCK_ROW_PREFIXES+ for variant in ("luna", "sol", "terra")+ },+ **{f"{prefix}openai.gpt-6-astra": GPT_6_ASTRA_BEDROCK_LADDER for prefix in BEDROCK_ROW_PREFIXES},+ }+)-def test_bedrock_openai_gpt_rows_mirror_their_openai_twins_effort_ladder(prices: dict):- """Bedrock forwards reasoning_effort to these models unchanged, and xhigh is opt-in for the- capability resolver, so a row without the flag drops xhigh from every group it belongs to.- The OpenAI twins reject minimal, and Bedrock forwards reasoning_effort unchanged."""- mismatched = [+ ("name", "ladder"), tuple(BEDROCK_OPENAI_GPT_LADDERS.items()), ids=tuple(BEDROCK_OPENAI_GPT_LADDERS)+)+def test_bedrock_openai_gpt_rows_advertise_the_ladder_bedrock_accepts(prices: dict, name: str, ladder: tuple[str, ...]):+ """Each ladder is the set of levels the Bedrock Mantle and Converse endpoints answered 200 to+ for that row on 2026-09-11 (PR #40740), which differs from the direct OpenAI rows in three+ places: Bedrock gpt-5.6 and gpt-6-astra take max, Bedrock gpt-5.4 and gpt-5.5 take minimal, and+ gpt-6-astra refuses none. xhigh and max are opt-in for the resolver, so a row missing either+ flag silently drops that level from every group it belongs to."""+ assert resolve_supported_reasoning_efforts(prices[name], deployment_is_mapped=True) == ladder+++def test_every_bedrock_openai_gpt_row_advertises_xhigh(prices: dict):+ """The GovCloud and gpt-5.6-cyber rows cannot be called from our account, so they carry the+ family's xhigh flag rather than a measured ladder."""+ missing: Final = [namefor name, entry in prices.items()if isinstance(entry, dict)and entry.get("litellm_provider") in BEDROCK_PROVIDERS- and any(marker in name for marker in BEDROCK_OPENAI_XHIGH_MARKERS)- and (- "xhigh" not in (resolve_supported_reasoning_efforts(entry, deployment_is_mapped=True) or ())- or "minimal" in (resolve_supported_reasoning_efforts(entry, deployment_is_mapped=True) or ())- )+ and any(marker in name for marker in BEDROCK_OPENAI_GPT_MARKERS)+ and "xhigh" not in (resolve_supported_reasoning_efforts(entry, deployment_is_mapped=True) or ())]- assert mismatched == []+ assert missing == []