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

  1. Create an inference API key in the console (API keys).
  2. Pick a catalog id from List models for use in OpenClaw.
FieldValue
Base URLhttps://51kik.com/v1
API KeyConsole inference key
ProtocolOpenAI-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:

  1. Where will the Gateway run?Local (this machine)
  2. Select sections to configureModel
  3. Choose a Custom / OpenAI-compatible provider (wording varies by OpenClaw version)
  4. Base URLhttps://51kik.com/v1 (must include /v1)
  5. API Key → your RouterBrain inference key
  6. 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, baseUrl must 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

SymptomCheck
401 / 403Key or model access
404 / path errorsbaseUrl includes /v1; no /v1/v1
Config ignoredRun openclaw gateway restart
Empty model listid matches GET /models

Related