OpenClaw Custom Provider Setup, Best Models & API Costs
OpenClaw reads custom provider definitions from ~/.openclaw/openclaw.json (JSON5). Register WorldRouter as an OpenAI-compatible provider to access Claude Sonnet 5.5, Opus 5.5, Fable 5.2, GPT-6.1 Sol, Gemini 4, GLM-5, DeepSeek V4 Pro, and 60+ models through one API key. The model and cost tables below compare selected WorldRouter rates with published reference rates.
Note: Switching from
openrouter/autoor direct provider keys? See WorldRouter vs OpenRouter for rate comparisons, or top up credits with card, Alipay, WeChat Pay, or stablecoin (100 credits = $1.00 USD).
Connect OpenClaw to WorldRouter
If OpenClaw is already installed, connect WorldRouter via either the CLI onboarding command or ~/.openclaw/openclaw.json.
Option A: One-command CLI setup (openclaw onboard)
Export your WorldRouter API key and register worldrouter as a custom OpenAI-compatible endpoint non-interactively:
export WORLDROUTER_API_KEY="your_worldrouter_api_key"
openclaw onboard --non-interactive --accept-risk \
--mode local \
--auth-choice custom-api-key \
--custom-provider-id "worldrouter" \
--custom-compatibility openai \
--custom-base-url "https://inference-api.worldrouter.ai/v1" \
--custom-model-id "claude-sonnet-5-5" \
--custom-api-key "$WORLDROUTER_API_KEY"Verify that OpenClaw loaded the provider and active model:
openclaw models statusOption A registers one model under worldrouter. Send a short message to verify inference and check its model and charge in Activity. Use Option B to register several models and set /model aliases.
Option B: Multi-model ~/.openclaw/openclaw.json (recommended for cost control)
OpenClaw uses JSON5, so comments and trailing commas are valid. Merge this configuration into ~/.openclaw/openclaw.json (keep models.mode: "merge" so built-in providers remain intact):
{
models: {
mode: "merge",
providers: {
worldrouter: {
baseUrl: "https://inference-api.worldrouter.ai/v1",
apiKey: "${WORLDROUTER_API_KEY}",
api: "openai-completions",
models: [
{
id: "claude-sonnet-5-5",
name: "Claude Sonnet 5.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 64000,
},
{
id: "claude-opus-5-5",
name: "Claude Opus 5.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 64000,
},
{
id: "claude-fable-5.2",
name: "Claude Fable 5.2",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 64000,
},
{
id: "gpt-6.1-sol",
name: "GPT-6.1 Sol",
reasoning: true,
input: ["text", "image"],
contextWindow: 1050000,
maxTokens: 32768,
},
{
id: "gemini-4-neon",
name: "Gemini 4 Neon",
reasoning: true,
input: ["text", "image"],
contextWindow: 1048576,
maxTokens: 65536,
},
{
id: "glm-5",
name: "GLM-5",
reasoning: true,
input: ["text"],
contextWindow: 200000,
maxTokens: 32768,
},
{
id: "deepseek-v4-pro",
name: "DeepSeek V4 Pro",
reasoning: true,
input: ["text"],
contextWindow: 1000000,
maxTokens: 32768,
},
{
id: "gpt-6-luna",
name: "GPT-6 Luna",
reasoning: false,
input: ["text", "image"],
contextWindow: 1050000,
maxTokens: 16384,
},
],
},
},
},
agents: {
defaults: {
model: {
primary: "worldrouter/claude-sonnet-5-5",
fallbacks: ["worldrouter/gpt-6.1-sol", "worldrouter/glm-5"],
},
models: {
"worldrouter/claude-sonnet-5-5": { alias: "sonnet" },
"worldrouter/claude-opus-5-5": { alias: "opus" },
"worldrouter/claude-fable-5.2": { alias: "fable" },
"worldrouter/gpt-6.1-sol": { alias: "gpt" },
"worldrouter/gemini-4-neon": { alias: "gemini" },
"worldrouter/glm-5": { alias: "glm" },
"worldrouter/deepseek-v4-pro": { alias: "deepseek" },
"worldrouter/gpt-6-luna": { alias: "luna" },
},
},
},
}Restart the OpenClaw gateway so the updated catalog takes effect:
openclaw gateway restartPrerequisites
- OpenClaw installed (
openclaw --version). Config lives at~/.openclaw/openclaw.jsonon macOS/Linux or%USERPROFILE%\.openclaw\openclaw.jsonon Windows. - WorldRouter API key. Generate one in the API Keys dashboard and persist
WORLDROUTER_API_KEYin~/.zshrc,~/.bashrc, or your service environment. - Available credits. OpenClaw runs multi-turn tool loops; top up on the Credits page before starting long sessions (
100 credits = $1.00 USD, see the top-up guide).
How to change or switch models in OpenClaw
Once your models and aliases are registered in openclaw.json, you can switch models without editing JSON again:
Inside an active OpenClaw chat session:
/model # open interactive picker and show current model
/model glm # switch to worldrouter/glm-5 for routine tasks
/model opus # escalate to worldrouter/claude-opus-5-5 for complex debugging
/model fable # switch to worldrouter/claude-fable-5.2 for a difficult task
/model status # inspect active provider endpoint and auth statusFrom your terminal (persists the new default):
openclaw models set worldrouter/glm-5
openclaw models listBest models for OpenClaw by workload
Most agent turns are routine file reads, status checks, summarization, or simple tool calls, while a smaller share require deep multi-file reasoning. Pairing a low-cost default with a frontier escalation model keeps quality high without burning frontier rates on background turns.
| Role in OpenClaw | Recommended Model | WorldRouter USD (In / Out per 1M) | Official / OpenRouter Base | Savings | Why it fits OpenClaw |
|---|---|---|---|---|---|
| Best all-around primary | claude-sonnet-5-5 | $1.40 / $7.00 | $2.00 / $10.00 | 30% lower | Reliable tool-calling, 1M context, fast code edits |
| Hardest refactors & architecture | claude-fable-5.2 | $3.20 / $16.00 | $8.00 / $40.00 | 60% lower | Frontier reasoning at near-Sonnet pricing on WorldRouter |
| Deep agentic debugging | claude-opus-5-5 | $2.80 / $14.00 | $4.00 / $20.00 | 30% lower | Strong multi-step planning for complex debugging |
| OpenAI flagship alternative | gpt-6.1-sol | $1.40 / $7.00 | $2.00 / $10.00 | 30% lower | Great fallback when mixing OpenAI and Anthropic tool styles |
| Multimodal & long-context research | gemini-4-neon | $1.65 / $8.25 | $3.00 / $15.00 | 45% lower | 1M context for large repo ingestion, screenshots, and docs |
| Best value daily driver | glm-5 | $0.55 / $1.76 | $1.00 / $3.20 | 45% lower | Agentic coding at $1.76 per 1M output tokens |
| Budget coding & sub-agents | deepseek-v4-pro | $0.462 / $1.386 | — | Off-peak rate shown | Low-cost option for parallel worker agents |
| Heartbeats, triage & cron jobs | gpt-6-luna | $0.07 / $0.35 | $0.10 / $0.50 | 30% lower | Pennies per million tokens for always-on background checks |
All rates are per 1,000,000 text tokens (100 credits = $1.00 USD), verified November 30, 2026. DeepSeek V4 Pro uses time-window pricing. The table shows its off-peak rate; the model page lists both schedules. Browse all 60+ exact IDs on the Models page or see full Claude API pricing.
OpenClaw API pricing by monthly workload
OpenClaw is free to install. These monthly estimates cover model input and output tokens at the listed rates. They assume the same model split for input and output and exclude hosting, tools, and cache charges. The reference columns use published model rates, with the OpenRouter Standard top-up fee shown separately.
| Monthly Workload | Token Volume (In / Out) | Model Strategy | Official / OpenRouter Base | WorldRouter Cost | Monthly Savings |
|---|---|---|---|---|---|
| Light personal assistant (chat, quick tasks, ~1–2 hrs/day) | 5M in / 1M out | 100% glm-5 | $8.20 | $4.51 (451 credits) | $3.69 (45% saved) |
| Daily coding & tool-use agent (~5–6 hrs/day active dev) | 25M in / 5M out | 80% glm-5 + 20% claude-opus-5-5 | $72.80 ($76.80 w/ OR fee) | $46.04 (4,604 credits) | $26.76–$30.76 saved |
| Always-on multi-agent & heartbeats (background cron + heavy escalations) | 100M in / 15M out | 85% gpt-6-luna + 15% claude-fable-5.2 | $224.88 ($237.24 w/ OR fee) | $94.41 (9,441 credits) | $130.47–$142.83 saved |
Three practical ways to keep OpenClaw bills low
- Never run always-on heartbeats on Opus or Fable. Route scheduled checks and simple routing turns to
gpt-6-luna($0.07 / $0.35) orgemini-3.8-flash($0.3375 / $1.6875), and/model opusor/model fableonly for hard tasks. - Check cache usage. Repeated system prompts and workspace context can use prompt caching when the request path supports it. See Claude API pricing for cache read and write rates.
- Plan top-ups separately from model usage. WorldRouter applies a 0% platform fee to supported card, Alipay, WeChat Pay, and USDC or USDT top-ups on BNB Chain.
Troubleshooting
Model "worldrouter/<model>" is not allowed
Check the provider’s model list and the agent’s override policy. The provider row must use the exact WorldRouter model ID, and agents.defaults.models holds aliases and per-model settings. Older configurations can still have a legacy model-map restriction.
If agents.defaults.modelPolicy.allow or a per-agent policy is set, add the full worldrouter/<id> reference or worldrouter/* to the existing list. Keep any entries for other providers. See the OpenClaw model policy reference .
Built-in providers disappeared after editing openclaw.json
Use the default models.mode: "merge" when you want both built-in and custom providers. In "replace" mode, OpenClaw lists only the providers and models defined in your configuration.
401 Unauthorized or missing API key in background daemon
If openclaw gateway runs as a background service (launchd / systemd), shell variables from ~/.zshrc may not be inherited by the daemon. Either pass the environment variable to the service unit or set WORLDROUTER_API_KEY in OpenClaw’s environment config, then run openclaw gateway restart.
404 Not Found on completions
Verify two fields:
baseUrlmust end with/v1:https://inference-api.worldrouter.ai/v1(withapi: "openai-completions").idinsidemodelsmust match the exact case-sensitive WorldRouter slug on/models(for example,claude-sonnet-5-5with hyphens,claude-fable-5.2with a dot, orMiniMax-M2.7with capitalMs—do not prependanthropic/oropenai/inside the provider’sidfield).
Frequently asked questions
Is OpenClaw free to use?
OpenClaw is free, open-source software. You pay for the cloud model usage and any hosting or other services you choose.
How much does OpenClaw cost per month on WorldRouter?
Cost depends on the model and token volume. In the examples above, a light assistant using GLM-5 costs $4.51 per month and a coding agent using GLM-5 and Claude Opus 5.5 costs $46.04 per month.
How is WorldRouter different from openrouter/auto in OpenClaw?
WorldRouter lets you choose a specific model and pricing group through one API key. Compare the rates on the model catalog and the WorldRouter vs OpenRouter guide.
Can I combine local Ollama models and WorldRouter?
Yes. With models.mode set to merge, you can keep a local Ollama provider alongside WorldRouter and switch between their models in a session.