OpenClaw
Install OpenClaw and the UniRoute authentication plugin using the models available to your API key.
OpenClaw · pay-as-you-go API
Configure a UniRoute model provider directly in OpenClaw with one command. Keep existing workspace, gateway, and messaging settings while changing model authentication.
Best for: Local agent gateways, scheduled workflows, and chat-channel assistants.
Quick setup
Sign in to create a key and fill it in automatically Sign in
UNIROUTE_API_KEY=YOUR_UNIROUTE_API_KEY npx -y uniroute-setup@latest configure openclaw --model claude-sonnet-5-5$env:UNIROUTE_API_KEY="YOUR_UNIROUTE_API_KEY"; npx -y uniroute-setup@latest configure openclaw --model claude-sonnet-5-5Requires Node.js 22+ for the setup tool. Add --dry-run to preview the file changes without writing; --home /path/to/test-home uses an isolated home. Existing changed files are backed up and unrelated settings are preserved.
Manual configuration
1. Locate and back up the files
macOS / Linux: ~/.openclaw/openclaw.json. Windows: $HOME\.openclaw\openclaw.json. Back up the existing JSON5 configuration before merging.
2. Merge the provider settings
{
"models": {
"providers": {
"uniroute-anthropic": {
"baseUrl": "https://api.uniroute.app",
"apiKey": "YOUR_UNIROUTE_API_KEY",
"api": "anthropic-messages",
"models": [
{
"id": "claude-sonnet-5-5",
"name": "Claude Sonnet 5.5"
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "uniroute-anthropic/claude-sonnet-5-5"
}
}
}
}3. Match provider names to protocols
| Protocol | Provider |
|---|---|
| Messages | uniroute-anthropic |
| Responses | uniroute-openai-responses |
| Chat Completions | uniroute-openai-chat |
| Gemini | uniroute-gemini |
The setup tool selects the provider, API field, and base URL together. Keep the model ID after the provider prefix.
4. Restart the gateway
openclaw models status
openclaw gateway restart
openclaw tui
Set up Telegram, Feishu, and the web control interface after model configuration. Their credentials are separate: Telegram, Feishu, control UI. Review heartbeat and scheduled-task settings for automatic requests.
Alternative: native authentication plugin
The UniRoute authentication plugin integrates with OpenClaw’s login flow. Install it, then sign in using the hidden key prompt:
curl -fL https://uniroute.app/community/openclaw-uniroute-auth-0.1.3.tgz -o openclaw-uniroute-auth-0.1.3.tgz
openclaw plugins install ./openclaw-uniroute-auth-0.1.3.tgz
openclaw models auth login --provider uniroute --method api-key
openclaw models list --all --refresh --provider uniroute-anthropic
openclaw models set uniroute-anthropic/claude-sonnet-5-5
On PowerShell use curl.exe. Confirm plugin permissions and provider registration. Plugin sign-in keeps the existing default model until you set it; it writes configuration only after a successful catalog query. Delete the downloaded archive after installation.
To choose Claude Fable 5.2, use the login and catalog-list commands above to load the current catalog for your key. If an existing configuration is missing claude-fable-5-2, repeat those steps before selecting it:
openclaw models set uniroute-anthropic/claude-fable-5-2
What these fields do
| Field | Purpose |
|---|---|
| baseUrl / api | The protocol address and OpenClaw API adapter. |
| apiKey | The UniRoute credential for model requests. |
| models | The model IDs registered under this provider. |
| agents.defaults.model.primary | The default provider/model-ID pair. |
Choose a model
Confirm the connection
Check status with openclaw models status to inspect the active model and service.
Send a short test: In openclaw tui, send: Reply only: hello
Open usage logs to review the model, request status and charge. The test is a real, billed API request.
Match its time, model, and actual charge in the usage log. Keep the key in private configuration and out of repositories.
Switch back / restore a backup
Stop the gateway, restore the printed openclaw.json backup, then run openclaw gateway restart. For manual rollback, restore the previous default model and remove only the provider added here. Keep workspace and channel settings.
If a file was new and has no backup, remove only the fields added by this setup and preserve settings added later.
Not installed yet?
Follow the official OpenClaw getting-started guide for the current Node.js requirement. Install the client, then initialize the local workspace and gateway:
npm install -g openclaw
openclaw --version
openclaw onboard
FAQ
Do I need the authentication plugin too?
Direct setup writes provider settings without the plugin. Use the plugin when you prefer OpenClaw’s native login flow.
Does model setup configure chat channels?
Configure workspace, gateway, and each messaging account in OpenClaw after the model provider.
Troubleshooting
401 / authentication failed
The active credential is incomplete, revoked, or still points to another provider.
Paste a valid UniRoute key and check the active authentication method.
404 / wrong endpoint
The base URL and adapter path do not match.
Use the address shown above and remove duplicated /v1 or /v1beta segments.
Model missing / 403
The selected model, key permissions, or wallet funds need attention.
Check the model ID, key restrictions, and wallet in the console, then restart the client.
Changes did not take effect
A running process or a different config directory is still in use.
Quit the client completely, check its effective configuration path, then reopen.
Related links
Manage API keys
Model prices
