diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index b470eba64e..976b5e1508 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -169,6 +169,7 @@ model LiteLLM_VerificationToken { budget_duration String? budget_reset_at DateTime? allowed_cache_controls String[] @default([]) + allowed_routes String[] @default([]) model_spend Json @default("{}") model_max_budget Json @default("{}") budget_id String? @@ -342,6 +343,31 @@ model LiteLLM_DailyUserSpend { @@index([model]) } +// Track daily team spend metrics per model and key +model LiteLLM_DailyTeamSpend { + id String @id @default(uuid()) + team_id String + date String + api_key String + model String + model_group String? + custom_llm_provider String? + prompt_tokens Int @default(0) + completion_tokens Int @default(0) + spend Float @default(0.0) + api_requests Int @default(0) + successful_requests Int @default(0) + failed_requests Int @default(0) + created_at DateTime @default(now()) + updated_at DateTime @updatedAt + + @@unique([team_id, date, api_key, model, custom_llm_provider]) + @@index([date]) + @@index([team_id]) + @@index([api_key]) + @@index([model]) +} + // Track the status of cron jobs running. Only allow one pod to run the job at a time model LiteLLM_CronJob { diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index 845f05f14b..976b5e1508 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -169,6 +169,7 @@ model LiteLLM_VerificationToken { budget_duration String? budget_reset_at DateTime? allowed_cache_controls String[] @default([]) + allowed_routes String[] @default([]) model_spend Json @default("{}") model_max_budget Json @default("{}") budget_id String? diff --git a/schema.prisma b/schema.prisma index 845f05f14b..976b5e1508 100644 --- a/schema.prisma +++ b/schema.prisma @@ -169,6 +169,7 @@ model LiteLLM_VerificationToken { budget_duration String? budget_reset_at DateTime? allowed_cache_controls String[] @default([]) + allowed_routes String[] @default([]) model_spend Json @default("{}") model_max_budget Json @default("{}") budget_id String?