
# OpenClaw

[OpenClaw](https://openclaw.ai/) is an open-source personal agent that
runs on your machine and answers from chat apps, a terminal or a
schedule. LowRouter has a provider plugin for it on
[ClawHub](https://clawhub.ai/), OpenClaw's plugin registry. Without the
plugin, OpenClaw also takes LowRouter as a custom provider in its config
file.

## Install the plugin

The plugin needs OpenClaw 2026.10.2 or later, which needs Node.js 24.16
or later.

```bash
npm install -g openclaw@latest
openclaw plugins install clawhub:@lowrouter/openclaw-provider
```

OpenClaw asks you to approve the plugin's capabilities during the
install. Then add your key through onboarding, which also makes
`auto/mistralai/mistral-large-2512` the default model:

```bash
openclaw onboard --auth-choice lowrouter-api-key
```

Or export the key instead and pick a model yourself:

```bash
export LOWROUTER_API_KEY=sk-lr-...
openclaw models list --refresh --provider lowrouter
openclaw models set lowrouter/auto/mistralai/mistral-large-2512
```

Then run an agent turn:

```bash
openclaw agent --local --message "What is in my workspace?"
```

What the plugin does:

- It reads the model list from LowRouter and refreshes it every five
  minutes. A new model shows up without a plugin update.
- It lists `auto/` chat models with function calling, plus your
  account's `alias/` models. Context windows and output limits come
  from the same list, so you don't set them in the config.
- Jurisdiction-scoped IDs such as
  `auto/mistralai/mistral-large-2512/eu` are not in the list, but
  `openclaw models set` accepts them.
- OpenClaw shows costs in US dollars. The plugin uses the price of each
  model's most expensive route, so OpenClaw's estimate is an upper
  bound. You are billed in euros, for the route that served the
  request.

Use `openclaw models set` to change the default model.
`openclaw config set agents.defaults.model.primary` can reject a model
the plugin found.

The plugin's source and release notes are on
[GitHub](https://github.com/carboniferio/openclaw-lowrouter-provider).

## Without the plugin

Verified against OpenClaw **2026.9.6**. The config below is re-run
against that release every week, including a tool call round trip.

```bash
npm install -g openclaw@2026.9.6
```

### Configure

Add LowRouter as a provider in `~/.openclaw/openclaw.json` and make
one of its models the default:

<!-- verify: openclaw-config -->
```json
{
  "models": {
    "mode": "merge",
    "providers": {
      "lowrouter": {
        "baseUrl": "https://api.lowrouter.ai/v1",
        "apiKey": "${LOWROUTER_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "auto/mistralai/mistral-large-2512",
            "name": "Mistral Large (LowRouter)",
            "contextWindow": 256000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": { "primary": "lowrouter/auto/mistralai/mistral-large-2512" }
    }
  }
}
```

`${LOWROUTER_API_KEY}` is read from the environment when OpenClaw
starts, so the key stays out of the file:

```bash
export LOWROUTER_API_KEY=sk-lr-...
openclaw config validate
openclaw agent --local --message "What is in my workspace?"
```

`--local` runs one agent turn in the terminal without the OpenClaw
gateway service; the same config serves the gateway and chat apps.

Details of this config:

- OpenClaw checks the file against a strict schema and refuses to
  start on a key it does not know. Run `openclaw config validate`
  after editing; it names the offending key.
- The default model is `lowrouter/` followed by the LowRouter model
  ID. OpenClaw splits on the first slash only, so the slashes inside
  the ID are fine.
- `baseUrl` ends in `/v1`. OpenClaw appends only `/chat/completions`.
- `maxTokens` caps the answer length OpenClaw asks for (sent as
  `max_completion_tokens`). Without it OpenClaw asks for 8,192.
  `contextWindow` is what it plans compaction around; set it to the
  model's real context window from the model browser.
- `mode: "merge"` keeps OpenClaw's built-in providers next to
  LowRouter. Each additional LowRouter model is another entry in
  `models`.
- The agent's file tools work inside its workspace,
  `~/.openclaw/workspace`, not the directory you run it from.

## Picking a model

OpenClaw's agent acts through function calling, so pick a model with
the *function-calling* tag. [The model browser filtered to
them](/models?function_calling=yes) lists every one.

The example uses `auto/mistralai/mistral-large-2512`, served from
the EU (256k context). Models we have run through OpenClaw's tool
loop:

- `auto/qwen/qwen3-coder-30b-a3b-instruct`, a coding model served
  from the EU (128k context).
- `auto/anthropic/claude-haiku-4.5`, a cheaper Anthropic model
  (200k context).

## Recommended setup

- Use a dedicated key. OpenClaw can wake itself on a schedule and act
  on incoming messages, so it can spend while you are away; a key of
  its own shows that spend separately and can be revoked on its own.
- Without the plugin, give each LowRouter model its real
  `contextWindow` and a `maxTokens` within the model's output limit.
  The plugin reads both from LowRouter.

## Troubleshooting

- "requires capability consent" during `openclaw plugins install`:
  the install ran without a prompt to answer, as in a script. Re-run
  it with `--accept-capabilities`.
- "Unknown model" from `openclaw config set` for a LowRouter model the
  plugin lists: set it with `openclaw models set` instead.
- "The selected model was not found by the provider" with a `404`:
  `baseUrl` is missing `/v1`. The request went to a path LowRouter
  does not serve, and OpenClaw reports that as an unknown model.
- OpenClaw will not start after an edit: run `openclaw config
  validate`. A misspelled key is rejected outright.
- A `400` about output tokens: the model's output limit is lower than
  `maxTokens` (or the 8,192 default). Lower `maxTokens` for that
  model entry.
- The agent cannot find a file you mention: put it in
  `~/.openclaw/workspace`.
