Skip to main content
The Dari CLI launchers work the same against a gateway as against hosted Dari. With a gateway selected, they make no calls to Dari’s hosted API.

Choose The Gateway

dari gateway setup picks where agents route. The first launch on a machine asks the same question.
  • Hosted. Dari runs the gateway, with team sharing, Activity analytics, and Dari billing.
  • Fully local. The CLI installs the gateway’s standalone binary and runs it in the background on 127.0.0.1:7340, with no config file. Only this machine can use it.
  • Self-hosted. Enter the URL of a gateway your team runs and one of its DARI_GATEWAY_KEYS.
Manage a local gateway with dari gateway status, start, and stop. Launches install, update, and restart it as needed, dari accounts auto-routing sets its auto-routing key, and dari accounts key its provider API keys. Use dari setup <agent> to choose the models a local or self-hosted gateway serves, or a router spec file. Switching modes moves every agent you set up (Claude Code, Codex, Pi, OpenCode, the Claude and Codex apps, OpenClaw, and Hermes) to the new mode at once. A self-hosted gateway is remembered, so switching back is one choice.

Accounts

dari accounts opens the Accounts page for the gateway your agents route through. It shows each subscription’s plan, usage, and renewal, and lets you connect, rename, reconnect, or disconnect one. A launch with nothing connected opens this page first. On a local gateway, the CLI also saves provider API keys (Anthropic, OpenAI, DeepSeek, xAI, Meta, Google, and Fireworks) and the Dari API key that auto routing uses, and starts the gateway with them in its environment. A local gateway serves only those keys, never provider keys exported in your shell.

Launch An Agent

To select a gateway for one shell, overriding the saved choice:
Arguments after the agent name go to the agent:

What You See

  • Model picker. The agent lists the models of the gateway’s default router, starting on dari/routing. Pick a model to pin it with dari/model/<id>. A router can give each agent its own list with agents: in a router spec file.
  • Status line. Shows the model that served the turn and its thinking level.
  • Activity link. Omitted. Activity covers only hosted routing, so use hosted mode if you need usage observability.

Point Claude Code At The Gateway Yourself

Without the launcher, set the same variables it sets. Claude Code appends /v1/messages to the base URL itself:
To use a router other than default, append its name to the base URL. For a router named local:

Other Clients

Any client that speaks one of the gateway’s protocols can use it. Point the client at /v1, or /<router>/v1 for another router, and use a gateway key as its API key. Send model: "dari/routing" to let the router choose, or model: "dari/model/<id>" to pin a model. See HTTP API for the full request and response contract.

Hosted-Only Commands

These need hosted Dari and do not work with a local or self-hosted gateway: dari activity (usage and observability reports), dari router request-costs, and the subscription banked-reset commands (auto-reset, resets, use-reset).

Details

Accounts stay with the mode they were connected in. If the new gateway has none, dari gateway setup opens dari accounts so you can connect them.