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
Remove max support for opus 4.7
Sameer Kankute07d863b8e78b
diff --git a/docs/my-website/blog/claude_opus_4_7/index.md b/docs/my-website/blog/claude_opus_4_7/index.mdindex 17c45e58de4..851a0556c4c 100644--- a/docs/my-website/blog/claude_opus_4_7/index.md+++ b/docs/my-website/blog/claude_opus_4_7/index.md@@ -221,7 +221,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \### Adaptive Thinking:::note-When using `reasoning_effort` with Claude Opus 4.7, all values (`low`, `medium`, `high`, `xhigh`, `max`) are mapped to `thinking: {type: "adaptive"}`. To use explicit thinking budgets with `type: "enabled"`, pass the native `thinking` parameter directly.+When using `reasoning_effort` with Claude Opus 4.7, all values (`low`, `medium`, `high`, `xhigh`) are mapped to `thinking: {type: "adaptive"}`. To use explicit thinking budgets with `type: "enabled"`, pass the native `thinking` parameter directly.:::<Tabs>@@ -274,9 +274,9 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \### Effort Levels-Claude Opus 4.7 supports five effort levels: `low`, `medium`, `high` (default), `xhigh`, and `max`. These give you finer-grained control over how much reasoning the model applies to a task. Pass the effort level via the `output_config` parameter.+Claude Opus 4.7 supports four effort levels: `low`, `medium`, `high` (default), and `xhigh`. These give you finer-grained control over how much reasoning the model applies to a task. Pass the effort level via the `output_config` parameter.-`xhigh` is a new effort level introduced with Opus 4.7 that sits between `high` and `max`. `max` is available on Claude Opus 4.6 and 4.7 only.+`xhigh` is a new effort level introduced with Opus 4.7 that sits above `high`. The `max` effort level is Claude Opus 4.6 only and is not available on 4.7.<Tabs><TabItem value="completions" label="/chat/completions">@@ -294,7 +294,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \}],"output_config": {- "effort": "max"+ "effort": "xhigh"}}'```@@ -312,7 +312,7 @@ client = openai.OpenAI(response = client.chat.completions.create(model="claude-opus-4-7",messages=[{"role": "user", "content": "Explain quantum computing"}],- extra_body={"output_config": {"effort": "max"}}+ extra_body={"output_config": {"effort": "xhigh"}})```@@ -324,7 +324,7 @@ from litellm import completionresponse = completion(model="anthropic/claude-opus-4-7",messages=[{"role": "user", "content": "Explain quantum computing"}],- output_config={"effort": "max"},+ output_config={"effort": "xhigh"},)```@@ -347,7 +347,7 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \}],"output_config": {- "effort": "max"+ "effort": "xhigh"}}'```@@ -362,6 +362,5 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \| `low` | Short, fast responses — simple lookups, formatting, classification || `medium` | Balanced tradeoff for everyday Q&A and light reasoning || `high` (default) | Complex reasoning, code generation, analysis |-| `xhigh` | Harder reasoning than `high` when `max` is overkill — tough debugging, non-trivial planning |-| `max` | Hardest problems — multi-step math, deep research, agentic planning (Opus 4.6 and 4.7 only) |+| `xhigh` | Hardest problems — multi-step math, deep research, agentic planning |diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.pyindex eca41b3c8d3..6e6078728eb 100644--- a/litellm/llms/anthropic/chat/transformation.py+++ b/litellm/llms/anthropic/chat/transformation.py@@ -1534,13 +1534,11 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):f"Invalid effort value: {effort}. Must be one of: "f"'high', 'medium', 'low', 'xhigh', 'max'")- # ``max`` is Claude Opus 4.6 and 4.7 only (not Sonnet 4.6, not Opus 4.5).+ # ``max`` is Claude Opus 4.6 only (not Sonnet 4.6, not Opus 4.5/4.7).# Keep this hardcoded so the error message is specific and stable.- if effort == "max" and not (- self._is_opus_4_6_model(model) or self._is_opus_4_7_model(model)- ):+ if effort == "max" and not self._is_opus_4_6_model(model):raise ValueError(- f"effort='max' is only supported by Claude Opus 4.6 and 4.7. "+ f"effort='max' is only supported by Claude Opus 4.6. "f"Got model: {model}")# ``xhigh`` is data-driven via ``supports_xhigh_reasoning_effort`` sodiff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 98e79e11371..5e0f1ec5c9b 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -1146,8 +1146,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"global.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.25e-06,@@ -1175,8 +1174,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"us.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1204,8 +1202,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"eu.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1233,8 +1230,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"au.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1262,8 +1258,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"anthropic.claude-sonnet-4-6": {"cache_creation_input_token_cost": 3.75e-06,@@ -1944,8 +1939,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 159,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 159},"azure_ai/claude-opus-4-1": {"cache_creation_input_token_cost": 1.875e-05,@@ -9173,8 +9167,7 @@"provider_specific_entry": {"us": 1.1,"fast": 6.0- },- "supports_max_reasoning_effort": true+ }},"claude-opus-4-7-20260416": {"cache_creation_input_token_cost": 6.25e-06,@@ -9206,8 +9199,7 @@"provider_specific_entry": {"us": 1.1,"fast": 6.0- },- "supports_max_reasoning_effort": true+ }},"claude-sonnet-4-20250514": {"deprecation_date": "2026-05-14",@@ -31355,8 +31347,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 346,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 346},"vertex_ai/claude-opus-4-7@default": {"cache_creation_input_token_cost": 6.25e-06,@@ -31383,8 +31374,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 346,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 346},"vertex_ai/claude-sonnet-4-5": {"cache_creation_input_token_cost": 3.75e-06,diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 98e79e11371..5e0f1ec5c9b 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -1146,8 +1146,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"global.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.25e-06,@@ -1175,8 +1174,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"us.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1204,8 +1202,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"eu.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1233,8 +1230,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"au.anthropic.claude-opus-4-7": {"cache_creation_input_token_cost": 6.875e-06,@@ -1262,8 +1258,7 @@"supports_vision": true,"supports_xhigh_reasoning_effort": true,"tool_use_system_prompt_tokens": 346,- "supports_native_structured_output": true,- "supports_max_reasoning_effort": true+ "supports_native_structured_output": true},"anthropic.claude-sonnet-4-6": {"cache_creation_input_token_cost": 3.75e-06,@@ -1944,8 +1939,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 159,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 159},"azure_ai/claude-opus-4-1": {"cache_creation_input_token_cost": 1.875e-05,@@ -9173,8 +9167,7 @@"provider_specific_entry": {"us": 1.1,"fast": 6.0- },- "supports_max_reasoning_effort": true+ }},"claude-opus-4-7-20260416": {"cache_creation_input_token_cost": 6.25e-06,@@ -9206,8 +9199,7 @@"provider_specific_entry": {"us": 1.1,"fast": 6.0- },- "supports_max_reasoning_effort": true+ }},"claude-sonnet-4-20250514": {"deprecation_date": "2026-05-14",@@ -31355,8 +31347,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 346,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 346},"vertex_ai/claude-opus-4-7@default": {"cache_creation_input_token_cost": 6.25e-06,@@ -31383,8 +31374,7 @@"supports_tool_choice": true,"supports_vision": true,"supports_xhigh_reasoning_effort": true,- "tool_use_system_prompt_tokens": 346,- "supports_max_reasoning_effort": true+ "tool_use_system_prompt_tokens": 346},"vertex_ai/claude-sonnet-4-5": {"cache_creation_input_token_cost": 3.75e-06,