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]

docs(proxy): clarify spend semantics on /v2/user/info and /user/daily/activity

Devin AI4fb1440747d7
diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py
index 9a98bdbb6b1..73e993b37a1 100644
--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py
+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py
@@ -997,6 +997,13 @@ async def user_info_v2(
This is the v2 replacement for /user/info, designed to avoid the "god endpoint" problem
where the old endpoint loaded all keys and teams into memory.
+ Note on `spend`: this is the user's running budget counter, which is zeroed by the
+ budget reset job whenever `budget_reset_at` elapses (see `budget_duration`). It is NOT
+ lifetime or per-period historical spend. For historical spend over a date range, use
+ `/user/daily/activity` or `/user/daily/activity/aggregated`, which read immutable daily
+ spend records that are never reset. The two values are expected to diverge once a
+ budget reset has occurred within the queried period.
+
Access control:
- Proxy admins can query any user
- Team admins can query users within their teams
@@ -2687,6 +2694,10 @@ async def get_user_daily_activity(
Meant to optimize querying spend data for analytics for a user.
+ Reads immutable daily spend records, which are never affected by budget resets.
+ This can legitimately exceed the `spend` field returned by `/v2/user/info`, which
+ is a running budget counter zeroed on every budget reset.
+
Returns:
(by date)
- spend
@@ -2800,6 +2811,10 @@ async def get_user_daily_activity_aggregated(
"""
Aggregated analytics for a user's daily activity without pagination.
Returns the same response shape as the paginated endpoint with page metadata set to single-page.
+
+ Reads immutable daily spend records, which are never affected by budget resets.
+ This can legitimately exceed the `spend` field returned by `/v2/user/info`, which
+ is a running budget counter zeroed on every budget reset.
"""
from litellm.proxy.proxy_server import prisma_client