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(ui): surface key budget_reset_at in key info and keys table (#34113)
ryan-crabbe-berriee0028a8417e
diff --git a/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.test.tsx b/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.test.tsxindex 420a1213a8d..95f45ea199e 100644--- a/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.test.tsx+++ b/ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.test.tsx@@ -174,6 +174,13 @@ it("should render VirtualKeysTable component", () => {expect(screen.getByText("Test Key Alias")).toBeInTheDocument();});+it("shows the Budget Reset column by default", async () => {+ renderWithProviders(<VirtualKeysTable />);+ await waitFor(() => {+ expect(screen.getByText("Budget Reset")).toBeInTheDocument();+ });+});+it("left-anchors the create-key CTA below the title, between the header and the table toolbar", () => {renderWithProviders(<VirtualKeysTable headerActions={<button>Create New Key</button>} />);diff --git a/ui/litellm-dashboard/src/components/VirtualKeysPage/keyTableColumns.tsx b/ui/litellm-dashboard/src/components/VirtualKeysPage/keyTableColumns.tsxindex 901e878ee5f..fdbc07ee020 100644--- a/ui/litellm-dashboard/src/components/VirtualKeysPage/keyTableColumns.tsx+++ b/ui/litellm-dashboard/src/components/VirtualKeysPage/keyTableColumns.tsx@@ -363,6 +363,5 @@ export const KEY_TABLE_HIDDEN_COLUMNS: Record<string, boolean> = {created_by: false,updated_at: false,expires: false,- budget_reset_at: false,rate_limits: false,};diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.budget_display.test.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.budget_display.test.tsxindex 5407d37fcf1..bab720f7517 100644--- a/ui/litellm-dashboard/src/components/templates/key_info_view.budget_display.test.tsx+++ b/ui/litellm-dashboard/src/components/templates/key_info_view.budget_display.test.tsx@@ -1,5 +1,5 @@import { renderWithProviders } from "../../../tests/test-utils";-import { screen, waitFor } from "@testing-library/react";+import { fireEvent, screen, waitFor } from "@testing-library/react";import { beforeEach, describe, expect, it, vi } from "vitest";import { KeyResponse, Team } from "../key_team_helpers/key_list";import KeyInfoView from "./key_info_view";@@ -238,3 +238,88 @@ describe("KeyInfoView overview budget display (LIT-2845)", () => {});});});++describe("KeyInfoView budget reset visibility", () => {+ beforeEach(() => {+ vi.mocked(useTeams).mockReturnValue({ teams: [], setTeams: vi.fn() });+ vi.mocked(useAuthorized).mockReturnValue(baseAuthorized);+ });++ const KEY_WITH_RESET = {+ ...MOCK_KEY_DATA,+ max_budget: 0.1,+ budget_duration: "1d",+ budget_reset_at: "2026-07-22T12:00:00+00:00",+ } as unknown as KeyResponse;++ it("shows the next budget reset in the overview Spend card when budget_reset_at is set", async () => {+ renderWithProviders(+ <KeyInfoView+ keyData={KEY_WITH_RESET}+ onClose={() => {}}+ keyId={"test-key-id"}+ onKeyDataUpdate={() => {}}+ teams={[]}+ />,+ );+ await waitFor(() => {+ expect(screen.getByText(/^Resets Jul 22, 2026/)).toBeInTheDocument();+ });+ });++ it("omits the reset line from the overview Spend card when budget_reset_at is null", async () => {+ renderWithProviders(+ <KeyInfoView+ keyData={{ ...MOCK_KEY_DATA, max_budget: 0.1 } as unknown as KeyResponse}+ onClose={() => {}}+ keyId={"test-key-id"}+ onKeyDataUpdate={() => {}}+ teams={[]}+ />,+ );+ await waitFor(() => {+ expect(screen.getByText(/of \$0\.10/)).toBeInTheDocument();+ });+ expect(screen.queryByText(/^Resets /)).not.toBeInTheDocument();+ });++ it("shows the duration and next reset in the Settings tab", async () => {+ renderWithProviders(+ <KeyInfoView+ keyData={KEY_WITH_RESET}+ onClose={() => {}}+ keyId={"test-key-id"}+ onKeyDataUpdate={() => {}}+ teams={[]}+ />,+ );+ await waitFor(() => {+ expect(screen.getByRole("tab", { name: "Settings" })).toBeInTheDocument();+ });+ fireEvent.click(screen.getByRole("tab", { name: "Settings" }));+ await waitFor(() => {+ expect(screen.getByText("Budget Reset")).toBeInTheDocument();+ });+ expect(screen.getByText(/Every 1d, next Jul 22, 2026/)).toBeInTheDocument();+ });++ it("shows 'Never' in the Settings tab when no reset is scheduled", async () => {+ renderWithProviders(+ <KeyInfoView+ keyData={MOCK_KEY_DATA}+ onClose={() => {}}+ keyId={"test-key-id"}+ onKeyDataUpdate={() => {}}+ teams={[]}+ />,+ );+ await waitFor(() => {+ expect(screen.getByRole("tab", { name: "Settings" })).toBeInTheDocument();+ });+ fireEvent.click(screen.getByRole("tab", { name: "Settings" }));+ await waitFor(() => {+ expect(screen.getByText("Budget Reset")).toBeInTheDocument();+ });+ expect(screen.getByText("Budget Reset").parentElement).toHaveTextContent("Never");+ });+});diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.tsxindex cd97f6b851d..23baf024bd1 100644--- a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx+++ b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx@@ -534,6 +534,9 @@ export default function KeyInfoView({<div className="mt-2"><Title>${formatNumberWithCommas(currentKeyData.spend, 4)}</Title><Text>of {budgetDisplay}</Text>+ {currentKeyData.budget_reset_at && (+ <Text>Resets {formatTimestamp(currentKeyData.budget_reset_at)}</Text>+ )}</div></Card>@@ -751,6 +754,15 @@ export default function KeyInfoView({</Text></div>+ <div>+ <Text className="font-medium">Budget Reset</Text>+ <Text>+ {currentKeyData.budget_reset_at+ ? `${currentKeyData.budget_duration ? `Every ${currentKeyData.budget_duration}, next ` : ""}${formatTimestamp(currentKeyData.budget_reset_at)}`+ : "Never"}+ </Text>+ </div>+{currentKeyData.budget_fallbacks && Object.keys(currentKeyData.budget_fallbacks).length > 0 && (<div><Text className="font-medium">Budget Fallbacks</Text>