# Configure OpenClaw

OpenClaw owns its model credentials, workspaces, tools, memory, and Agent
definitions. Vifu connects to its Gateway, discovers those Agents, and makes
them available to Vifu projects and project endpoints.

## 1. Start OpenClaw

From an OpenClaw checkout, use its Docker setup:

```bash
cd <openclaw>
./scripts/docker/setup.sh
docker compose ps
```

Keep the Gateway token created by OpenClaw. Vifu needs that token to connect,
but application clients do not.

## 2. Add OpenClaw in Vifu

Open your Vifu project, select **Providers**, then select **Add provider** and
**OpenClaw**.

Use these connection values for the common local setup:

| Vifu runtime | Gateway URL |
| --- | --- |
| Vifu in Docker, OpenClaw on the host | `http://host.docker.internal:18789` |
| Both running natively on the host | `http://127.0.0.1:18789` |

Paste the OpenClaw Gateway token into **Gateway token**, save the provider, and
run its connection test.

If OpenClaw runs on another machine, use its reachable Gateway URL instead.

## 3. Confirm the Agents

When the provider becomes online, Vifu discovers its Agents. Open **Agents** to
review the Agent cards, personas, capabilities, and active versions. Newly
detected Agents are added automatically; an Agent you remove can be restored
from **Add agent**.

You can now expose those Agents through the project's HTTP or realtime
endpoints and inspect their calls in the Console.

## Troubleshoot

Check OpenClaw first:

```bash
cd <openclaw>
docker compose ps
curl -sS http://127.0.0.1:18789/healthz
```

Then check Vifu Agent Gateway:

```bash
cd <vifu>
docker compose logs --tail=80 agent-gateway
```

The most common problems are an incorrect token or a Gateway URL that uses
`127.0.0.1` from inside the Vifu container. When OpenClaw is unavailable, Vifu
stays running and reconnects after the provider returns.
