From c32aad035d8659e590bd7da774a7ac6176699eb1 Mon Sep 17 00:00:00 2001 From: Praveen11558 <44603409+Praveen11558@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:45:30 +0530 Subject: [PATCH] Update utils.py --- litellm/litellm_core_utils/llm_cost_calc/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/litellm_core_utils/llm_cost_calc/utils.py b/litellm/litellm_core_utils/llm_cost_calc/utils.py index dc29a5b6bea..4c77f7e5c7c 100644 --- a/litellm/litellm_core_utils/llm_cost_calc/utils.py +++ b/litellm/litellm_core_utils/llm_cost_calc/utils.py @@ -724,6 +724,8 @@ def generic_cost_per_token( # noqa: PLR0915 # present (character_count, video_length_seconds, or image_count), since # the gap may represent tokens already billed through those dimensions # and converting them to text_tokens would cause double-billing. + unaccounted_tokens = usage.prompt_tokens - accounted_tokens + prompt_tokens_details["text_tokens"] += unaccounted_tokens ( prompt_base_cost,