> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dari.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Run OpenClaw through a Dari Router.

Install the [Dari CLI](https://docs.dari.dev/install-cli.md), then launch OpenClaw through your organization's default router:

```bash theme={null}
dari openclaw
```

OpenClaw runs every chat, channel, and scheduled task through one long-lived Gateway that reads `~/.openclaw/openclaw.json`, so a single launch cannot route only itself. `dari openclaw` writes Dari into OpenClaw's config instead, then starts the installed `openclaw` executable with every following argument. The write goes through `openclaw config patch`, which validates it and hot-reloads a running Gateway, so your channels route through Dari too. Your other providers, channels, and settings are kept.

Setup adds a `dari` provider under `models.providers` that offers your router's models and makes `dari/dari/routing` (or your router's first model, without Autorouting) the primary model in `agents.defaults.model`. Fallbacks you configured stay in place. The model setup replaced is saved in `~/.openclaw/dari-setup.json`. To set up without launching, or to undo it and restore your previous primary model:

```bash theme={null}
dari openclaw --setup
dari openclaw --remove-setup
```

On first use, Dari signs you in if needed and creates and privately caches a Routing key, which setup writes as the provider's `apiKey`. Gateway includes personal subscriptions, Dari managed billing, and bring-your-own provider keys; the \$20/month individual Autorouting plan unlocks the `dari/routing` router. Gateway serves any model enabled on your router: switch between them with `/model`, or pick `dari/dari/model/<model>`. To subscribe, run `dari openclaw --connect` and choose **Get Autorouting** (or press `a` in the setup model picker).

On first launch, setup opens an **Accounts** page where you can connect one or more ChatGPT subscriptions, connect an API key (Vercel AI Gateway, OpenRouter, or direct provider keys), or choose Dari managed billing. Run `dari openclaw --connect` to open it again. Each launch refreshes the provider, so run `dari openclaw` or `dari openclaw --setup` again after changing the router's models.

OpenClaw sends Chat Completions requests through the router at `/v1`. Setup configures a one-million-token context window and turns on prompt cache keys and session-affinity headers, which group all requests from one OpenClaw session under the same conversation in **Activity**.

## Manual Configuration

If you do not want to use the launcher, create a [Routing API key](https://docs.dari.dev/api-keys.md#create-a-routing-key) and patch it into OpenClaw's config:

```bash theme={null}
openclaw config patch --stdin --replace-path models.providers.dari <<'EOF'
{
  "models": {
    "providers": {
      "dari": {
        "baseUrl": "https://routing.dari.dev/v1",
        "apiKey": "dari_...",
        "api": "openai-completions",
        "models": [
          {
            "id": "dari/routing",
            "name": "Dari Router",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 1000000,
            "maxTokens": 128000,
            "compat": { "supportsPromptCacheKey": true, "sendSessionAffinityHeaders": true }
          }
        ]
      }
    }
  },
  "agents": { "defaults": { "model": { "primary": "dari/dari/routing" } } }
}
EOF
```

`"reasoning": false` keeps OpenClaw from sending a fixed reasoning level; Dari still chooses one per request.

To use a different model set, edit the default router or [Create A Router](https://docs.dari.dev/router/create-a-router.md). To launch `dari openclaw` on that router, add **OpenClaw** to its card on the **Routers** page or run `dari router assign-agent <router_id> openclaw`; the **X** on the card moves it back to the default router. With manual configuration instead, point `baseUrl` at `https://routing.dari.dev/{router_id}/v1`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.