mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
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:
parent
5e4b3838aa
commit
4fb1440747
1 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue