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(azure_ai): advertise 1M context window for Claude Opus 4.6+ on Foundry
shivam593b12dc566e
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex d43eda39b1f..ccce2f20e0c 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -2887,7 +2887,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",@@ -2916,7 +2916,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",@@ -3010,7 +3010,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 749b2566c2a..ebe99a77d8b 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -2887,7 +2887,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",@@ -2916,7 +2916,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",@@ -3010,7 +3010,7 @@"input_cost_per_token": 5e-06,"output_cost_per_token": 2.5e-05,"litellm_provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",diff --git a/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py b/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.pyindex 1a38b5dc769..2c7bd8d9b65 100644--- a/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py+++ b/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py@@ -209,3 +209,28 @@ def test_shipped_backup_marks_claude_4_6_plus_adaptive_not_4_0():"claude-opus-4-5",]:assert "supports_adaptive_thinking" not in backup[non_adaptive], non_adaptive+++def test_azure_ai_claude_1m_context_entries():+ """Microsoft Foundry serves a 1M-token context window for Opus 4.6+ and Sonnet+ 4.6+, so the ``azure_ai`` entries must not advertise the 200k cap that made+ context-aware clients compact prompts early (LIT-4406)."""+ backup = GetModelCostMap.load_local_model_cost_map()++ for model in [+ "azure_ai/claude-opus-4-6",+ "azure_ai/claude-opus-4-7",+ "azure_ai/claude-opus-4-8",+ "azure_ai/claude-opus-5",+ "azure_ai/claude-sonnet-5",+ "azure_ai/claude-sonnet-4-6",+ ]:+ assert backup[model]["max_input_tokens"] == 1000000, model++ for model in [+ "azure_ai/claude-opus-4-1",+ "azure_ai/claude-opus-4-5",+ "azure_ai/claude-sonnet-4-5",+ "azure_ai/claude-haiku-4-5",+ ]:+ assert backup[model]["max_input_tokens"] == 200000, modeldiff --git a/tests/test_litellm/test_claude_opus_4_6_config.py b/tests/test_litellm/test_claude_opus_4_6_config.pyindex d946d1b41af..89d2cd916e0 100644--- a/tests/test_litellm/test_claude_opus_4_6_config.py+++ b/tests/test_litellm/test_claude_opus_4_6_config.py@@ -102,7 +102,7 @@ def test_opus_4_6_model_pricing_and_capabilities():"azure_ai/claude-opus-4-6": {"provider": "azure_ai","has_long_context_pricing": False,- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,},}diff --git a/tests/test_litellm/test_claude_opus_4_8_config.py b/tests/test_litellm/test_claude_opus_4_8_config.pyindex 8eead8a9c84..f9f9214295a 100644--- a/tests/test_litellm/test_claude_opus_4_8_config.py+++ b/tests/test_litellm/test_claude_opus_4_8_config.py@@ -60,10 +60,9 @@ def test_opus_4_8_model_pricing_and_capabilities():"provider": "vertex_ai-anthropic_models","max_input_tokens": 1000000,},- # Microsoft Foundry / Azure caps Opus 4.8 at a 200k context window."azure_ai/claude-opus-4-8": {"provider": "azure_ai",- "max_input_tokens": 200000,+ "max_input_tokens": 1000000,},}