OpenClaw 🦞
OpenClaw is an open-source local AI assistant that interacts with you through WhatsApp, Telegram, Slack, and other messaging apps. It can perform real actions — managing emails, calendars, flight check-ins, browsing the web, and more. It runs entirely locally, so your data never leaves your device.
Why Pair with HaoAI?
- 100+ models unified access — One API Key for Claude, GPT, Gemini, Qwen, Doubao, and all major models
- Flexible agent strategies — Assign different models to different agents: Sonnet for primary, Opus for reasoning, Haiku for lightweight tasks
- 99.9% SLA — Multi-node redundancy with automatic failover
- Cost control — Unified billing dashboard with real-time token consumption monitoring
As an agentic AI assistant, OpenClaw’s per-task token consumption is relatively high (typically 10K-100K+ tokens). We recommend choosing models based on task complexity to avoid unnecessary costs. This guide provides three configuration options for reference.
Installation
curl -sSL https://openclaw.ai/install.sh | bash& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1)))Quick Start
1. Get an API Key
Go to the HaoAI Console to create an API Key.
2. Run the Setup Wizard
OpenClaw provides an interactive wizard. Run the following command to get started:
openclaw onboardIn the wizard, select Custom Provider and enter the following:
| Setting | Value |
|---|---|
| Provider Type | anthropic-messages |
| Base URL | https://api.hao.ai/anthropic |
| API Key | Your HaoAI API Key |
| Model | anthropic/claude-sonnet-4.6 |
3. Start and Verify
openclaw startSend a message to OpenClaw to test connectivity. If you receive a normal response, the setup is complete.
The wizard automatically generates an openclaw.json configuration file. For more fine-grained control, see the full configuration below.
Full Configuration
OpenClaw manages all configuration through ~/.openclaw/openclaw.json (supports JSON5 format with comments).
Provider Configuration
Providers are defined under models.providers. Each provider needs an API protocol type, URL, and key:
{
"models": {
"providers": {
"haoai-anthropic": {
"baseUrl": "https://api.hao.ai/anthropic",
"apiKey": "${HAOAI_API_KEY}",
"api": "anthropic-messages",
"models": []
},
"haoai-openai": {
"baseUrl": "https://api.hao.ai/v1",
"apiKey": "${HAOAI_API_KEY}",
"api": "openai-responses",
"models": []
},
"haoai-gemini": {
"baseUrl": "https://api.hao.ai/gemini",
"apiKey": "${HAOAI_API_KEY}",
"api": "google-generative-ai",
"models": []
}
}
}
}apiKey supports ${ENV_VAR} syntax to reference environment variables, avoiding plaintext keys in config files. Three protocols correspond to different model families: Claude uses haoai-anthropic (anthropic-messages), OpenAI uses haoai-openai (openai-responses), Gemini uses haoai-gemini (google-generative-ai). Other models can connect through haoai-openai.
Models Configuration
Models are defined in the models array of their corresponding provider. We provide three configurations based on your needs:
Premium Setup
All-Claude lineup — Maximum capability for demanding scenarios.
{
"models": {
"providers": {
"haoai-anthropic": {
"baseUrl": "https://api.hao.ai/anthropic",
"apiKey": "${HAOAI_API_KEY}",
"api": "anthropic-messages",
"models": [
{
"id": "anthropic/claude-sonnet-4.6",
"name": "Claude Sonnet 4.5",
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 64000
},
{
"id": "anthropic/claude-opus-4.6",
"name": "Claude Opus 4.6",
"reasoning": true,
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 128000
},
{
"id": "anthropic/claude-haiku-4.5",
"name": "Claude Haiku 4.5",
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 64000
}
]
}
}
}
}| Model | Role | Use Case |
|---|---|---|
anthropic/claude-sonnet-4.6 | Primary | Daily chat, task execution, code generation |
anthropic/claude-opus-4.6 | Deep reasoning | Complex analysis, long-chain reasoning, research |
anthropic/claude-haiku-4.5 | Fast response | Simple queries, quick replies, lightweight tasks |
Agents Configuration
OpenClaw uses agents.defaults for global defaults and agents.list to define different agents, each of which can override default settings:
{
"agents": {
"defaults": {
"model": {
"primary": "haoai-anthropic/anthropic/claude-sonnet-4.6",
"fallbacks": ["haoai-anthropic/anthropic/claude-haiku-4.5"]
},
"models": {
"haoai-anthropic/anthropic/claude-opus-4.6": { "alias": "opus" },
"haoai-anthropic/anthropic/claude-sonnet-4.6": { "alias": "sonnet" },
"haoai-anthropic/anthropic/claude-haiku-4.5": { "alias": "haiku" }
},
"thinkingDefault": "low",
"timeoutSeconds": 600,
"maxConcurrent": 3
},
"list": [
{
"id": "main",
"default": true
},
{
"id": "research",
"model": {
"primary": "haoai-anthropic/anthropic/claude-opus-4.6"
}
},
{
"id": "quick",
"model": {
"primary": "haoai-anthropic/anthropic/claude-haiku-4.5"
}
}
]
}
}| Agent | Model | Purpose |
|---|---|---|
| main | claude-sonnet-4.6 (inherits defaults) | Default agent for all daily tasks |
| research | claude-opus-4.6 | Deep research, complex reasoning, long-form analysis |
| quick | claude-haiku-4.5 | Simple Q&A, fast responses, low cost |
Model references use the format provider-name/model-id (e.g. haoai-anthropic/anthropic/claude-sonnet-4.6). The models field in defaults defines model aliases for quick switching in conversations with /model opus. Agents in list inherit all defaults configuration and only need to override fields that differ.
Full Configuration Example
Here’s a complete openclaw.json combining Provider, Models, and Agents configuration (premium setup):
{
"models": {
"providers": {
"haoai-anthropic": {
"baseUrl": "https://api.hao.ai/anthropic",
"apiKey": "${HAOAI_API_KEY}",
"api": "anthropic-messages",
"models": [
{
"id": "anthropic/claude-sonnet-4.6",
"name": "Claude Sonnet 4.5",
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 64000
},
{
"id": "anthropic/claude-opus-4.6",
"name": "Claude Opus 4.6",
"reasoning": true,
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 128000
},
{
"id": "anthropic/claude-haiku-4.5",
"name": "Claude Haiku 4.5",
"input": ["text", "image", "file"],
"contextWindow": 200000,
"maxTokens": 64000
}
]
},
"haoai-gemini": {
"baseUrl": "https://api.hao.ai/gemini",
"apiKey": "${HAOAI_API_KEY}",
"api": "google-generative-ai",
"models": [
{
"id": "models/google/gemini-2.5-flash",
"name": "Gemini 2.5 Flash",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 64000
},
{
"id": "models/google/gemini-2.5-pro",
"name": "Gemini 2.5 Pro",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 64000
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "haoai-anthropic/anthropic/claude-sonnet-4.6",
"fallbacks": ["haoai-anthropic/anthropic/claude-haiku-4.5"]
},
"models": {
"haoai-anthropic/anthropic/claude-opus-4.6": { "alias": "opus" },
"haoai-anthropic/anthropic/claude-sonnet-4.6": { "alias": "sonnet" },
"haoai-anthropic/anthropic/claude-haiku-4.5": { "alias": "haiku" }
},
"thinkingDefault": "low",
"timeoutSeconds": 600,
"maxConcurrent": 3
},
"list": [
{
"id": "main",
"default": true
},
{
"id": "research",
"model": {
"primary": "haoai-anthropic/anthropic/claude-opus-4.6"
}
},
{
"id": "quick",
"model": {
"primary": "haoai-anthropic/anthropic/claude-haiku-4.5"
}
}
]
}
}Use Cases
Once configured, send commands to OpenClaw through your messaging app:
- Email management — “Help me organize today’s unread emails by priority”
- Schedule management — “Schedule a team meeting tomorrow at 3 PM”
- Information retrieval — “Search for recent articles about AI Agents and summarize the key points”
- Code assistance — “Help me review this Python code for security issues”
- Workflow automation — “Send a daily team report to Slack #general channel every morning at 9 AM”
Troubleshooting
Cannot connect to HaoAI
Verify the baseUrl configuration is correct:
- Anthropic protocol:
https://api.hao.ai/anthropic - OpenAI-Response protocol:
https://api.hao.ai/v1 - Gemini protocol:
https://api.hao.ai/gemini
Model not found
Verify the model ID format is correct. When defining models in models.providers, use the full ID returned by HaoAI (e.g. anthropic/claude-sonnet-4.6). When referencing models in agents, add the provider name prefix: haoai-anthropic/anthropic/claude-sonnet-4.6.
High token consumption
OpenClaw’s per-task consumption is relatively high. Recommendations:
- Use
claude-haiku-4.5or cost-effective models for daily tasks - Only switch to the
researchagent (usingclaude-opus-4.6) for complex tasks - Monitor usage in the HaoAI Console
How to quickly switch models
Use aliases in conversations: /model opus, /model sonnet, /model haiku (requires configuring aliases in agents.defaults.models).