From 176a2653dac416d4b91eb9e01b7b51b6f2b67c1b Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Thu, 12 Mar 2026 15:38:08 +0800 Subject: [PATCH] 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 --- litellm/llms/anthropic/chat/transformation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py index fd1859f7d17..f1e571e8f2d 100644 --- a/litellm/llms/anthropic/chat/transformation.py +++ b/litellm/llms/anthropic/chat/transformation.py @@ -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(