diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 629e002b56f..b0463a890cd 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1371,6 +1371,8 @@ class LiteLLM_VerificationToken(LiteLLMBase): blocked: Optional[bool] = None litellm_budget_table: Optional[dict] = None org_id: Optional[str] = None # org id for a given key + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None model_config = ConfigDict(protected_namespaces=()) diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index e7e54335147..64045999c95 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -154,6 +154,8 @@ model LiteLLM_VerificationToken { model_spend Json @default("{}") model_max_budget Json @default("{}") budget_id String? + created_at DateTime? @default(now()) @map("created_at") + updated_at DateTime? @default(now()) @updatedAt @map("updated_at") litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id]) } diff --git a/schema.prisma b/schema.prisma index e7e54335147..64045999c95 100644 --- a/schema.prisma +++ b/schema.prisma @@ -154,6 +154,8 @@ model LiteLLM_VerificationToken { model_spend Json @default("{}") model_max_budget Json @default("{}") budget_id String? + created_at DateTime? @default(now()) @map("created_at") + updated_at DateTime? @default(now()) @updatedAt @map("updated_at") litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id]) } diff --git a/ui/litellm-dashboard/src/components/view_key_table.tsx b/ui/litellm-dashboard/src/components/view_key_table.tsx index 0595e31fd63..474a308e9f0 100644 --- a/ui/litellm-dashboard/src/components/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/view_key_table.tsx @@ -802,6 +802,7 @@ const ViewKeyTable: React.FC = ({ Key Alias Secret Key + Created Expires Spend (USD) Budget (USD) @@ -843,10 +844,19 @@ const ViewKeyTable: React.FC = ({ {item.key_name} + + {item.created_at != null ? ( +
+

{new Date(item.created_at).toLocaleDateString()}

+
+ ) : ( +

Not available

+ )} +
{item.expires != null ? (
-

{new Date(item.expires).toLocaleString()}

+

{new Date(item.expires).toLocaleDateString()}

) : (

Never