fix(anthropic): forward service_tier parameter to Anthropic API

Add service_tier to supported params and map it to the request body.
Valid values: 'auto' (Priority Tier if available) or 'standard_only'.

Closes BerriAI/litellm#23398
This commit is contained in:
OpenClaw Agent 2026-03-12 15:38:08 +08:00
parent e37efc4218
commit 176a2653da

View file

@ -195,6 +195,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
"speed",
"context_management",
"cache_control",
"service_tier",
]
if (
@ -1068,6 +1069,10 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
elif param == "cache_control" and isinstance(value, dict):
# Pass through top-level cache_control for automatic prompt caching
optional_params["cache_control"] = value
elif param == "service_tier" and isinstance(value, str):
# Pass through Anthropic service_tier for Priority Tier support
# Valid values: "auto", "standard_only"
optional_params["service_tier"] = value
## handle thinking tokens
self.update_optional_params_with_thinking_tokens(