đŸĻžOpenClaw Guide
← Back to Documentation

âš™ī¸ Configuration Guide

Complete reference for all OpenClaw settings. Configure AI models, channels, multi-agent setups, plugins, and more.

🚀Quick Start

OpenClaw stores its configuration in ~/.openclaw/openclaw.json. The easiest way to get started is using the setup wizard:

Terminal
# Run the setup wizard
openclaw onboard

# Or generate a config interactively
openclaw config wizard

For manual configuration, you can edit the JSON file directly or use the openclaw config commands:

Terminal
# View current config
openclaw config show

# Set a specific value
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-20250514"

# Add a channel
openclaw config set channels.telegram.botToken "YOUR_BOT_TOKEN"
💡Use openclaw doctor to validate your configuration and check for common issues.

📁File Locations

OpenClaw uses these key files and directories:

SettingTypeDefaultDescription
~/.openclaw/openclaw.jsonJSONCreated on first runMain configuration file containing all settings
~/.openclaw/.envdotenvOptionalEnvironment variables (API keys, secrets)
~/.openclaw/agents/DirectoryAuto-createdPer-agent configuration overrides
~/.openclaw/skills/DirectoryAuto-createdInstalled skills and their configs
~/.openclaw/plugins/DirectoryAuto-createdInstalled plugins
~/.openclaw/memory/DirectoryAuto-createdConversation memory and context
~/clawd/DirectoryConfigurableDefault workspace for file operations

You can also use a project-specific openclaw.config.json in your project directory, which merges with the global config.

🤖AI Models

Configure which AI models power your assistant. OpenClaw supports multiple providers and allows fine-grained control over model parameters.

Supported Providers

🤖

Anthropic (Claude)

Recommended for complex reasoning and coding

anthropic/claude-sonnet-4-20250514
🧠

OpenAI (GPT)

Great all-around performance

openai/gpt-4o
✨

Google (Gemini)

Free tier available, great value

google/gemini-2.0-flash
🚀

MiniMax

Budget-friendly with good quality

minimax/MiniMax-M2.1
Model Configuration Example
{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "apiKey": "${ANTHROPIC_API_KEY}"
      },
      "openai": {
        "apiKey": "${OPENAI_API_KEY}"
      },
      "google": {
        "apiKey": "${GOOGLE_API_KEY}"
      },
      "minimax": {
        "baseUrl": "https://api.minimax.io/anthropic",
        "apiKey": "${MINIMAX_API_KEY}",
        "api": "anthropic-messages"
      }
    }
  }
}

Model Parameters

Fine-tune model behavior with per-model parameters:

Per-Model Parameters
{
  "agents": {
    "defaults": {
      "models": {
        "anthropic/claude-opus-4-5": {
          "alias": "opus",
          "params": {
            "cacheControlTtl": "1h",
            "cacheRetention": "short",
            "temperature": 0.7,
            "maxTokens": 8192
          }
        },
        "anthropic/claude-sonnet-4-20250514": {
          "alias": "sonnet",
          "params": {
            "temperature": 0.5
          }
        }
      }
    }
  }
}
SettingTypeDefaultDescription
aliasstring—Short name to reference this model (e.g., 'opus')
params.temperaturenumber1.0Randomness (0-2). Lower = more focused
params.maxTokensnumber8192Maximum tokens in response
params.cacheControlTtlstring—Cache TTL for prompt caching (e.g., '1h')
params.cacheRetentionstring—Cache strategy: 'short', 'medium', 'long'

Fallback Models

Configure fallback models for resilience when your primary model is unavailable:

Fallback Configuration
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-opus-4-5",
        "fallbacks": [
          "anthropic/claude-sonnet-4-20250514",
          "minimax/MiniMax-M2.1",
          "openai/gpt-4o"
        ]
      }
    }
  }
}
â„šī¸Fallbacks are tried in order. If Claude Opus fails (rate limit, outage), OpenClaw automatically tries Claude Sonnet, then MiniMax, then GPT-4o.

👤Agents

An agent is an AI assistant instance with its own identity, model settings, and workspace. OpenClaw supports multiple agents for different use cases.

Agent Defaults

Settings that apply to all agents unless overridden:

Agent Defaults
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-opus-4-5"
      },
      "workspace": "/Users/you/clawd",
      "contextPruning": {
        "mode": "cache-ttl",
        "ttl": "1h"
      },
      "compaction": {
        "mode": "safeguard"
      },
      "heartbeat": {
        "every": "30m"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  }
}
SettingTypeDefaultDescription
workspacestring~/clawdWorking directory for file operations
contextPruning.modestringcache-ttlHow to manage conversation context: 'cache-ttl', 'sliding', 'none'
contextPruning.ttlstring1hContext cache lifetime
compaction.modestringsafeguardMessage compaction strategy: 'safeguard', 'aggressive', 'none'
heartbeat.everystring—How often the agent checks in (e.g., '30m', '1h')
maxConcurrentnumber4Max concurrent conversations per agent
subagents.maxConcurrentnumber8Max concurrent subagent tasks

Multi-Agent Setup

Run multiple specialized agents for different purposes — a work assistant, personal assistant, and coding assistant, each with unique settings:

Multi-Agent Configuration
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-20250514"
      }
    },
    "list": [
      {
        "id": "main",
        "identity": {
          "name": "Samantha",
          "theme": "Personal assistant 🐙",
          "emoji": "🐙"
        }
      },
      {
        "id": "work",
        "identity": {
          "name": "Atlas",
          "theme": "Professional work assistant",
          "emoji": "đŸ’ŧ"
        },
        "model": {
          "primary": "anthropic/claude-opus-4-5"
        },
        "workspace": "/Users/you/work"
      },
      {
        "id": "code",
        "identity": {
          "name": "Claude",
          "theme": "Coding assistant",
          "emoji": "đŸ’ģ"
        },
        "model": {
          "primary": "anthropic/claude-opus-4-5"
        }
      }
    ]
  }
}
💡Switch between agents using /agent work or /agent code in any channel. Each agent maintains its own conversation history.

Agent Identity

Customize your agent's personality and behavior with identity files:

~/.openclaw/agents/main/SOUL.md
# Who I Am

I'm Samantha — your personal AI assistant. I help with daily tasks, 
research, writing, and keeping you organized.

## Personality
- Friendly but efficient
- Concise unless asked for details
- Proactive about reminders and follow-ups
- Use emojis sparingly but warmly

## Communication Style
- Keep responses under 200 words unless necessary
- Ask clarifying questions when ambiguous
- Always confirm before taking important actions

## Rules
- Never share private information externally
- Always respect calendar time blocks
- Remind about important deadlines 24h in advance

Create these files per agent at ~/.openclaw/agents/{agent_id}/SOUL.md

📱Channels

Channels connect your AI assistant to messaging platforms. Configure one or multiple channels to chat with your assistant from anywhere.

Telegram

The most feature-rich channel with inline buttons, reactions, and voice notes.

Telegram Configuration
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "${TELEGRAM_BOT_TOKEN}",
      "dmPolicy": "pairing",
      "groupPolicy": "open",
      "allowFrom": [123456789, 987654321],
      "groups": {
        "-1001234567890": {
          "enabled": true,
          "agent": "work"
        }
      },
      "streamMode": "partial",
      "draftChunk": {
        "breakPreference": "paragraph"
      },
      "actions": {
        "reactions": true,
        "sendMessage": true
      }
    }
  }
}
SettingTypeDefaultDescription
botTokenstringRequiredBot token from @BotFather
dmPolicystringopenWho can DM: 'open', 'pairing', 'allowlist'
groupPolicystringmentionGroup behavior: 'open', 'mention', 'disabled'
allowFromnumber[][]Telegram user IDs allowed to chat (if using allowlist)
streamModestringpartialResponse streaming: 'partial', 'full', 'none'
actions.reactionsbooleantrueAllow the bot to react to messages

Discord

Discord Configuration
{
  "channels": {
    "discord": {
      "enabled": true,
      "botToken": "${DISCORD_BOT_TOKEN}",
      "applicationId": "${DISCORD_APP_ID}",
      "allowedGuilds": ["123456789"],
      "allowedChannels": ["general", "ai-chat"]
    }
  }
}

WhatsApp

WhatsApp Configuration
{
  "channels": {
    "whatsapp": {
      "enabled": true,
      "phoneNumberId": "${WHATSAPP_PHONE_ID}",
      "accessToken": "${WHATSAPP_ACCESS_TOKEN}",
      "verifyToken": "${WHATSAPP_VERIFY_TOKEN}",
      "webhookUrl": "https://your-server.com/webhook/whatsapp"
    }
  }
}

Slack

Slack Configuration
{
  "channels": {
    "slack": {
      "enabled": true,
      "botToken": "${SLACK_BOT_TOKEN}",
      "appToken": "${SLACK_APP_TOKEN}",
      "signingSecret": "${SLACK_SIGNING_SECRET}"
    }
  }
}
â„šī¸Each channel can route to a different agent. Set "agent": "work" on a channel or group to use a specific agent.

🌐Gateway

The Gateway is the background service that runs your AI assistant. Configure networking, authentication, and deployment options.

Gateway Configuration
{
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "${GATEWAY_TOKEN}"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  }
}
SettingTypeDefaultDescription
portnumber18789HTTP port for the gateway API
modestringlocalDeployment mode: 'local', 'cloud', 'hybrid'
bindstringloopbackNetwork binding: 'loopback' (localhost), 'all'
auth.modestringtokenAuth method: 'token', 'none' (not recommended)
auth.tokenstringAuto-generatedBearer token for API access
tailscale.modestringoffTailscale VPN: 'off', 'funnel', 'serve'
Gateway Commands
# Start gateway as background daemon
openclaw gateway start

# Run in foreground (for debugging)
openclaw gateway run

# Check status
openclaw gateway status

# Stop the daemon
openclaw gateway stop

# Restart
openclaw gateway restart

🔐Secrets & Security

OpenClaw provides multiple ways to manage sensitive credentials securely.

Environment Variables

The recommended approach is using environment variables. OpenClaw reads from ~/.openclaw/.env:

~/.openclaw/.env
# AI Provider Keys
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
GOOGLE_API_KEY=AIza...

# Channel Tokens
TELEGRAM_BOT_TOKEN=123456:ABC...
DISCORD_BOT_TOKEN=MTIz...
SLACK_BOT_TOKEN=xoxb-...

# Gateway Security
GATEWAY_TOKEN=your-secret-token

# Optional Services
BRAVE_SEARCH_KEY=BSA...

Reference environment variables in your config using the ${VAR_NAME} syntax:

Using Environment Variables
{
  "models": {
    "providers": {
      "anthropic": {
        "apiKey": "${ANTHROPIC_API_KEY}"
      }
    }
  },
  "channels": {
    "telegram": {
      "botToken": "${TELEGRAM_BOT_TOKEN}"
    }
  }
}

API Key Management

Best practices for managing API keys:

  • ✓Use .env files — Never commit API keys to version control
  • ✓Set file permissions — Run chmod 600 ~/.openclaw/.env
  • ✓Rotate regularly — Regenerate keys periodically
  • ✓Use scoped keys — Create keys with minimal required permissions
  • ✗Never share .env — Keep secrets out of screenshots and logs
âš ī¸OpenClaw never logs or transmits your API keys. They remain on your local machine and are only used for direct API calls to providers.

🔌Plugins

Plugins extend OpenClaw with additional capabilities. Install from npm or local directories.

Plugin Configuration
{
  "plugins": {
    "entries": {
      "telegram": {
        "enabled": true
      },
      "unbrowse-openclaw": {
        "enabled": true,
        "credentialSource": "auto"
      }
    },
    "installs": {
      "unbrowse-openclaw": {
        "source": "npm",
        "spec": "@getfoundry/unbrowse-openclaw",
        "version": "0.5.2"
      }
    }
  }
}
Plugin Commands
# List installed plugins
openclaw plugins list

# Install a plugin from npm
openclaw plugins add @getfoundry/unbrowse-openclaw

# Enable/disable a plugin
openclaw plugins enable telegram
openclaw plugins disable telegram

# Update all plugins
openclaw plugins update

🧩Skills

Skills are specialized capabilities for specific tasks like email, calendar, or web automation.

Skills Configuration
{
  "skills": {
    "install": {
      "nodeManager": "bun"
    },
    "entries": {
      "nano-banana-pro": {
        "apiKey": "${NANO_BANANA_KEY}"
      },
      "sag": {
        "apiKey": "${SAG_API_KEY}"
      }
    }
  }
}
Skill Commands
# List available skills
openclaw skills list

# Install a skill
openclaw skills install sag

# Configure a skill
openclaw skills config sag set apiKey "your-key"

# Run a skill
openclaw skills run sag say "Hello world"

đŸ› ī¸Tools

Built-in tools provide core functionality like web search and media processing.

Tools Configuration
{
  "tools": {
    "web": {
      "search": {
        "provider": "brave",
        "apiKey": "${BRAVE_SEARCH_KEY}"
      }
    },
    "media": {
      "audio": {
        "enabled": true,
        "models": [
          {
            "type": "cli",
            "command": "whisper",
            "args": ["--model", "base", "{{MediaPath}}"],
            "timeoutSeconds": 60
          }
        ]
      }
    }
  },
  "talk": {
    "apiKey": "${TTS_API_KEY}"
  }
}
SettingTypeDefaultDescription
tools.web.search.providerstringbraveWeb search provider: 'brave', 'google'
tools.media.audio.enabledbooleantrueEnable voice note transcription
talk.apiKeystring—API key for text-to-speech service

đŸĒHooks

Hooks run custom logic at key points in the conversation lifecycle.

Hooks Configuration
{
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "boot-md": {
          "enabled": true
        },
        "command-logger": {
          "enabled": true
        },
        "session-memory": {
          "enabled": true
        }
      }
    }
  }
}
SettingTypeDefaultDescription
boot-mdhookenabledLoads BOOT.md on startup for initial context
command-loggerhookenabledLogs all commands executed by the agent
session-memoryhookenabledPersists conversation memory between sessions

⚡Advanced Settings

Context Pruning

Control how conversation history is managed to stay within context limits:

{
  "agents": {
    "defaults": {
      "contextPruning": {
        "mode": "cache-ttl",
        "ttl": "1h",
        "maxTokens": 150000
      }
    }
  }
}

Message Settings

{
  "messages": {
    "ackReactionScope": "group-mentions",
    "maxMessageLength": 4096,
    "splitLongMessages": true
  }
}

Update Settings

{
  "update": {
    "checkOnStart": true,
    "autoUpdate": false,
    "channel": "stable"
  }
}

Command Settings

{
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "prefix": "/"
  }
}

📋Complete Configuration Example

Here's a comprehensive example combining all the settings:

Complete openclaw.json
{
  "update": {
    "checkOnStart": true
  },
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "apiKey": "${ANTHROPIC_API_KEY}"
      },
      "minimax": {
        "baseUrl": "https://api.minimax.io/anthropic",
        "apiKey": "${MINIMAX_API_KEY}",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "MiniMax-M2.1",
            "name": "MiniMax M2.1",
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-opus-4-5",
        "fallbacks": ["minimax/MiniMax-M2.1"]
      },
      "workspace": "/Users/you/clawd",
      "heartbeat": {
        "every": "30m"
      },
      "maxConcurrent": 4
    },
    "list": [
      {
        "id": "main",
        "identity": {
          "name": "Samantha",
          "emoji": "🐙"
        }
      }
    ]
  },
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "${TELEGRAM_BOT_TOKEN}",
      "dmPolicy": "pairing",
      "streamMode": "partial"
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "${GATEWAY_TOKEN}"
    }
  },
  "tools": {
    "web": {
      "search": {
        "provider": "brave",
        "apiKey": "${BRAVE_SEARCH_KEY}"
      }
    }
  },
  "plugins": {
    "entries": {
      "telegram": { "enabled": true }
    }
  }
}

Need Help?

Configuration questions? The community is here to help.