API keys you create in the dashboard work against the demo gateway on this site. It speaks the OpenAI wire format, validates your key, applies a limit of 60 requests per minute per key, and tracks last-used time.
When no upstream provider is configured, assistant replies are generated by the demo gateway itself and marked with lokarouter.demo = true in the response. With an upstream key configured (UPSTREAM_API_KEY), requests are forwarded for real and usage is recorded from the provider's response.
Every request is logged in the dashboard with model, tokens, cost, latency, and which provider served it. The dashboard also includes a chat playground, per-key budget caps, guardrails (model/tool allow-lists), and monthly workspace budgets.
POST /api/v1/chat/completions — OpenAI-compatible chat completions
GET /api/v1/models — list routable models
Pass "stream": true to receive Server-Sent Events chunks
In production the endpoint moves to https://api.lokarouter.id/v1.
OpenAI compatibility
LokaRouter implements the OpenAI REST surface. These endpoints are supported today:
Point any official SDK or community client at https://api.lokarouter.id/v1 and it works. Streaming, function calling, and JSON mode are passed through to the underlying providers. See the API reference for full request and response shapes, header metadata, and the error table.
POST /chat/completions
POST /completions
POST /embeddings
GET /models
GET /models/{id}
The Files API (beta) is also available — see the API reference.
Choosing models
Model identifiers use the author/model convention, for example openai/gpt-5.2, anthropic/claude-opus-5, or deepseek/deepseek-v4. The catalog tracks current-generation releases only, with new launches added as they ship.
Switching models is a one-string change — the request shape stays identical. On the models page you can filter by provider, modality, use-case category, and tool-calling support, or sort by price, latency, throughput, and newest releases.
Prefer not to pick? Set model to lokarouter/auto and the gateway routes each request to the best fit automatically.
Fallback routing
Every model on LokaRouter is hosted by multiple infrastructure providers. When the preferred provider is unavailable or rate-limited, the request is rerouted automatically.
You can tune the trade-off with the provider preferences object: prioritize price, throughput, or uptime. If you need to pin a specific provider, pass its slug and set allow_fallbacks to false.