feat(anthropic): add Claude Opus 5.5 (#42489)

Adds the anthropic cost map entry for claude-opus-5-5 at $4/$20 per MTok
with $5 per MTok 5m cache writes, $8 per MTok 1h cache writes, $0.20 per
MTok cache reads (0.05x base), and fast mode at 2x. The entry sets
thinking_always_on (Opus 5.5 cannot turn thinking off) and
supports_forced_tool_use false (tool_choice required/named 400s, same as
Fable 5.1), mirrors that model by omitting thinking cache preservation,
and registers the model in the setup wizard provider list

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-09-22 09:52:35 -07:00 • committed by GitHub
parent 691c0d6596
commit c835a1a982
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 116 additions and 1 deletions

View file

@ -15008,6 +15008,49 @@
"supports_native_structured_output": true,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-5-5": {
"supports_anthropic_compaction": true,
"cache_creation_input_token_cost": 5e-06,
"cache_creation_input_token_cost_above_1hr": 8e-06,
"cache_read_input_token_cost": 2e-07,
"input_cost_per_token": 4e-06,
"litellm_provider": "anthropic",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 2e-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_adaptive_thinking": true,
"thinking_always_on": true,
"supports_mid_conversation_system": true,
"supports_assistant_prefill": false,
"supports_computer_use": true,
"supports_forced_tool_use": false,
"supports_function_calling": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_native_structured_output": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true,
"provider_specific_entry": {
"fast": 2.0
},
"supports_output_config": true,
"supports_speed": true,
"supports_fast_mode": true,
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-5": {
"supports_anthropic_compaction": true,
"cache_creation_input_token_cost": 6.25e-06,

View file

@ -53,13 +53,14 @@ PROVIDERS: Final[list[dict]] = [
{
"id": "anthropic",
"name": "Anthropic",
"description": "Claude Fable 5.1, Fable 5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6, Haiku 4.5",
"description": "Claude Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6, Haiku 4.5",
"env_key": "ANTHROPIC_API_KEY",
"key_hint": "sk-ant-...",
"test_model": "claude-haiku-4-5-20251001",
"models": [
"claude-fable-5-1",
"claude-fable-5",
"claude-opus-5-5",
"claude-opus-5",
"claude-sonnet-5",
"claude-opus-4-8",

View file

@ -15008,6 +15008,49 @@
"supports_native_structured_output": true,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-5-5": {
"supports_anthropic_compaction": true,
"cache_creation_input_token_cost": 5e-06,
"cache_creation_input_token_cost_above_1hr": 8e-06,
"cache_read_input_token_cost": 2e-07,
"input_cost_per_token": 4e-06,
"litellm_provider": "anthropic",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 2e-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_adaptive_thinking": true,
"thinking_always_on": true,
"supports_mid_conversation_system": true,
"supports_assistant_prefill": false,
"supports_computer_use": true,
"supports_forced_tool_use": false,
"supports_function_calling": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_native_structured_output": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true,
"provider_specific_entry": {
"fast": 2.0
},
"supports_output_config": true,
"supports_speed": true,
"supports_fast_mode": true,
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-5": {
"supports_anthropic_compaction": true,
"cache_creation_input_token_cost": 6.25e-06,

View file

@ -1,6 +1,8 @@
"""
Validate Claude Opus 5 model configuration entries.
Opus 5.5 (``claude-opus-5-5``) is covered here too.
Opus 5 carries Opus 4.8's pricing ($5 / $25 per MTok) and the gen-5 adaptive
thinking profile, but differs from 4.8 in two ways that are behavior-bearing in
LiteLLM: the cacheable-prefix minimum drops to 512 tokens, and Bedrock's Opus 5
@ -12,14 +14,23 @@ validator accepts the full effort ladder, so the entries must not carry the
``anthropic/*`` wildcard deployment).
"""
import json
import os
import pytest
from litellm.constants import BEDROCK_CONVERSE_MODELS
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap
REPO_ROOT = os.path.join(os.path.dirname(__file__), "../..")
def _load_root_cost_map() -> dict:
json_path = os.path.join(REPO_ROOT, "model_prices_and_context_window.json")
with open(json_path) as f:
return json.load(f)
ALL_OPUS_5_VARIANTS = (
"claude-opus-5",
"anthropic.claude-opus-5",
@ -58,3 +69,20 @@ def test_opus_5_registered_for_bedrock_converse():
assert "anthropic.claude-opus-5" in BEDROCK_CONVERSE_MODELS
def test_opus_5_5_present_in_bundled_backup():
backup = GetModelCostMap.load_local_model_cost_map()
root = _load_root_cost_map()
assert "claude-opus-5-5" in backup
assert "claude-opus-5-5" in root
assert backup["claude-opus-5-5"] == root["claude-opus-5-5"]
@pytest.mark.parametrize("model", ["claude-opus-5-5", "anthropic/claude-opus-5-5"])
def test_opus_5_5_thinking_profile(local_model_cost_map, model):
"""Opus 5.5 has thinking always on with the adaptive thinking surface, and
no forced tool use, same as Fable 5.1."""
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
assert AnthropicModelInfo._is_adaptive_thinking_model(model, "anthropic") is True
assert AnthropicModelInfo._is_always_on_thinking_model(model, "anthropic") is True
assert AnthropicModelInfo.forced_tool_use_unsupported(model.removeprefix("anthropic/")) is True