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

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-08-30 07:40:56 +00:00
parent 5e4b3838aa
commit 4fb1440747

View file

@ -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