Skip to content

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]

fix(ui): route API Reference back to query-param page (#28726)

ryan-crabbe-berria8263cbc8850
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx
index 7f331d06e59..5bb55ee8d10 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx
@@ -30,9 +30,7 @@ function withBase(path: string): string {
*
* Key = legacy page id used in leftnav, Value = route segment under (dashboard)/
*/
-const MIGRATED_PAGES: Record<string, string> = {
- "api-reference": "api-reference",
-};
+const MIGRATED_PAGES: Record<string, string> = {};
function LayoutContent({ children }: { children: React.ReactNode }) {
const router = useRouter();
diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx
index a7ea6831de6..57618185968 100644
--- a/ui/litellm-dashboard/src/app/page.tsx
+++ b/ui/litellm-dashboard/src/app/page.tsx
@@ -1,5 +1,6 @@
"use client";
+import APIReferenceView from "@/app/(dashboard)/api-reference/APIReferenceView";
import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider";
import OldModelDashboard from "@/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView";
import PlaygroundPage from "@/app/(dashboard)/playground/page";
@@ -73,10 +74,7 @@ interface ProxySettings {
* When a user visits ?page=<key>, they are redirected to /ui/<value>.
* Add entries here as pages are migrated from the if/else chain to path-based routes.
*/
-const LEGACY_REDIRECTS: Record<string, string> = {
- api_ref: "api-reference",
- "api-reference": "api-reference",
-};
+const LEGACY_REDIRECTS: Record<string, string> = {};
function CreateKeyPageContent() {
const [userRole, setUserRole] = useState("");
@@ -547,6 +545,8 @@ function CreateKeyPageContent() {
<AdminPanel
proxySettings={proxySettings}
/>
+ ) : page == "api_ref" || page == "api-reference" ? (
+ <APIReferenceView proxySettings={proxySettings} />
) : page == "logging-and-alerts" ? (
<Settings userID={userID} userRole={userRole} accessToken={accessToken} premiumUser={premiumUser} />
) : page == "budgets" ? (
diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx
index f2fe1fe96ec..46373ab24db 100644
--- a/ui/litellm-dashboard/src/components/leftnav.tsx
+++ b/ui/litellm-dashboard/src/components/leftnav.tsx
@@ -49,12 +49,9 @@ const { Sider } = Layout;
/**
* Pages migrated to path-based routing under (dashboard)/.
* Key = legacy page id, Value = route segment.
- * Keep in sync with MIGRATED_PAGES in (dashboard)/layout.tsx and
- * LEGACY_REDIRECTS in app/page.tsx.
+ * Keep in sync with MIGRATED_PAGES in (dashboard)/layout.tsx.
*/
-const MIGRATED_PAGES: Record<string, string> = {
- "api-reference": "api-reference",
-};
+const MIGRATED_PAGES: Record<string, string> = {};
/** Build an absolute href for a migrated page, respecting base URL + serverRootPath. */
function migratedHref(routeSegment: string): string {
@@ -295,8 +292,8 @@ const menuGroups: MenuGroup[] = [
groupLabel: "DEVELOPER TOOLS",
items: [
{
- key: "api-reference",
- page: "api-reference",
+ key: "api_ref",
+ page: "api_ref",
label: "API Reference",
icon: <ApiOutlined />,
},
diff --git a/ui/litellm-dashboard/src/components/page_metadata.ts b/ui/litellm-dashboard/src/components/page_metadata.ts
index 277bb0bd021..84562446696 100644
--- a/ui/litellm-dashboard/src/components/page_metadata.ts
+++ b/ui/litellm-dashboard/src/components/page_metadata.ts
@@ -27,7 +27,7 @@ export const pageDescriptions: Record<string, string> = {
projects: "Manage projects within teams",
"access-groups": "Manage access groups for role-based permissions",
budgets: "Set and monitor spending budgets",
- "api-reference": "Browse API documentation and endpoints",
+ api_ref: "Browse API documentation and endpoints",
"model-hub-table": "Explore available AI models and providers",
"learning-resources": "Access tutorials and documentation",
caching: "Configure response caching settings",