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
docs(proxy): account for budget rollover and daily upserts in spend wording
mateo-berrie938e89d138e
diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.pyindex 73e993b37a1..6edb75eacb4 100644--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py@@ -997,12 +997,13 @@ async def user_info_v2(This is the v2 replacement for /user/info, designed to avoid the "god endpoint" problemwhere 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+ Note on `spend`: this is the user's running budget counter, which the budget reset job+ resets whenever `budget_reset_at` elapses (see `budget_duration`): to zero by default,+ or to the overage above `max_budget` when `budget_rollover` is enabled. It is NOTlifetime 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.+ `/user/daily/activity` or `/user/daily/activity/aggregated`, which read daily spend+ records that only ever accumulate and 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@@ -2694,9 +2695,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.+ Reads daily spend records that only ever accumulate and are never affected by budget+ resets. Their total can legitimately exceed the `spend` field returned by+ `/v2/user/info`, which is a running budget counter that every budget reset sets back+ to zero (or to the overage above `max_budget` when `budget_rollover` is enabled).Returns:(by date)@@ -2812,9 +2814,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.+ Reads daily spend records that only ever accumulate and are never affected by budget+ resets. Their total can legitimately exceed the `spend` field returned by+ `/v2/user/info`, which is a running budget counter that every budget reset sets back+ to zero (or to the overage above `max_budget` when `budget_rollover` is enabled)."""from litellm.proxy.proxy_server import prisma_clientdiff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.tsindex b4526834b98..1599db10c7c 100644--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts@@ -16210,9 +16210,10 @@ export interface paths {** 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.+ * Reads daily spend records that only ever accumulate and are never affected by budget+ * resets. Their total can legitimately exceed the `spend` field returned by+ * `/v2/user/info`, which is a running budget counter that every budget reset sets back+ * to zero (or to the overage above `max_budget` when `budget_rollover` is enabled).** Returns:* (by date)@@ -16246,9 +16247,10 @@ export interface paths {* @description 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.+ * Reads daily spend records that only ever accumulate and are never affected by budget+ * resets. Their total can legitimately exceed the `spend` field returned by+ * `/v2/user/info`, which is a running budget counter that every budget reset sets back+ * to zero (or to the overage above `max_budget` when `budget_rollover` is enabled).*/get: operations["get_user_daily_activity_aggregated_user_daily_activity_aggregated_get"];put?: never;@@ -21012,12 +21014,13 @@ export interface paths {* 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+ * Note on `spend`: this is the user's running budget counter, which the budget reset job+ * resets whenever `budget_reset_at` elapses (see `budget_duration`): to zero by default,+ * or to the overage above `max_budget` when `budget_rollover` is enabled. 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.+ * `/user/daily/activity` or `/user/daily/activity/aggregated`, which read daily spend+ * records that only ever accumulate and 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