Spaces:
Runtime error
Runtime error
| // AUTO-GENERATED by scripts/docs/gen-openapi-module.mjs — DO NOT EDIT MANUALLY | |
| // Regenerate with: node scripts/docs/gen-openapi-module.mjs | |
| // | |
| // Source of truth: docs/openapi.yaml | |
| // | |
| // The Api Explorer consumes `OPENAPI_ENDPOINTS`; the spec metadata | |
| // (`OPENAPI_VERSION`, `OPENAPI_TITLE`) is surfaced in the page header. | |
| export interface OpenApiEndpoint { | |
| /** Path template — may contain `{param}` placeholders. */ | |
| path: string; | |
| /** HTTP method in upper case (GET / POST / PUT / DELETE / PATCH / ...). */ | |
| method: string; | |
| /** Short one-line summary from the spec. */ | |
| summary: string; | |
| /** Long-form description (markdown is allowed). */ | |
| description: string; | |
| /** Primary tag — used for sidebar grouping in the Api Explorer. */ | |
| tag: string; | |
| /** All tags declared on the operation. */ | |
| tags: string[]; | |
| /** `true` when the operation declares a non-empty `security` array. */ | |
| requiresAuth: boolean; | |
| /** `true` when the operation declares a `requestBody`. */ | |
| hasRequestBody: boolean; | |
| } | |
| export const OPENAPI_VERSION = "3.8.35"; | |
| export const OPENAPI_TITLE = "OmniRoute API"; | |
| export const OPENAPI_ENDPOINTS: OpenApiEndpoint[] = [ | |
| { | |
| path: "/api/v1", | |
| method: "GET", | |
| summary: "API v1 root endpoint", | |
| description: "Returns basic API info and status.", | |
| tag: "System", | |
| tags: ["System"], | |
| requiresAuth: true, | |
| hasRequestBody: false, | |
| }, | |
| { | |
| path: "/api/v1/api/chat", | |
| method: "POST", | |
| summary: "Ollama-compatible chat endpoint", | |
| description: "Provides compatibility with Ollama's /api/chat format.", | |
| tag: "Chat", | |
| tags: ["Chat"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/audio/speech", | |
| method: "POST", | |
| summary: "Generate speech audio", | |
| description: "Text-to-speech endpoint. Routes to configured TTS providers.", | |
| tag: "Audio", | |
| tags: ["Audio"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/audio/transcriptions", | |
| method: "POST", | |
| summary: "Transcribe audio", | |
| description: "Audio-to-text transcription endpoint.", | |
| tag: "Audio", | |
| tags: ["Audio"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/chat/completions", | |
| method: "POST", | |
| summary: "Create chat completion", | |
| description: "OpenAI-compatible chat completions endpoint. Routes to configured providers.", | |
| tag: "Chat", | |
| tags: ["Chat"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/embeddings", | |
| method: "POST", | |
| summary: "Create embeddings", | |
| description: "", | |
| tag: "Embeddings", | |
| tags: ["Embeddings"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/images/generations", | |
| method: "POST", | |
| summary: "Generate images", | |
| description: "", | |
| tag: "Images", | |
| tags: ["Images"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/messages", | |
| method: "POST", | |
| summary: "Create message (Anthropic-compatible)", | |
| description: "Anthropic Messages API endpoint. Routes to Claude providers.", | |
| tag: "Messages", | |
| tags: ["Messages"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/messages/count_tokens", | |
| method: "POST", | |
| summary: "Count tokens for a message", | |
| description: "", | |
| tag: "Messages", | |
| tags: ["Messages"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/models", | |
| method: "GET", | |
| summary: "List available models", | |
| description: "Returns all models available across configured providers.", | |
| tag: "Models", | |
| tags: ["Models"], | |
| requiresAuth: true, | |
| hasRequestBody: false, | |
| }, | |
| { | |
| path: "/api/v1/moderations", | |
| method: "POST", | |
| summary: "Create moderation", | |
| description: "Content moderation endpoint. Routes to configured moderation providers.", | |
| tag: "Moderations", | |
| tags: ["Moderations"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/providers/{provider}/chat/completions", | |
| method: "POST", | |
| summary: "Create chat completion (provider-specific)", | |
| description: "Routes to a specific provider by name.", | |
| tag: "Chat", | |
| tags: ["Chat"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/providers/{provider}/embeddings", | |
| method: "POST", | |
| summary: "Create embeddings (provider-specific)", | |
| description: "", | |
| tag: "Embeddings", | |
| tags: ["Embeddings"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/providers/{provider}/images/generations", | |
| method: "POST", | |
| summary: "Generate images (provider-specific)", | |
| description: "", | |
| tag: "Images", | |
| tags: ["Images"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/providers/{provider}/models", | |
| method: "GET", | |
| summary: "List models for a specific provider", | |
| description: "Returns only models for the selected provider with provider prefix removed from each model id.", | |
| tag: "Models", | |
| tags: ["Models"], | |
| requiresAuth: true, | |
| hasRequestBody: false, | |
| }, | |
| { | |
| path: "/api/v1/rerank", | |
| method: "POST", | |
| summary: "Rerank documents", | |
| description: "Document reranking endpoint.", | |
| tag: "Rerank", | |
| tags: ["Rerank"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/responses", | |
| method: "POST", | |
| summary: "Create response (OpenAI Responses API)", | |
| description: "OpenAI Responses API endpoint.", | |
| tag: "Responses", | |
| tags: ["Responses"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| { | |
| path: "/api/v1/ws", | |
| method: "GET", | |
| summary: "Chat completion over WebSocket (handshake + upgrade)", | |
| description: "OpenAI-compatible chat over a WebSocket connection. `GET` with `?handshake=1` returns the connection descriptor (auth path, message protocol and live-event channels) as JSON; a plain `GET` without an Upgrade returns `426 Upgrade Required`. After upgrading, the client exchanges JSON frames — `{type:\"request\", id, payload:{model, messages}}` to start a completion and `{type:\"cancel\", id}` to abort it. A separate live channel (default port `LIVE_WS_PORT=20129`, path `/live`) streams dashboard events on the `requests`, `combo` and `credentials` topics with a 15s heartbeat. Requires an API key.", | |
| tag: "Chat", | |
| tags: ["Chat"], | |
| requiresAuth: true, | |
| hasRequestBody: false, | |
| }, | |
| { | |
| path: "/api/v1beta/models", | |
| method: "GET", | |
| summary: "List models (Gemini format)", | |
| description: "Returns models in Gemini v1beta format for native SDK compatibility", | |
| tag: "Models", | |
| tags: ["Models"], | |
| requiresAuth: true, | |
| hasRequestBody: false, | |
| }, | |
| { | |
| path: "/api/v1beta/models/{path}", | |
| method: "POST", | |
| summary: "Gemini generateContent", | |
| description: "Gemini-compatible generateContent endpoint", | |
| tag: "Models", | |
| tags: ["Models"], | |
| requiresAuth: true, | |
| hasRequestBody: true, | |
| }, | |
| ]; | |
| export const OPENAPI_TAGS: string[] = Array.from( | |
| new Set(OPENAPI_ENDPOINTS.map((endpoint) => endpoint.tag)) | |
| ).sort(); | |