Skip to main content
Most people never need this: coding agents set up their own routers, and the dashboard covers everyday changes. Use a router file when you want every setting in one place, or want to track changes in source control.

Router Spec

A router spec is a whole router in one file, with no credentials, so it is safe to share and keep in source control. Print any router as one, then apply it:
apply updates your router with the spec’s name, or creates one; --router <router_id> picks the router to update.
Each model is paid for with your subscription, then your org’s saved key, then Dari credits, as payment.allow permits. Applying again to an existing router keeps the choices it already made, such as a provider you moved to Dari credits. Change them on the router’s Models & Keys tab.

Router Manifest

The older manifest below sets credentials too. dari router create takes it.
The router’s endpoint looks like https://routing.dari.dev/rtr_123/chat/completions. New routers have Speculative Routing on.

Models

enabled_models lists the models the router may pick. dari router models shows the catalog and each model’s default provider. Limit a model’s reasoning levels with model_thinking_levels. Levels are off, minimal, low, medium, high, xhigh, and max. Leave a model out to allow every level it supports.

Credentials

Each provider uses Dari’s key (managed) or a saved API key. Save the key first on Subscriptions And API Keys, then reference its cred_... ID:
To serve a model through a gateway or your own cloud account instead of its default provider, bind it with model_providers. Gateways, Amazon Bedrock, and Microsoft Azure need a saved key. See Cloud Providers for Bedrock and Azure.

Subscriptions

subscription_providers lists the providers whose models try each person’s own plans first: every connected plan that serves the model, the maker’s plan first. Any provider works, such as fireworks for the GLM models OpenCode Go also serves; its models no plan serves stay on its credential. The provider’s credential above becomes the fallback, used only by models in subscription_api_fallback_models. To keep some of those providers’ models on the credential instead, list the ones the subscription serves in subscription_models; omitted, it serves them all. A model you enable later is served by the subscription until a list leaves it out.

Role Models

Pin the main agent or subagents to one model. A pinned role always gets that model, whatever the client asks for. Leave a role null to route it. role_prompts adds text to the end of a role’s system prompt.
Subagents include Claude Code workflow agents. Background requests, such as compaction, get neither.

Routing Instructions

Steer Dari Routing with plain-language rules. A request no rule matches is routed among all enabled models.

Other Settings

Custom Models

To add an OpenAI-compatible model that isn’t in the catalog, open Models in the Dari Dashboard and choose Add Model. Enter its base URL, model ID, context limit, pricing, and API key. Custom models are private to your organization.

CLI Flags

dari router create <name> and dari router update <router_id> take flags for most of these settings, such as --model, --provider-credential, --managed-key, --subscription, --subscription-model, --api-fallback, --main-model, --subagent-model, --main-prompt, and --session-pinning. On update, list flags replace the current list, and an empty value clears it. model_providers has no flag, so use a file.