diff --git a/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py b/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py index 93e5be6311..594b59989a 100644 --- a/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py +++ b/litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py @@ -104,7 +104,12 @@ class StandardBuiltInToolCostTracking: ) -> bool: for _choice in response_object.choices: message = getattr(_choice, "message", None) - if message is not None and hasattr(message, "annotations"): + if ( + message is not None + and hasattr(message, "annotations") + and message.annotations is not None + and len(message.annotations) > 0 + ): return True return False