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
feat(proxy): add LiteLLM_BudgetWindowSpend table for per-window budget spend
ryan-crabbe-berrid28621685a6b
diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260804162853_add_budget_window_spend_table/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260804162853_add_budget_window_spend_table/migration.sqlnew file mode 100644index 00000000000..45cc927a328--- /dev/null+++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260804162853_add_budget_window_spend_table/migration.sql@@ -0,0 +1,13 @@+-- CreateTable+CREATE TABLE IF NOT EXISTS "LiteLLM_BudgetWindowSpend" (+ "entity_type" TEXT NOT NULL,+ "entity_id" TEXT NOT NULL,+ "window_duration" TEXT NOT NULL,+ "window_start" TIMESTAMP(3) NOT NULL,+ "spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0,+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updated_at" TIMESTAMP(3) NOT NULL,++ CONSTRAINT "LiteLLM_BudgetWindowSpend_pkey" PRIMARY KEY ("entity_type","entity_id","window_duration")+);+diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prismaindex 2bb850139a2..7818e3acd56 100644--- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma+++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma@@ -649,6 +649,18 @@ model LiteLLM_SpendLogs {@@index([session_id])}+model LiteLLM_BudgetWindowSpend {+ entity_type String+ entity_id String+ window_duration String+ window_start DateTime+ spend Float @default(0.0)+ created_at DateTime @default(now())+ updated_at DateTime @updatedAt++ @@id([entity_type, entity_id, window_duration])+}+// View spend, model, api_key per requestmodel LiteLLM_ErrorLogs {request_id String @id @default(uuid())diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prismaindex 2bb850139a2..7818e3acd56 100644--- a/litellm/proxy/schema.prisma+++ b/litellm/proxy/schema.prisma@@ -649,6 +649,18 @@ model LiteLLM_SpendLogs {@@index([session_id])}+model LiteLLM_BudgetWindowSpend {+ entity_type String+ entity_id String+ window_duration String+ window_start DateTime+ spend Float @default(0.0)+ created_at DateTime @default(now())+ updated_at DateTime @updatedAt++ @@id([entity_type, entity_id, window_duration])+}+// View spend, model, api_key per requestmodel LiteLLM_ErrorLogs {request_id String @id @default(uuid())diff --git a/schema.prisma b/schema.prismaindex 2bb850139a2..7818e3acd56 100644--- a/schema.prisma+++ b/schema.prisma@@ -649,6 +649,18 @@ model LiteLLM_SpendLogs {@@index([session_id])}+model LiteLLM_BudgetWindowSpend {+ entity_type String+ entity_id String+ window_duration String+ window_start DateTime+ spend Float @default(0.0)+ created_at DateTime @default(now())+ updated_at DateTime @updatedAt++ @@id([entity_type, entity_id, window_duration])+}+// View spend, model, api_key per requestmodel LiteLLM_ErrorLogs {request_id String @id @default(uuid())diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.tsindex 6c5319f0361..c1a85a297c9 100644--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts@@ -26073,7 +26073,7 @@ export interface components {* @description Default role assigned to new users created* @default internal_user_viewer*/- user_role: ("proxy_admin" | "proxy_admin_viewer" | "internal_user" | "internal_user_viewer") | null;+ user_role: ("internal_user" | "internal_user_viewer" | "proxy_admin" | "proxy_admin_viewer") | null;};/*** DefaultTeamSSOParams