Basic Config
OpenClaw uses ~/.openclaw/openclaw.json (JSON5 format) as its main configuration file.
Setup Wizard
openclaw onboard --install-daemon
The wizard automatically configures: auth token, default model, message channels, and the daemon process.
Minimal Configuration
{
agents: {
defaults: {
model: {
primary: "anthropic/claude-sonnet-4-5",
},
workspace: "~/.openclaw/workspace",
},
},
}
Set your API Key in ~/.openclaw/.env:
ANTHROPIC_API_KEY=sk-ant-api03-xxxxx
Common Commands
# View configuration
cat ~/.openclaw/openclaw.json
# Set a config value
openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
# Read current config
openclaw config get
# Restart after changes
openclaw gateway restart
Recommended Configuration Template
{
gateway: {
mode: "local",
port: 18789,
bind: "loopback",
auth: {
token: "${OPENCLAW_GATEWAY_TOKEN}",
},
},
agents: {
defaults: {
workspace: "~/.openclaw/workspace",
model: {
primary: "anthropic/claude-sonnet-4-5",
fallbacks: ["deepseek/deepseek-chat"],
},
thinkingDefault: "low",
timeoutSeconds: 600,
},
},
}
Verify Configuration
openclaw doctor
openclaw status
openclaw dashboard