WorldRouter

Skip to Content
AgentsOpenClaw

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/auto or 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 status

Option 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.

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 restart

Prerequisites

  1. OpenClaw installed (openclaw --version). Config lives at ~/.openclaw/openclaw.json on macOS/Linux or %USERPROFILE%\.openclaw\openclaw.json on Windows.
  2. WorldRouter API key. Generate one in the API Keys dashboard and persist WORLDROUTER_API_KEY in ~/.zshrc, ~/.bashrc, or your service environment.
  3. 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 status

From your terminal (persists the new default):

openclaw models set worldrouter/glm-5 openclaw models list

Best 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 OpenClawRecommended ModelWorldRouter USD (In / Out per 1M)Official / OpenRouter BaseSavingsWhy it fits OpenClaw
Best all-around primaryclaude-sonnet-5-5$1.40 / $7.00$2.00 / $10.0030% lowerReliable tool-calling, 1M context, fast code edits
Hardest refactors & architectureclaude-fable-5.2$3.20 / $16.00$8.00 / $40.0060% lowerFrontier reasoning at near-Sonnet pricing on WorldRouter
Deep agentic debuggingclaude-opus-5-5$2.80 / $14.00$4.00 / $20.0030% lowerStrong multi-step planning for complex debugging
OpenAI flagship alternativegpt-6.1-sol$1.40 / $7.00$2.00 / $10.0030% lowerGreat fallback when mixing OpenAI and Anthropic tool styles
Multimodal & long-context researchgemini-4-neon$1.65 / $8.25$3.00 / $15.0045% lower1M context for large repo ingestion, screenshots, and docs
Best value daily driverglm-5$0.55 / $1.76$1.00 / $3.2045% lowerAgentic coding at $1.76 per 1M output tokens
Budget coding & sub-agentsdeepseek-v4-pro$0.462 / $1.386—Off-peak rate shownLow-cost option for parallel worker agents
Heartbeats, triage & cron jobsgpt-6-luna$0.07 / $0.35$0.10 / $0.5030% lowerPennies 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 WorkloadToken Volume (In / Out)Model StrategyOfficial / OpenRouter BaseWorldRouter CostMonthly Savings
Light personal assistant (chat, quick tasks, ~1–2 hrs/day)5M in / 1M out100% 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 out80% 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 out85% 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

  1. Never run always-on heartbeats on Opus or Fable. Route scheduled checks and simple routing turns to gpt-6-luna ($0.07 / $0.35) or gemini-3.8-flash ($0.3375 / $1.6875), and /model opus or /model fable only for hard tasks.
  2. 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.
  3. 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:

  • baseUrl must end with /v1: https://inference-api.worldrouter.ai/v1 (with api: "openai-completions").
  • id inside models must match the exact case-sensitive WorldRouter slug on /models (for example, claude-sonnet-5-5 with hyphens, claude-fable-5.2 with a dot, or MiniMax-M2.7 with capital Ms—do not prepend anthropic/ or openai/ inside the provider’s id field).

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.