Use RouterBrain as the model provider in OpenClaw and call any catalog model through the gateway.
OpenClaw is a locally run personal AI assistant that integrates with messaging platforms for remote control. RouterBrain exposes OpenAI-compatible chat completions—ideal as a custom provider in OpenClaw.
Prerequisites
- Create an inference API key in the console (API keys).
- Pick a catalog
idfrom List models for use in OpenClaw.
| Field | Value |
|---|---|
| Base URL | https://51kik.com/v1 |
| API Key | Console inference key |
| Protocol | OpenAI-compatible (openai-completions) |
Install OpenClaw
macOS / Linux:
curl -fsSL https://openclaw.bot/install.sh | bash
Windows (PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iex
Confirm with openclaw --version.
Configure RouterBrain
Option A: Interactive wizard (recommended)
openclaw configure
Follow the prompts:
- Where will the Gateway run? → Local (this machine)
- Select sections to configure → Model
- Choose a Custom / OpenAI-compatible provider (wording varies by OpenClaw version)
- Base URL →
https://51kik.com/v1(must include/v1) - API Key → your RouterBrain inference key
- Model id → catalog
id
Option B: Edit config file
Config is usually at ~/.openclaw/openclaw.json or ~/.config/openclaw/openclaw.json5 (depends on version).
Replace YOUR_MODEL_ID with a catalog id:
{
env: {
ROUTERBRAIN_API_KEY: "YOUR_ROUTERBRAIN_KEY",
},
agents: {
defaults: {
model: { primary: "routerbrain/YOUR_MODEL_ID" },
},
},
models: {
mode: "merge",
providers: {
routerbrain: {
baseUrl: "https://51kik.com/v1",
apiKey: "${ROUTERBRAIN_API_KEY}",
api: "openai-completions",
models: [
{
id: "YOUR_MODEL_ID",
name: "RouterBrain Model",
},
],
},
},
},
}
Note: For OpenAI-compatible endpoints,
baseUrlmust include/v1. See Base URL and environments.
Restart the gateway after saving:
openclaw gateway restart
Verify
openclaw models list --provider routerbrain
openclaw tui
Send a message in the TUI—a normal reply means success.
If it fails, validate key and model with curl first (First request), then check OpenClaw logs.
Tools and streaming
- Gateway supports OpenAI-shaped
tools/tool_calls(Chat Completions). - Streaming: Streaming.
- After provider changes, restart the gateway and clear stale agent session cache if needed.
Troubleshooting
| Symptom | Check |
|---|---|
| 401 / 403 | Key or model access |
| 404 / path errors | baseUrl includes /v1; no /v1/v1 |
| Config ignored | Run openclaw gateway restart |
| Empty model list | id matches GET /models |