From 84fd1ac86c582d113284dfd93318cabec61a7902 Mon Sep 17 00:00:00 2001 From: naaa760 Date: Fri, 20 Mar 2026 15:43:19 +0530 Subject: [PATCH] Fix spend tracking for anthropic_messages and allm_passthrough_route --- litellm/cost_calculator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 29d28b8c896..eb781dd7a55 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -1066,6 +1066,8 @@ def completion_cost( # noqa: PLR0915 """ try: call_type = _infer_call_type(call_type, completion_response) or "completion" + if call_type in ("anthropic_messages", "allm_passthrough_route"): + call_type = "completion" if ( (call_type == "aimage_generation" or call_type == "image_generation") @@ -1664,6 +1666,8 @@ def response_cost_calculator( "aembedding", "completion", "acompletion", + "anthropic_messages", + "allm_passthrough_route", "atext_completion", "text_completion", "image_generation",