From 51d876ce7906b1339fa78eeead0af4086ee3b359 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Wed, 4 Mar 2026 20:11:42 -0800 Subject: [PATCH] [Fix] UI - Keys: Organization shows Not Set due to org_id/organization_id mismatch The /key/list API returns `org_id` (the Pydantic field name), but the UI was reading `organization_id`, causing the Organization field to always show "Not Set" and the Organization ID filter to never match. Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/VirtualKeysPage/VirtualKeysTable.tsx | 2 +- .../src/components/key_team_helpers/filter_logic.tsx | 2 +- .../src/components/key_team_helpers/key_list.tsx | 1 + ui/litellm-dashboard/src/components/templates/key_info_view.tsx | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx index badaca93939..fe9d58b9791 100644 --- a/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx @@ -210,7 +210,7 @@ export function VirtualKeysTable({ teams, organizations, onSortChange, currentSo }, { id: "organization_id", - accessorKey: "organization_id", + accessorKey: "org_id", header: "Organization ID", size: 140, enableSorting: false, diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/filter_logic.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/filter_logic.tsx index cf4cee64811..cd55477208c 100644 --- a/ui/litellm-dashboard/src/components/key_team_helpers/filter_logic.tsx +++ b/ui/litellm-dashboard/src/components/key_team_helpers/filter_logic.tsx @@ -96,7 +96,7 @@ export function useFilterLogic({ // Apply Organization ID filter if (filters["Organization ID"]) { - result = result.filter((key) => key.organization_id === filters["Organization ID"]); + result = result.filter((key) => (key.organization_id ?? key.org_id) === filters["Organization ID"]); } setFilteredKeys(result); diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx index 08bccda7749..4cc3367f71d 100644 --- a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx +++ b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx @@ -47,6 +47,7 @@ export interface KeyResponse { blocked: boolean; litellm_budget_table: Record; organization_id: string | null; + org_id?: string | null; created_at: string; updated_at: string; last_active: string | null; diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx index ed88d03c1e7..5d00ab3d0b9 100644 --- a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx @@ -644,7 +644,7 @@ export default function KeyInfoView({
Organization - {currentKeyData.organization_id || "Not Set"} + {(currentKeyData.organization_id ?? currentKeyData.org_id) || "Not Set"}