OpenClaw Integration
Configure OpenClaw with LLM Gateway, verify a local coding task, and understand provider aliases and tool permissions.
OpenClaw runs agents locally and connects them to messaging channels. Configure LLM Gateway as a custom model provider, then verify a local task before connecting a channel.
Video walkthrough
Install
Use a Node.js version supported by the current OpenClaw installation guide. The recorded version requires Node 24.16+ or 26.1+.
1pnpm add -g openclaw2openclaw --version1pnpm add -g openclaw2openclaw --versionConfigure the provider
Export a key from the workspace you want to use:
1export LLMGATEWAY_API_KEY="your_api_key"1export LLMGATEWAY_API_KEY="your_api_key"Merge this provider into ~/.openclaw/openclaw.json. Replace MODEL_ID, the display name, and the example limits with values for your chosen model from the live catalogue.
1{2 "models": {3 "mode": "merge",4 "providers": {5 "llmgateway": {6 "baseUrl": "https://api.llmgateway.io/v1",7 "apiKey": "${LLMGATEWAY_API_KEY}",8 "api": "openai-completions",9 "models": [10 {11 "id": "MODEL_ID",12 "name": "Gateway coding model",13 "contextWindow": 200000,14 "maxTokens": 819215 }16 ]17 }18 }19 },20 "agents": {21 "defaults": {22 "model": { "primary": "llmgateway/MODEL_ID" }23 }24 }25}1{2 "models": {3 "mode": "merge",4 "providers": {5 "llmgateway": {6 "baseUrl": "https://api.llmgateway.io/v1",7 "apiKey": "${LLMGATEWAY_API_KEY}",8 "api": "openai-completions",9 "models": [10 {11 "id": "MODEL_ID",12 "name": "Gateway coding model",13 "contextWindow": 200000,14 "maxTokens": 819215 }16 ]17 }18 }19 },20 "agents": {21 "defaults": {22 "model": { "primary": "llmgateway/MODEL_ID" }23 }24 }25}llmgateway/ in the primary model names OpenClaw's local provider entry. The nested id is the model identifier sent to LLM Gateway.
With a DevPass key, retain OpenClaw's local llmgateway/ prefix and use a canonical model ID included in your plan. Do not add an upstream provider prefix inside the nested model ID.
Verify a local agent task
From a small project you can review, run:
1openclaw agent exec --config ~/.openclaw/openclaw.json --cwd . --code-mode direct "Read the failing test, fix the implementation, and run the tests. Do not change the tests or use subagents."1openclaw agent exec --config ~/.openclaw/openclaw.json --cwd . --code-mode direct "Read the failing test, fix the implementation, and run the tests. Do not change the tests or use subagents."agent exec runs one agent turn without a running OpenClaw gateway. It can execute commands and change files in the selected workspace, so use a controlled project. A successful exit alone does not prove the task was completed: inspect the diff and run the tests independently.
For a focused coding workflow, restrict the tool policy in your configuration:
1{2 "tools": {3 "profile": "coding",4 "allow": ["read", "write", "edit", "exec", "process"]5 }6}1{2 "tools": {3 "profile": "coding",4 "allow": ["read", "write", "edit", "exec", "process"]5 }6}Merge this with your configuration rather than replacing the provider settings. Review the OpenClaw agent command reference for execution policy and isolation options. --auth-env-only cannot be combined with --config.
Connect channels after verification
Follow OpenClaw's channel-specific setup for the messaging service you use. Review who can reach the agent and which tools it may call before enabling incoming messages.
Requests use the workspace associated with your gateway key. Review model usage and errors in that workspace's dashboard.
Troubleshooting
Startup rejects Node.js: update to a supported runtime and check the version in the shell launching OpenClaw.
The model is unavailable: check the primary provider alias, nested model ID, account access, and catalogue limits.
The agent only describes a plan: verify that tools are enabled and the selected model actually returns tool calls. Try a compatible tool-capable model and inspect the resulting file changes; a text-only answer is not evidence of execution.
A key is missing: export the environment variable before launching OpenClaw, including when starting it through a service manager.