From 561d84e40f5c493b37bf20b1c45b7bdedf52816f Mon Sep 17 00:00:00 2001 From: Sunny <25066078+LoSunny@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:24:15 +0800 Subject: [PATCH] Update endpoint URL construction in handler.py --- litellm/llms/anthropic/count_tokens/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/anthropic/count_tokens/handler.py b/litellm/llms/anthropic/count_tokens/handler.py index e70e0f19b33..2e000f6c08d 100644 --- a/litellm/llms/anthropic/count_tokens/handler.py +++ b/litellm/llms/anthropic/count_tokens/handler.py @@ -67,7 +67,7 @@ class AnthropicCountTokensHandler(AnthropicCountTokensConfig): verbose_logger.debug(f"Transformed request: {request_body}") # Get endpoint URL - endpoint_url = api_base or self.get_anthropic_count_tokens_endpoint() + endpoint_url = f"{api_base}/v1/messages/count_tokens" if api_base else self.get_anthropic_count_tokens_endpoint() verbose_logger.debug(f"Making request to: {endpoint_url}")