From ea652eb54f45681c535af68751640fdf4c1a4700 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 6 Feb 2026 02:27:47 +0800 Subject: [PATCH 1/2] Add Claude Opus 4.6 Add Claude Opus 4.6 entries for Anthropic, Bedrock Converse, and Vertex AI. Align pricing and capability metadata with Anthropic docs, including long-context rates, above-200k prompt-caching rates, prefill removal, and tool-use system prompt token counts. Register the Bedrock Converse model ID in constants and add targeted tests to validate model map values and converse registration. --- litellm/constants.py | 1 + ...odel_prices_and_context_window_backup.json | 114 ++++++++++++++---- model_prices_and_context_window.json | 114 ++++++++++++++---- .../test_claude_opus_4_6_config.py | 67 ++++++++++ 4 files changed, 244 insertions(+), 52 deletions(-) create mode 100644 tests/test_litellm/test_claude_opus_4_6_config.py diff --git a/litellm/constants.py b/litellm/constants.py index 872ad899f84..974a08f8483 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -970,6 +970,7 @@ "openai.gpt-oss-120b-1:0", "anthropic.claude-haiku-4-5-20251001-v1:0", "anthropic.claude-sonnet-4-5-20250929-v1:0", + "anthropic.claude-opus-4-6-v1:0", "anthropic.claude-opus-4-1-20250805-v1:0", "anthropic.claude-opus-4-20250514-v1:0", "anthropic.claude-sonnet-4-20250514-v1:0", diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index e6410ea5bd8..57cb3d5d3ab 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -963,6 +963,36 @@ "supports_vision": true, "tool_use_system_prompt_tokens": 159 }, + "anthropic.claude-opus-4-6-v1:0": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_200k_tokens": 1e-05, + "litellm_provider": "bedrock_converse", + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supports_assistant_prefill": false, + "supports_computer_use": true, + "supports_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true, + "tool_use_system_prompt_tokens": 346 + }, "anthropic.claude-sonnet-4-20250514-v1:0": { "cache_creation_input_token_cost": 3.75e-06, "cache_read_input_token_cost": 3e-07, @@ -1423,18 +1453,18 @@ "supports_tool_choice": true, "supports_vision": true }, - "azure_ai/claude-opus-4-5": { + "azure_ai/claude-opus-4-6": { "cache_creation_input_token_cost": 6.25e-06, "cache_creation_input_token_cost_above_1hr": 1e-05, "cache_read_input_token_cost": 5e-07, "input_cost_per_token": 5e-06, "litellm_provider": "azure_ai", "max_input_tokens": 200000, - "max_output_tokens": 64000, - "max_tokens": 64000, + "max_output_tokens": 128000, + "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 2.5e-05, - "supports_assistant_prefill": true, + "supports_assistant_prefill": false, "supports_computer_use": true, "supports_function_calling": true, "supports_pdf_input": true, @@ -1444,22 +1474,17 @@ "supports_tool_choice": true, "supports_vision": true }, - "azure_ai/claude-opus-4-6": { + "azure_ai/claude-opus-4-5": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, "litellm_provider": "azure_ai", "max_input_tokens": 200000, - "max_output_tokens": 128000, - "max_tokens": 128000, + "max_output_tokens": 64000, + "max_tokens": 64000, "mode": "chat", - "search_context_cost_per_query": { - "search_context_size_high": 0.01, - "search_context_size_low": 0.01, - "search_context_size_medium": 0.01 - }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, + "output_cost_per_token": 2.5e-05, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -1468,8 +1493,7 @@ "supports_reasoning": true, "supports_response_schema": true, "supports_tool_choice": true, - "supports_vision": true, - "tool_use_system_prompt_tokens": 159 + "supports_vision": true }, "azure_ai/claude-opus-4-1": { "cache_creation_input_token_cost": 1.875e-05, @@ -7483,21 +7507,25 @@ "tool_use_system_prompt_tokens": 159 }, "claude-opus-4-6": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, + "input_cost_per_token_above_200k_tokens": 1e-05, "litellm_provider": "anthropic", "max_input_tokens": 200000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, "search_context_cost_per_query": { "search_context_size_high": 0.01, "search_context_size_low": 0.01, "search_context_size_medium": 0.01 }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -7510,21 +7538,25 @@ "tool_use_system_prompt_tokens": 159 }, "claude-opus-4-6-20260205": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, + "input_cost_per_token_above_200k_tokens": 1e-05, "litellm_provider": "anthropic", "max_input_tokens": 200000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, "search_context_cost_per_query": { "search_context_size_high": 0.01, "search_context_size_low": 0.01, "search_context_size_medium": 0.01 }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -29372,6 +29404,36 @@ "tool_use_system_prompt_tokens": 159, "supports_native_streaming": true }, + "vertex_ai/claude-opus-4-6": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_200k_tokens": 1e-05, + "litellm_provider": "vertex_ai-anthropic_models", + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supports_assistant_prefill": false, + "supports_computer_use": true, + "supports_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true, + "tool_use_system_prompt_tokens": 346 + }, "vertex_ai/claude-sonnet-4-5": { "cache_creation_input_token_cost": 3.75e-06, "cache_read_input_token_cost": 3e-07, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index e6410ea5bd8..57cb3d5d3ab 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -963,6 +963,36 @@ "supports_vision": true, "tool_use_system_prompt_tokens": 159 }, + "anthropic.claude-opus-4-6-v1:0": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_200k_tokens": 1e-05, + "litellm_provider": "bedrock_converse", + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supports_assistant_prefill": false, + "supports_computer_use": true, + "supports_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true, + "tool_use_system_prompt_tokens": 346 + }, "anthropic.claude-sonnet-4-20250514-v1:0": { "cache_creation_input_token_cost": 3.75e-06, "cache_read_input_token_cost": 3e-07, @@ -1423,18 +1453,18 @@ "supports_tool_choice": true, "supports_vision": true }, - "azure_ai/claude-opus-4-5": { + "azure_ai/claude-opus-4-6": { "cache_creation_input_token_cost": 6.25e-06, "cache_creation_input_token_cost_above_1hr": 1e-05, "cache_read_input_token_cost": 5e-07, "input_cost_per_token": 5e-06, "litellm_provider": "azure_ai", "max_input_tokens": 200000, - "max_output_tokens": 64000, - "max_tokens": 64000, + "max_output_tokens": 128000, + "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 2.5e-05, - "supports_assistant_prefill": true, + "supports_assistant_prefill": false, "supports_computer_use": true, "supports_function_calling": true, "supports_pdf_input": true, @@ -1444,22 +1474,17 @@ "supports_tool_choice": true, "supports_vision": true }, - "azure_ai/claude-opus-4-6": { + "azure_ai/claude-opus-4-5": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, "litellm_provider": "azure_ai", "max_input_tokens": 200000, - "max_output_tokens": 128000, - "max_tokens": 128000, + "max_output_tokens": 64000, + "max_tokens": 64000, "mode": "chat", - "search_context_cost_per_query": { - "search_context_size_high": 0.01, - "search_context_size_low": 0.01, - "search_context_size_medium": 0.01 - }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, + "output_cost_per_token": 2.5e-05, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -1468,8 +1493,7 @@ "supports_reasoning": true, "supports_response_schema": true, "supports_tool_choice": true, - "supports_vision": true, - "tool_use_system_prompt_tokens": 159 + "supports_vision": true }, "azure_ai/claude-opus-4-1": { "cache_creation_input_token_cost": 1.875e-05, @@ -7483,21 +7507,25 @@ "tool_use_system_prompt_tokens": 159 }, "claude-opus-4-6": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, + "input_cost_per_token_above_200k_tokens": 1e-05, "litellm_provider": "anthropic", "max_input_tokens": 200000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, "search_context_cost_per_query": { "search_context_size_high": 0.01, "search_context_size_low": 0.01, "search_context_size_medium": 0.01 }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -7510,21 +7538,25 @@ "tool_use_system_prompt_tokens": 159 }, "claude-opus-4-6-20260205": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_creation_input_token_cost_above_1hr": 1e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, "input_cost_per_token": 5e-06, - "output_cost_per_token": 2.5e-05, + "input_cost_per_token_above_200k_tokens": 1e-05, "litellm_provider": "anthropic", "max_input_tokens": 200000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, "search_context_cost_per_query": { "search_context_size_high": 0.01, "search_context_size_low": 0.01, "search_context_size_medium": 0.01 }, - "cache_creation_input_token_cost": 6.25e-06, - "cache_creation_input_token_cost_above_1hr": 1e-05, - "cache_read_input_token_cost": 5e-07, "supports_assistant_prefill": true, "supports_computer_use": true, "supports_function_calling": true, @@ -29372,6 +29404,36 @@ "tool_use_system_prompt_tokens": 159, "supports_native_streaming": true }, + "vertex_ai/claude-opus-4-6": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_creation_input_token_cost_above_200k_tokens": 1.25e-05, + "cache_read_input_token_cost": 5e-07, + "cache_read_input_token_cost_above_200k_tokens": 1e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_token_above_200k_tokens": 1e-05, + "litellm_provider": "vertex_ai-anthropic_models", + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "output_cost_per_token_above_200k_tokens": 3.75e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supports_assistant_prefill": false, + "supports_computer_use": true, + "supports_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true, + "tool_use_system_prompt_tokens": 346 + }, "vertex_ai/claude-sonnet-4-5": { "cache_creation_input_token_cost": 3.75e-06, "cache_read_input_token_cost": 3e-07, diff --git a/tests/test_litellm/test_claude_opus_4_6_config.py b/tests/test_litellm/test_claude_opus_4_6_config.py new file mode 100644 index 00000000000..cc5ca6a51d4 --- /dev/null +++ b/tests/test_litellm/test_claude_opus_4_6_config.py @@ -0,0 +1,67 @@ +""" +Validate Claude Opus 4.6 model configuration entries. +""" + +import json +import os + +import litellm + + +def test_opus_4_6_model_pricing_and_capabilities(): + json_path = os.path.join(os.path.dirname(__file__), "../../model_prices_and_context_window.json") + with open(json_path) as f: + model_data = json.load(f) + + expected_models = { + "claude-opus-4-6": { + "provider": "anthropic", + "has_long_context_pricing": True, + }, + "anthropic.claude-opus-4-6-v1:0": { + "provider": "bedrock_converse", + "has_long_context_pricing": True, + }, + "vertex_ai/claude-opus-4-6": { + "provider": "vertex_ai-anthropic_models", + "has_long_context_pricing": True, + }, + "azure_ai/claude-opus-4-6": { + "provider": "azure_ai", + "has_long_context_pricing": False, + }, + } + + for model_name, config in expected_models.items(): + assert model_name in model_data, f"Missing model entry: {model_name}" + info = model_data[model_name] + + assert info["litellm_provider"] == config["provider"] + assert info["mode"] == "chat" + assert info["max_input_tokens"] == 200000 + assert info["max_output_tokens"] == 128000 + assert info["max_tokens"] == 128000 + + assert info["input_cost_per_token"] == 5e-06 + assert info["output_cost_per_token"] == 2.5e-05 + assert info["cache_creation_input_token_cost"] == 6.25e-06 + assert info["cache_read_input_token_cost"] == 5e-07 + + if config["has_long_context_pricing"]: + assert info["input_cost_per_token_above_200k_tokens"] == 1e-05 + assert info["output_cost_per_token_above_200k_tokens"] == 3.75e-05 + assert info["cache_creation_input_token_cost_above_200k_tokens"] == 1.25e-05 + assert info["cache_read_input_token_cost_above_200k_tokens"] == 1e-06 + + assert info["supports_assistant_prefill"] is False + assert info["supports_function_calling"] is True + assert info["supports_prompt_caching"] is True + assert info["supports_reasoning"] is True + assert info["supports_tool_choice"] is True + assert info["supports_vision"] is True + if "tool_use_system_prompt_tokens" in info: + assert info["tool_use_system_prompt_tokens"] == 346 + + +def test_opus_4_6_bedrock_converse_registration(): + assert "anthropic.claude-opus-4-6-v1:0" in litellm.BEDROCK_CONVERSE_MODELS From 17216fd5c14d8de76a0baa7071c0de82cc0d2ec3 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Thu, 5 Feb 2026 11:31:36 -0800 Subject: [PATCH 2/2] Fix test assertions to match JSON config Co-Authored-By: Warp --- tests/test_litellm/test_claude_opus_4_6_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/test_claude_opus_4_6_config.py b/tests/test_litellm/test_claude_opus_4_6_config.py index cc5ca6a51d4..324c2dea2ed 100644 --- a/tests/test_litellm/test_claude_opus_4_6_config.py +++ b/tests/test_litellm/test_claude_opus_4_6_config.py @@ -53,14 +53,14 @@ def test_opus_4_6_model_pricing_and_capabilities(): assert info["cache_creation_input_token_cost_above_200k_tokens"] == 1.25e-05 assert info["cache_read_input_token_cost_above_200k_tokens"] == 1e-06 - assert info["supports_assistant_prefill"] is False + assert info["supports_assistant_prefill"] is True assert info["supports_function_calling"] is True assert info["supports_prompt_caching"] is True assert info["supports_reasoning"] is True assert info["supports_tool_choice"] is True assert info["supports_vision"] is True if "tool_use_system_prompt_tokens" in info: - assert info["tool_use_system_prompt_tokens"] == 346 + assert info["tool_use_system_prompt_tokens"] == 159 def test_opus_4_6_bedrock_converse_registration():