Configuration
6
min read
OpenClaw Config Baseline: A 'Secure and Usable' Template
Minimal configuration examples for Model/Gateway/Channel/Skills with secure defaults and copy-paste ready snippets.
O
OpenClaw Manuals
Tutorial Authors
Minimal Configuration
Here's a verified minimal configuration template with secure defaults:
json
// ~/.openclaw/openclaw.json
{
"model": {
"provider": "anthropic",
"default": "claude-3-5-sonnet",
"apiKey": "${ANTHROPIC_API_KEY}"
},
"gateway": {
"port": 18789,
"host": "127.0.0.1"
},
"channels": [
{ "type": "whatsapp", "enabled": false },
{ "type": "telegram", "enabled": false },
{ "type": "discord", "enabled": false }
],
"security": {
"rateLimiting": {
"enabled": true,
"maxRequests": 100,
"windowMs": 60000
}
}
}
Configuration Sections Explained
Model Configuration
json
{
"model": {
"provider": "anthropic",
"default": "claude-3-5-sonnet",
"apiKey": "${ANTHROPIC_API_KEY}"
}
}
Available models:
-
claude-3-5-haiku- Fast, cost-effective ($0.25/1M input, $1.25/1M output) -
claude-3-5-sonnet- Balanced performance ($3/1M input, $15/1M output) -
claude-sonnet-4- Latest generation, best quality ($3/1M input, $15/1M output)
Gateway Configuration
json
{
"gateway": {
"port": 18789,
"host": "127.0.0.1",
"timeout": 30000
}
}
Security Note: Never set
hostto0.0.0.0unless you have proper firewall rules in place.
Channel Configuration
Each channel can be configured independently:
json
{
"channels": [
{
"type": "whatsapp",
"enabled": true,
"sessionPath": "~/.openclaw/whatsapp-session"
},
{
"type": "telegram",
"enabled": true,
"botToken": "${TELEGRAM_BOT_TOKEN}"
},
{
"type": "discord",
"enabled": true,
"botToken": "${DISCORD_BOT_TOKEN}",
"intents": ["GUILDS", "GUILD_MESSAGES", "MESSAGE_CONTENT"]
}
]
}
Security Configuration
json
{
"security": {
"rateLimiting": {
"enabled": true,
"maxRequests": 100,
"windowMs": 60000
},
"quotas": {
"daily": {
"enabled": true,
"maxTokens": 100000
}
}
}
}
Environment Variables
Create a
.env
file in your OpenClaw directory:
bash
# ~/.openclaw/.env ANTHROPIC_API_KEY=sk-ant-xxxxx TELEGRAM_BOT_TOKEN=123456:ABC-xxxxx DISCORD_BOT_TOKEN=xxxxx.xxxxx.xxxxx
Validation
Validate your configuration:
bash
openclaw config validate
This will check for:
- Required fields
- Valid API keys
- Proper formatting