What It Does
- One endpoint, three protocols. Anthropic Messages, OpenAI Chat Completions, and OpenAI Responses share one server, along with a model list.
- Routers. Each router is a named set of models and settings, served on its own path.
- Your credentials. Serve from provider API keys, connected subscriptions, or both. Several subscriptions per provider are pooled.
- Failover. A provider failure retries the router’s next model.
- Prompt-cache aware. Conversations keep their identity and serving model across turns, so provider caches stay warm.
How A Request Is Served
- Authenticate. The client sends one of your gateway keys (
DARI_GATEWAY_KEYS) as a bearer token. - Pick the router.
/v1/...uses thedefaultrouter./<router>/v1/...uses the router with that name. - Pick the model.
dari/model/<id>serves exactly that model.dari/routinglets the router choose: withDARI_AUTO_ROUTING_API_KEYset, Dari Auto Routing picks, and without it the first model in the list that has a credential serves. - Pick the credential. With
subscriptions: true, a connected subscription serves first. Otherwise, or when every subscription is held, the provider’s API key serves. - Call the provider. A failed call retries the same model up to
retriestimes, then moves to the next model.
Hosted Or Self-Hosted
Observability needs hosted Dari. Requests served by a self-hosted gateway never reach Dari, so there is no Activity dashboard, per-request cost, or usage analytics for them. If you need those, use hosted routing.
Start Here
Quickstart
Run the gateway and send it a first request.
Configure Routers
Choose the models and settings each router serves.
Subscriptions
Connect and pool Claude Code, ChatGPT, and Muse Code plans.
Coding Agents
Launch Claude Code, Codex, and other agents against the gateway.
packages/gateway of github.com/mupt-ai/dari, under Apache-2.0.