API Reference
v3.8.1Last updated: 2026-05-13
Was this page helpful?
Loading OmniRoute...
Languages: 🇺🇸 English | 🇧🇷 Português (Brasil) | 🇪🇸 Español | 🇫🇷 Français | 🇮🇹 Italiano | 🇷🇺 Русский | 🇨🇳 中文 (简体) | 🇩🇪 Deutsch | 🇮🇳 हिन्दी | 🇹🇭 ไทย | 🇺🇦 Українська | 🇸🇦 العربية | 🇯🇵 日本語 | 🇻🇳 Tiếng Việt | 🇧🇬 Български | 🇩🇰 Dansk | 🇫🇮 Suomi | 🇮🇱 עברית | 🇭🇺 Magyar | 🇮🇩 Bahasa Indonesia | 🇰🇷 한국어 | 🇲🇾 Bahasa Melayu | 🇳🇱 Nederlands | 🇳🇴 Norsk | 🇵🇹 Português (Portugal) | 🇷🇴 Română | 🇵🇱 Polski | 🇸🇰 Slovenčina | 🇸🇪 Svenska | 🇵🇭 Filipino | 🇨🇿 Čeština
POST /v1/chat/completions
Authorization: Bearer your-api-key
Content-Type: application/json
{
"model": "cc/claude-opus-4-6",
"messages": [
{"role": "user", "content": "Write a function to..."}
],
"stream": true
}
| to bypass cache | ||
| for progress events | ||
or (non-streaming) |
||
| if deduplicated | ||
| if progress tracking on | ||
), enable .
POST /v1/embeddings
Authorization: Bearer your-api-key
Content-Type: application/json
{
"model": "nebius/Qwen/Qwen3-Embedding-8B",
"input": "The food was delicious"
}
OpenRouter, GitHub Models.
# List all embedding models GET /v1/embeddings
POST /v1/images/generations
Authorization: Bearer your-api-key
Content-Type: application/json
{
"model": "openai/gpt-image-2",
"prompt": "A beautiful sunset over mountains",
"size": "1024x1024"
}
OpenRouter, SD WebUI (local), ComfyUI (local).
# List all image models GET /v1/images/generations
GET /v1/models Authorization: Bearer your-api-key → Returns all chat, embedding, and image models + combos in OpenAI format
+ Zod-validated JSON body (, , , etc., see ). 4xx is returned on schema failure.
# Rerank
POST /v1/rerank { "model": "cohere/rerank-3", "query": "...", "documents": ["..."] }
# Moderations
POST /v1/moderations { "model": "omni-moderation-latest", "input": "..." }
# TTS — returns audio/mpeg (or requested format) body
POST /v1/audio/speech { "model": "openai/tts-1", "input": "Hello", "voice": "alloy" }
# Image edit (multipart)
POST /v1/images/edits -F image=@input.png -F prompt="..." -F mask=@mask.png
# Video / music generation (provider-prefixed model id)
POST /v1/videos/generations { "model": "runway/gen-3", "prompt": "..." }
POST /v1/music/generations { "model": "suno/v3.5", "prompt": "..." }
POST /v1/providers/{provider}/chat/completions
POST /v1/providers/{provider}/embeddings
POST /v1/providers/{provider}/images/generations
.
, , |
||
Auth: Bearer API key — files are scoped per-API-key via .
(, |
||
Auth: Bearer API key. Batches are scoped per-API-key.
| , supports caching/coalescing | ||
Auth: Bearer API key ( + ). Search policy enforced via .
GET /v1/ws?handshake=1
, ). Actual WS frames are handled by the bundled WS server outside the Next.js route table.
Auth: Bearer API key during handshake.
+ before issuing a registered key |
||
| + token) |
Auth: Bearer API key ().
# Get cache stats GET /api/cache/stats # Clear all caches DELETE /api/cache/stats
{
"semanticCache": {
"memorySize": 42,
"memoryMaxSize": 500,
"dbSize": 128,
"hitRate": 0.65
},
"idempotency": {
"activeKeys": 3,
"windowMs": 5000
}
}
, , |
||
| ) | ||
| ) |
, , , , , .
| query param |
(id, name, binary, version, installed, protocol, isCustom) and (total, installed, notFound, builtIn, custom).
or to wipe everything |
||
routes require management auth (). See Resilience (extended) for a full breakdown of provider breaker vs connection cooldown vs model lockout.
| endpoint |
Note: These endpoints are used internally by the system or for Ollama client compatibility. They are not typically called by end users.
POST /api/system/env/repair
Content-Type: application/json
{
"provider": "claude-code"
}
{
"success": true,
"repaired": ["CLAUDE_CODE_OAUTH_CLIENT_ID", "CLAUDE_CODE_OAUTH_CLIENT_SECRET"],
"backupPath": "/home/user/.omniroute/backups/env-repair-2026-04-11.bak"
}
POST /v1/audio/transcriptions Authorization: Bearer your-api-key Content-Type: multipart/form-data
Request:
curl -X POST http://localhost:20128/v1/audio/transcriptions \ -H "Authorization: Bearer your-api-key" \ -F "file=@recording.mp3" \ -F "model=deepgram/nova-3"
Response:
{
"text": "Hello, this is the transcribed audio content.",
"task": "transcribe",
"language": "en",
"duration": 12.5
}
Supported providers: , .
Supported formats: , , , , , .
# Chat endpoint (Ollama format) POST /v1/api/chat # Model listing (Ollama format) GET /api/tags
# Get latency telemetry summary (p50/p95/p99 per provider) GET /api/telemetry/summary
Response:
{
"providers": {
"claudeCode": { "p50": 245, "p95": 890, "p99": 1200, "count": 150 },
"github": { "p50": 180, "p95": 620, "p99": 950, "count": 320 }
}
}
# Get budget status for all API keys
GET /api/usage/budget
# Set or update a budget
POST /api/usage/budget
Content-Type: application/json
{
"apiKeyId": "key-123",
"dailyLimitUsd": 5.00,
"weeklyLimitUsd": 30.00,
"monthlyLimitUsd": 100.00,
"warningThreshold": 0.8,
"resetInterval": "monthly"
}
Schema notes (): is required; at least one of , , or must be greater than zero. Optional fields: (0–1), ( | | ), (). The legacy shape returns .
, , or ) can also be mapped 1:1 from a model id pattern, allowing transparent redirection of an OpenAI-style model id to a combo.
Auth: management session/API key ().
| ) | ||
Auth: management session/API key ().
. Returns the raw key once. Returns on quota refusal. |
||
Auth: Bearer API key (). See also and .
, , |
||
(, |
||
| is set | ||
, , or |
||
Auth: management auth required on every method (). Prior to v3.8.0 these were unauthenticated — see commit for the breaking change.
# Create a Claude Code cloud task
curl -X POST http://localhost:20128/api/v1/agents/tasks \
-H "Authorization: Bearer your-management-key" \
-H "Content-Type: application/json" \
-d '{"providerId":"claude-code-cloud","prompt":"Fix the failing test","source":{"repo":"...","branch":"..."}}'
returns one; with returns the assignment graph) |
||
(requires ) |
||
| to detach assignments) | ||
, , |
||
(). Clears dispatcher cache |
||
() |
||
Auth: management session/API key on every route ().
and are served by the flat and routes shown above — there are no per-id subroutes in the codebase.
| + in-memory | |||
| on provider connections | , |
||
# Clear a single model lockout
curl -X DELETE http://localhost:20128/api/resilience/model-cooldowns \
-H "Cookie: auth_token=..." \
-H "Content-Type: application/json" \
-d '{"provider":"openai","model":"gpt-4o-mini"}'
# Wipe every lockout
curl -X DELETE http://localhost:20128/api/resilience/model-cooldowns \
-H "Cookie: auth_token=..." \
-d '{"all":true}'
→ "Resilience Runtime State".
, , |
||
| setting) | ||
Auth: management session/API key. Marketplace search routes accept either management auth or a Bearer API key ().
, , |
||
Auth: management session/API key (). enum: , , , (see in ).
| Heartbeat, transport, online state, last call, top tools, 24h success rate |
| GET | | List of MCP tools with , , , , , |
| GET | | Open SSE stream for the SSE transport (returns if MCP disabled or transport mismatch) |
| POST | | Send JSON-RPC frame on the SSE transport |
| GET | | Open SSE side of the Streamable HTTP transport (server-initiated messages) |
| POST | | Send JSON-RPC frame on the Streamable HTTP transport |
| DELETE | | End a Streamable HTTP session |
| GET | | Query audit log — , , , , |
| GET | | Aggregate audit stats (totals, success rate, avg duration, top tools) |
Auth: the / transports honor the MCP-specific auth surface (Bearer API key with scope); the // routes are readable from the dashboard (no extra auth required beyond reaching the dashboard host).
and — a transport mismatch returns , an MCP disabled state returns .
POST /a2a
Authorization: Bearer your-api-key # optional unless OMNIROUTE_API_KEY is set
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": {
"skill": "smart-routing",
"messages": [{"role": "user", "content": "Route this coding task"}]
}
}
):
, , , , .
GET /.well-known/agent.json
, , |
||
| ) | ||
Auth: the REST helpers run without management auth (dashboard-readable); the JSON-RPC route uses Bearer if configured.
| Verify a Bearer key and return masked provider connections + model aliases for cloud sync clients |
| POST | | Update encrypted credentials for a cloud-synced provider |
| POST | | Resolve a logical model id to a concrete provider/model using the local routing table |
| GET | | List model aliases as exposed to cloud sync |
| GET | | Read latest assessment categorizations (per-provider/model) |
| POST | | Run an assessment — body: |
| GET | | List built-in eval suites + most recent runs |
| POST | | Trigger an eval run |
| POST | | Create a custom eval suite — body validated by |
| GET | | Retrieve a custom eval suite |
Auth: validates a Bearer key directly; the other , , and routes require management session/API key. POST uses with a discriminated-union scope schema.
cookie
- toggleable via
- routes optionally require Bearer API key when
Breaking change (v3.8.0) — and the cooldown management endpoints now require management auth (dashboard cookie or a management-scoped API key). Clients that previously called these routes unauthenticated will receive . See commit ().