From 83bab341290a9654d2eb24e0cb0833837ba2c4cd Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Sun, 12 Jul 2026 22:46:59 -0700 Subject: [PATCH] chore(proxy): exclude the dashboard AI chat route from the OpenAPI schema /dashboard/ai/chat is an internal dashboard endpoint, so it does not belong in the public API docs. It surfaced two ways: the route decorator, now carrying include_in_schema=False, and the lazy-openapi snapshot injection, whose dashboard_ai fragment is emptied to match what a snapshot regen produces once the route is hidden. The generated dashboard types drop the now-unreferenced path, operation, DashboardAIChatRequest, and ChatMessage --- litellm/proxy/_lazy_openapi_snapshot.json | 148 +----------------- .../dashboard_ai/endpoints.py | 1 + ui/litellm-dashboard/src/lib/http/schema.d.ts | 80 ---------- 3 files changed, 3 insertions(+), 226 deletions(-) diff --git a/litellm/proxy/_lazy_openapi_snapshot.json b/litellm/proxy/_lazy_openapi_snapshot.json index e763da97d8f..b6b3b165a3e 100644 --- a/litellm/proxy/_lazy_openapi_snapshot.json +++ b/litellm/proxy/_lazy_openapi_snapshot.json @@ -6134,153 +6134,9 @@ }, "dashboard_ai": { "components": { - "schemas": { - "ChatMessage": { - "properties": { - "content": { - "title": "Content", - "type": "string" - }, - "role": { - "enum": [ - "user", - "assistant" - ], - "title": "Role", - "type": "string" - } - }, - "required": [ - "role", - "content" - ], - "title": "ChatMessage", - "type": "object" - }, - "DashboardAIChatRequest": { - "properties": { - "messages": { - "description": "Chat messages (user/assistant history)", - "items": { - "$ref": "#/components/schemas/ChatMessage" - }, - "title": "Messages", - "type": "array" - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model group to use for AI chat", - "title": "Model" - } - }, - "required": [ - "messages" - ], - "title": "DashboardAIChatRequest", - "type": "object" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "title": "Detail", - "type": "array" - } - }, - "title": "HTTPValidationError", - "type": "object" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "title": "Location", - "type": "array" - }, - "msg": { - "title": "Message", - "type": "string" - }, - "type": { - "title": "Error Type", - "type": "string" - } - }, - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError", - "type": "object" - } - } + "schemas": {} }, - "paths": { - "/dashboard/ai/chat": { - "post": { - "description": "AI chat about usage data. Streams SSE events with the AI response.\n\nThe agent queries aggregated daily activity data through a provider scoped\nto the caller: admins get a global view, non-admins are restricted to their\nown ``user_id``.", - "operationId": "dashboard_ai_chat_dashboard_ai_chat_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardAIChatRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "security": [ - { - "APIKeyHeader": [] - } - ], - "summary": "Dashboard Ai Chat", - "tags": [ - "usage_ai" - ] - } - } - } + "paths": {} }, "evals": { "components": { diff --git a/litellm/proxy/management_endpoints/dashboard_ai/endpoints.py b/litellm/proxy/management_endpoints/dashboard_ai/endpoints.py index 6f340a41dba..d7763569142 100644 --- a/litellm/proxy/management_endpoints/dashboard_ai/endpoints.py +++ b/litellm/proxy/management_endpoints/dashboard_ai/endpoints.py @@ -30,6 +30,7 @@ class DashboardAIChatRequest(BaseModel): "/dashboard/ai/chat", tags=["Budget & Spend Tracking"], dependencies=[Depends(user_api_key_auth)], + include_in_schema=False, ) async def dashboard_ai_chat( data: DashboardAIChatRequest, diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts index 797d30822c1..2a63cfcc015 100644 --- a/ui/litellm-dashboard/src/lib/http/schema.d.ts +++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts @@ -3078,30 +3078,6 @@ export interface paths { patch?: never; trace?: never; }; - "/dashboard/ai/chat": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Dashboard Ai Chat - * @description AI chat about usage data. Streams SSE events with the AI response. - * - * The agent queries aggregated daily activity data through a provider scoped - * to the caller: admins get a global view, non-admins are restricted to their - * own ``user_id``. - */ - post: operations["dashboard_ai_chat_dashboard_ai_chat_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; "/debug/asyncio-tasks": { parameters: { query?: never; @@ -22142,16 +22118,6 @@ export interface components { /** Url */ url: string; }; - /** ChatMessage */ - ChatMessage: { - /** Content */ - content: string; - /** - * Role - * @enum {string} - */ - role: "user" | "assistant"; - }; /** ChoiceLogprobs */ ChoiceLogprobs: { /** Content */ @@ -23257,19 +23223,6 @@ export interface components { * DefaultInternalUserParams * @description Default parameters to apply when a new user signs in via SSO or is created on the /user/new API endpoint */ - /** DashboardAIChatRequest */ - DashboardAIChatRequest: { - /** - * Messages - * @description Chat messages (user/assistant history) - */ - messages: components["schemas"]["ChatMessage"][]; - /** - * Model - * @description Model group to use for AI chat - */ - model?: string | null; - }; DefaultInternalUserParams: { /** * Budget Duration @@ -33685,39 +33638,6 @@ export interface components { } export type $defs = Record; export interface operations { - dashboard_ai_chat_dashboard_ai_chat_post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["DashboardAIChatRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - }; - }; home__get: { parameters: { query?: never;