# Use Nekko with OpenClaw

[OpenClaw](https://openclaw.ai) is a personal agent that you run yourself. Nekko Agent works with it in both directions: OpenClaw can use the models in Nekko's Model Server, and Nekko can chat with your OpenClaw agent.

Nekko never installs OpenClaw, signs you in to it or reads its credentials. It only edits OpenClaw's config file, and only after showing you the change.

## Run OpenClaw on Nekko's models

Most people use this direction: Nekko's Model Server runs local models, and OpenClaw answers with them.

1. Download or load a model in Nekko, and start the Model Server.
2. Open **Models**, then **Model server**, and choose **Use with OpenClaw** beside the server's address.
3. Nekko shows the change it will make to OpenClaw's config. Read it, then choose **Write to OpenClaw**. Turn on **Make Nekko's model OpenClaw's default** if you want OpenClaw to start using it straight away.
4. Restart the OpenClaw gateway if it is running, so it reads the new config.

What Nekko writes, under `models.providers.nekko`:

- `baseUrl`: the Model Server's address on this computer, such as `http://127.0.0.1:11500/v1`.
- `api`: `openai-completions`.
- `apiKey`: the Model Server's key, when it has one. With no key Nekko writes `auth: "none"` instead, which OpenClaw accepts for a server that needs no sign-in.
- `models`: the chat models the Model Server lists, with their names and context sizes.

With **Make Nekko's model OpenClaw's default** on, it also sets `agents.defaults.model.primary` to `nekko/<model>`. Nothing else in the file changes.

### What stays safe

- **You see the change first.** The key is hidden in the preview, so it is safe to share a screenshot of it.
- **A backup comes first.** Before the file changes, Nekko copies it beside the original as `openclaw.json.nekko-backup-<date>-<time>`.
- **Your comments and layout stay.** OpenClaw's config is JSON5. Nekko edits only the keys above in place, so your comments, quotes, indentation and other settings are left exactly as they were.
- **A file Nekko cannot read is left alone.** If the config does not parse, Nekko says which line and writes nothing.
- **Undo puts it back.** **Undo** removes the `nekko` provider and restores the default model OpenClaw had before. If you changed the default yourself afterwards, Undo leaves your choice alone.

If the Model Server has no models, Nekko says so and writes nothing. If it is not running, Nekko still writes the config and tells you OpenClaw will get connection errors until you start it.

### Which file

Nekko edits the file OpenClaw reads, following OpenClaw's own rules: `OPENCLAW_CONFIG_PATH`, then `OPENCLAW_STATE_DIR`, then the profile folder for `OPENCLAW_PROFILE`, then `~/.openclaw/openclaw.json` (under `OPENCLAW_HOME` when that is set). The dialog shows the exact path. Nekko reads those variables from its own environment, so if you set them only in a terminal, start Nekko from that terminal or check the path in the dialog.

## Chat with OpenClaw from Nekko

The other direction adds your OpenClaw gateway to Nekko as a provider.

1. In **Models**, choose **Add provider**, then **OpenClaw gateway** (under **More**).
2. Paste the gateway token as the key. Nekko stores it in its vault like any other provider key. Leave it empty only if your gateway has no auth.
3. Choose **Connect**. The model is `openclaw/default`, which is your default OpenClaw agent. Other agents the gateway lists, such as `openclaw/<agentId>`, appear too.

The address starts as `http://127.0.0.1:18789/v1`. If OpenClaw's config sets another `gateway.port`, Nekko uses that.

A valid gateway token is full operator access to your OpenClaw. Keep the gateway on this computer or a private network.

### If Nekko says the chat endpoint is off

OpenClaw keeps its OpenAI-compatible endpoint off until `gateway.http.endpoints.chatCompletions.enabled` is `true`. When the config says it is off, or the gateway answers 404, the preset says so and offers **Turn it on in OpenClaw's config**. That opens the same preview, backup and Undo as above, and changes only that one key. Restart the gateway afterwards.

If Nekko cannot find OpenClaw's config (OpenClaw runs on another computer, say), it tells you the key to set instead.
