# OpenClaw (/docs/integration/openclaw)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

Connect the OpenClaw gateway you already use to BitRouter. OpenClaw retains its agents, sessions, memory, tools, and automations; the gateway model selector determines which BitRouter route receives each model request.

> **info**
>
> This guide follows the development CLI in [BitRouter PR #1016](https://github.com/bitrouter/bitrouter/pull/1016), validated with OpenClaw 2026.10.9. Use a build with `bro connect` and check `bro connect --help` first. Older OpenClaw configurations using `agents.list` require an upgrade.

## Connect your gateway \[#connect-your-gateway]

Install and initialize OpenClaw, then prepare a usable [BitRouter gateway](https://bitrouter-docs-staging.up.railway.app/docs/overview/quickstart):

```bash
bro connect openclaw --dry-run
bro connect openclaw
```

Setup adds an independent BitRouter provider to one OpenClaw state root and keeps existing agent defaults, providers, and fallback selections. Start or reload that native gateway yourself. Its TUI, Web Control UI, and connected Desktop companion use the same backend catalog. No routing plugin is required.

In the TUI, select:

```text
/model bitrouter/automatos
```

In the native model picker, the provider group is currently **Bitrouter**, with **automatos** beneath it. The native alias resolves to the exact gateway request ID `bitrouter/automatos`.

For Cloud or another existing gateway, use [the shared endpoint and credential setup](https://bitrouter-docs-staging.up.railway.app/docs/integration/coding-agents#connect-an-existing-gateway). `--model` selects an exact advertised wire ID; `--display-name` only changes its label.

## Select the state root \[#select-the-state-root]

```bash
bro connect openclaw --instance /path/to/openclaw-state
```

`--instance` accepts the state directory or a config file inside it. Default discovery follows `OPENCLAW_CONFIG_PATH`, then `OPENCLAW_STATE_DIR`, then the normal OpenClaw home. Start OpenClaw with the matching state/config settings. A config-path override alone does not relocate native agent state.

The connection applies to configured agents and their model catalogs in that gateway instance. Existing model policies must allow the connected route; setup does not widen those policies. Select a different native OpenClaw profile through its actual state directory, not BitRouter's `--profile` flag.

A Desktop or Web client attached to a remote gateway needs configuration on that gateway's host. Local file changes do not configure a remote server. Existing sessions can retain their selected models.

## Agent and automation routes \[#agent-and-automation-routes]

Use OpenClaw's native agent/session model controls and per-job automation overrides to select a registered route. The connector does not change schedules, job inference accounts, or model bindings. See [agent models](https://docs.openclaw.ai/gateway/config-agents/models) and [automation model selection](https://docs.openclaw.ai/automation/cron-jobs/payloads).

Repeat `--model` to register multiple advertised selectors. The first keeps the `automatos` alias; additional entries use exact-ID labels. Native picker refs are `bitrouter/<wire-ID>`, without repeating the prefix when the wire ID already starts with `bitrouter/`. Additional refs that collide with the primary alias, or IDs with overlapping native refs, are refused. Existing model policies must permit every added route; allowing the primary alias does not authorize other models. Checks and selection restoration recognize OpenClaw's canonical refs. `--update` replaces the complete list when model flags are supplied, and preserves it otherwise. Workflow bindings stay in OpenClaw; saved jobs are not migrated when selectors are removed. See the shared [strategy and workflow boundary](https://bitrouter-docs-staging.up.railway.app/docs/integration/coding-agents#strategies-and-workflows).

## Verify and manage the connection \[#verify-and-manage-the-connection]

Use the same `--instance` for a nondefault connection:

```bash
bro connect openclaw --status
bro connect openclaw --check
bro connect openclaw --update
bro connect openclaw --remove
```

`--status` is an offline configuration check. `--check` also verifies catalog access with the saved credential; neither runs inference. Select BitRouter in the native client, send a small request, test any required tool roundtrip, and inspect [request receipts](https://bitrouter-docs-staging.up.railway.app/docs/cli/request-receipts) to verify actual execution.

The connector supports Chat Completions only. Native streaming and file-read tool turns were exercised with a deterministic upstream; this does not establish real-model quality or compatibility with arbitrary upstreams. OpenClaw's displayed default limits and cost estimates are not verified Automatos metadata.

## Credentials and removal \[#credentials-and-removal]

The gateway key is stored in a private file beside the selected config and referenced through OpenClaw's native file SecretRef. Config backups and generated model catalogs receive references rather than the literal key. JSON5 comments and unrelated configuration are preserved. Configurations using `$include` need explicit consolidation before this adapter can manage them.

Stop the selected native gateway before removal so it releases its in-memory credential. Removal restores owned defaults still selecting the connected model and removes the managed provider, alias, credential source, and recorded catalog replicas. Existing sessions must choose another available model afterward. Later references to the managed secret or unrecorded provider replicas need reconciliation before removal. See [connection management](https://bitrouter-docs-staging.up.railway.app/docs/integration/coding-agents#manage-a-connection).