diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index fea139a64b4..43dbabbedff 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -1971,6 +1971,8 @@ class Logging(LiteLLMLoggingBaseClass): event_type="sync_success" ): # prevent double logging return + if kwargs.get("response_cost") is not None: + self.model_call_details["response_cost"] = kwargs["response_cost"] start_time, end_time, result = self._success_handler_helper_fn( start_time=start_time, end_time=end_time, @@ -2443,6 +2445,9 @@ class Logging(LiteLLMLoggingBaseClass): ): # prevent double logging return + if kwargs.get("response_cost") is not None: + self.model_call_details["response_cost"] = kwargs["response_cost"] + ## CALCULATE COST FOR BATCH JOBS if self.call_type == CallTypes.aretrieve_batch.value and isinstance( result, LiteLLMBatch