OpenClaw Proxy API Integration Guide: Autonomous Agent Framework Setup
A guide to connecting the OpenClaw autonomous agent framework: one-click installation via install.sh, configuration via onboard, or manually adding a model provider to openclaw.json to point to our gateway.
1. What is OpenClaw
OpenClaw is an open-source AI Agent framework: point it to a model (local or cloud gateway), and it can automate tasks on your computer—operating interfaces, running commands, managing files, and more. Its core feature is "configuring a model endpoint," making it perfectly suited for connecting to our gateway.
2. Installing OpenClaw
One-click installation script recommended:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard
You can also install via Docker or source code:
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# Docker: ./scripts/docker/setup.sh
# Source (pnpm): corepack enable && pnpm install && pnpm openclaw setup
3. Connecting to Our Gateway (Two Methods)
Method 1: Interactive Onboarding
Run openclaw onboard, select the option that supports custom URLs when prompted for a Provider, and enter:
Base URL : https://www.relay-api.com
API Key : sk-your-api-key
Model ID : claude-sonnet-5
(The openai / gemini endpoints correspond to https://www.relay-api.com/v1 and https://www.relay-api.com/v1beta)
Method 2: Manual Configuration File Edit
OpenClaw reads from ~/.openclaw/openclaw.json (Linux/macOS) or %USERPROFILE%\.openclaw\openclaw.json (Windows). Add a new Provider under models.providers:
{
"gateway": {
"mode": "local"
},
"agents": {
"defaults": {
"model": {"primary": "jizhi/claude-sonnet-5"}
}
},
"models": {
"providers": {
"jizhi": {
"baseUrl": "https://www.relay-api.com",
"apiKey": "sk-your-api-key",
"api": "openai-completions"
}
}
}
}
Change primary to the model slug you are using to route all OpenClaw agent tasks through our gateway.
4. Startup and Common Commands
openclaw gateway --port 18789
After launching, visit http://localhost:18789 to access the console. Common commands:
openclaw doctor # Diagnose issues
openclaw security audit # Security check
openclaw config set key x # Update configuration
openclaw channels add --channel telegram # Add messaging channels
5. Troubleshooting
| Symptom | Solution |
|---|---|
| 401 / 403 | Invalid key, disabled, or insufficient balance; verify sk- and top up. |
| 404 / Model Unavailable | Model slug mismatch or model not enabled; check Model ID. |
| Cannot connect to model | Confirm baseUrl is set to our portal. |
Security Tip: Do not commit your sk- key to public repositories; AI agent tasks consume tokens rapidly, so keep an eye on your balance.
