Skip to content

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]

Proxy: include customer budget in responses (#5977)

kvadrose007bb65b5cd
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 9e214c6ca2b..d2684ec4cfc 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -6029,7 +6029,8 @@ async def end_user_info(
)
user_info = await prisma_client.db.litellm_endusertable.find_first(
- where={"user_id": end_user_id}
+ where={"user_id": end_user_id},
+ include={"litellm_budget_table": True}
)
if user_info is None:
@@ -6271,7 +6272,9 @@ async def list_team(
detail={"error": CommonProxyErrors.db_not_connected_error.value},
)
- response = await prisma_client.db.litellm_endusertable.find_many()
+ response = await prisma_client.db.litellm_endusertable.find_many(
+ include={"litellm_budget_table": True}
+ )
returned_response: List[LiteLLM_EndUserTable] = []
for item in response: