The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
get_aggregated_db_spend_update_transactions
Ishaan Jaff811f488ca39f
diff --git a/litellm/proxy/db/spend_update_queue.py b/litellm/proxy/db/spend_update_queue.pyindex 2d9792ac854..d502c2cd848 100644--- a/litellm/proxy/db/spend_update_queue.py+++ b/litellm/proxy/db/spend_update_queue.py@@ -87,8 +87,9 @@ class SpendUpdateQueue:transactions_dict = {}db_spend_update_transactions[dict_key] = transactions_dict- transactions_dict[entity_id] = (- transactions_dict.get(entity_id, 0) + response_cost- )+ if entity_id not in transactions_dict:+ transactions_dict[entity_id] = 0++ transactions_dict[entity_id] += response_costreturn db_spend_update_transactions