AnRouter

Configure OpenClaw with AnRouter

Install OpenClaw, add AnRouter as a model provider, then validate and restart the Gateway.

An OpenClaw model provider key and a Gateway login token are different credentials. Use the AnRouter API key only for the model provider; do not put it in gateway.auth.token.

1. Install and check

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw --version
openclaw doctor

2. Put the key in the global runtime environment

# ~/.openclaw/.env
ANROUTER_API_KEY=your_anrouter_api_key

3. Add the provider without replacing existing configuration

Run the additive command below on the machine that actually runs the Gateway. OpenClaw protects provider maps from destructive replacement; --merge preserves existing channels, tools, skills, providers, and Gateway settings.

Gateway locationConfiguration to edit
Local macOS / Linux~/.openclaw/openclaw.json
Native Windows%USERPROFILE%\.openclaw\openclaw.json
Windows Hub / WSLEdit ~/.openclaw/openclaw.json inside the WSL environment that actually runs the Gateway
Remote GatewaySign in to the remote host and edit the remote user's configuration
Why there is no UI screenshot here: OpenClaw's entry point varies across local, WSL, Hub, and remote Gateways. The authoritative file is on the machine that actually runs the Gateway. Use the table above instead of editing the wrong device by following an unrelated screenshot.
openclaw config set models.providers.anrouter \
  '{"baseUrl":"https://api.anrouter.com/v1","apiKey":"${ANROUTER_API_KEY}","api":"openai-completions","models":[{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash"},{"id":"glm-5.2","name":"GLM 5.2"},{"id":"glm-5.3","name":"GLM 5.3"},{"id":"glm-5.3-flash","name":"GLM 5.3 Flash"},{"id":"minimax-m3.1-flash","name":"MiniMax M3.1 Flash"},{"id":"qwen3.8-27b","name":"Qwen 3.8 27B"},{"id":"qwen3.8-flash-next","name":"Qwen 3.8 Flash Next"},{"id":"mimo-v2.6-pro","name":"MiMo V2.6 Pro"},{"id":"mimo-v2.6-flash","name":"MiMo V2.6 Flash"}]}' \
  --strict-json --merge

4. Validate and restart the Gateway

openclaw config validate
openclaw models list
openclaw models set anrouter/glm-5.3
openclaw gateway restart
openclaw gateway status
Capability note: openai-completions is the Chat Completions adapter. OpenClaw is a tool-intensive agent, so validate tool calling, streaming, and long-context behavior—not only ordinary chat—before production.

References: OpenClaw custom providers · safe config set edits