From 6c6b26f35dd27497d8d3e4118d173fba95d5c048 Mon Sep 17 00:00:00 2001 From: Praveen11558 <44603409+Praveen11558@users.noreply.github.com> Date: Tue, 24 Mar 2026 23:39:42 +0530 Subject: [PATCH] Update litellm/litellm_core_utils/llm_cost_calc/utils.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/llm_cost_calc/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/llm_cost_calc/utils.py b/litellm/litellm_core_utils/llm_cost_calc/utils.py index 771b272d94e..acd3bbfc78d 100644 --- a/litellm/litellm_core_utils/llm_cost_calc/utils.py +++ b/litellm/litellm_core_utils/llm_cost_calc/utils.py @@ -677,7 +677,9 @@ def generic_cost_per_token( # noqa: PLR0915 # without being included in the per-token detail fields. When any of these are # active, a gap between accounted_tokens and prompt_tokens is expected and must # NOT be filled: - # - character_count / video_length_seconds: replace per-token billing entirely + # - character_count / video_length_seconds: the token gap between accounted_tokens + # and prompt_tokens is already covered by character/video-second billing; filling + # the gap into text_tokens would double-bill that content at the text rate. # - image_count: additive flat-rate billing; the image-URL tokens are already # reflected in prompt_tokens and billed separately via input_cost_per_image has_non_token_alternative_billing = (