Skip to main content

openclaw.json Reference

openclaw.json is the primary configuration file for OpenClaw. It defines agents, models, channels, tools, memory, and all runtime behavior. This file lives in the root of the OpenClaw workspace filesystem.

For a complete annotated example, see the Sample Configuration.


Top-level structure

{
"meta": { ... },
"env": { ... },
"logging": { ... },
"secrets": { ... },
"models": { ... },
"agents": { ... },
"tools": { ... },
"messages": { ... },
"commands": { ... },
"channels": { ... },
"bindings": [ ... ],
"gateway": { ... },
"memory": { ... },
"plugins": { ... }
}

meta

Version tracking metadata. Updated automatically by OpenClaw when the config is saved.

{
"meta": {
"lastTouchedVersion": "2026.3.1",
"lastTouchedAt": "2026-02-28T14:00:00.000Z"
}
}
FieldDescription
lastTouchedVersionOpenClaw version that last modified this config
lastTouchedAtISO 8601 timestamp of the last modification

env

Environment variable declarations. Values can reference system environment variables using ${VAR_NAME} syntax. These variables are injected into the OpenClaw runtime.

{
"env": {
"BRAVE_API_KEY": "${BRAVE_API_KEY}",
"TELEGRAM_BOT_TOKEN": "${TELEGRAM_BOT_TOKEN}"
}
}

Use ${VAR_NAME} to reference environment variables set in the container/system. This keeps secrets out of the config file itself.


logging

Controls log output behavior.

{
"logging": {
"level": "info",
"consoleStyle": "json",
"redactSensitive": "tools"
}
}
FieldValuesDescription
leveldebug, info, warn, errorLog verbosity level
consoleStylejson, prettyLog output format
redactSensitivetools, all, noneWhat to redact from logs

secrets

Configures how secrets are resolved. The env provider reads secrets from environment variables.

{
"secrets": {
"providers": {
"default": {
"source": "env"
}
}
}
}

models

Defines model providers and their available models. Supports multiple providers simultaneously.

{
"models": {
"providers": {
"ollama": {
"baseUrl": "http://ollama.agents.svc.cluster.local:11434/v1",
"apiKey": "__OPENCLAW_REDACTED__",
"api": "openai-completions",
"models": [
{
"id": "llama3.1:8b",
"name": "llama3.1:8b",
"api": "openai-completions",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 128000,
"maxTokens": 32768
}
]
}
}
}
}

Provider fields

FieldDescription
baseUrlAPI base URL for the provider
apiKeyAPI key (use ${ENV_VAR} or __OPENCLAW_REDACTED__)
apiAPI type: openai-completions
modelsArray of model definitions

Model fields

FieldDescription
idModel identifier used in agent config
nameDisplay name
apiAPI type for this model
reasoningWhether the model supports reasoning/thinking
inputSupported input types: ["text"], ["text", "image"]
costCost per million tokens (input, output, cacheRead, cacheWrite)
contextWindowMaximum context window in tokens
maxTokensMaximum output tokens

Built-in providers

OpenClaw has built-in support for these providers (no models section needed):

  • openrouter — OpenRouter (access to 200+ models)
  • anthropic — Anthropic Claude
  • openai — OpenAI GPT

For these, use the provider prefix in model IDs: openrouter/anthropic/claude-sonnet-4.6


agents

Defines agent defaults and the list of agents.

agents.defaults

Default settings applied to all agents unless overridden:

{
"agents": {
"defaults": {
"model": {
"primary": "openrouter/moonshotai/kimi-k2.5",
"fallbacks": [
"openrouter/google/gemini-2.5-flash",
"openrouter/anthropic/claude-sonnet-4.6"
]
},
"models": {
"openrouter/anthropic/claude-sonnet-4.6": {
"alias": "Sonnet 4.6",
"params": {
"contextWindow": 200000,
"maxTokens": 4096,
"temperature": 0.4,
"cacheControlTtl": "1h",
"reasoning": true
}
}
},
"userTimezone": "Asia/Singapore",
"envelopeTimezone": "user",
"envelopeTimestamp": "on",
"envelopeElapsed": "on",
"compaction": {
"mode": "safeguard",
"reserveTokensFloor": 40000,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 22000,
"prompt": "Session context is nearing compaction...",
"systemPrompt": "You are a memory extraction assistant..."
}
},
"blockStreamingDefault": "off",
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8,
"model": "openrouter/moonshotai/kimi-k2.5"
}
}
}
}

Default model settings

FieldDescription
model.primaryDefault primary model for all agents
model.fallbacksOrdered list of fallback models if primary fails
modelsPer-model parameter overrides (applied globally)

Model params

ParamDescription
contextWindowOverride the model's context window
maxTokensMaximum output tokens
temperatureSampling temperature (0.0–1.0)
cacheControlTtlCache TTL for prompt caching (e.g. 1h)
reasoningEnable reasoning/thinking mode

Envelope settings

FieldValuesDescription
userTimezoneIANA timezoneTimezone for timestamps shown to users
envelopeTimezoneuser, utcWhich timezone to use in message envelopes
envelopeTimestampon, offInclude timestamp in message envelopes
envelopeElapsedon, offInclude elapsed time in message envelopes

Compaction settings

Controls what happens when the context window approaches its limit:

FieldDescription
modesafeguard — compact when near limit
reserveTokensFloorMinimum tokens to reserve for the response
memoryFlush.enabledFlush important context to memory before compaction
memoryFlush.softThresholdTokensToken count that triggers a memory flush
memoryFlush.promptPrompt sent to the agent to trigger memory writing

Concurrency

FieldDescription
blockStreamingDefaulton or off — whether to block streaming by default
maxConcurrentMax concurrent agent sessions
subagents.maxConcurrentMax concurrent subagent invocations
subagents.modelDefault model for subagents

agents.list

Array of agent definitions:

{
"agents": {
"list": [
{
"id": "coo",
"default": true,
"workspace": "/home/node/.openclaw/workspace-coo",
"model": {
"primary": "openrouter/moonshotai/kimi-k2.5",
"fallbacks": ["openrouter/deepseek/deepseek-chat"]
},
"heartbeat": {
"every": "30m",
"activeHours": {
"start": "08:00",
"end": "06:00"
},
"model": "google/gemini-2.5-flash-lite",
"session": "isolated",
"target": "last",
"prompt": "Read HEARTBEAT.md if it exists...",
"ackMaxChars": 200
},
"identity": {
"name": "MosBot",
"theme": "Research - Delegation - Execution - Orchestration",
"emoji": "🤖"
},
"subagents": {
"allowAgents": ["cto", "cpo", "cmo"]
}
}
]
}
}

Agent fields

FieldDescription
idUnique agent identifier (used in workspace paths, bindings, etc.)
defaulttrue if this is the default agent
workspaceAbsolute path to the agent's workspace directory
modelModel overrides for this agent (overrides defaults)
heartbeatScheduled heartbeat configuration
identityAgent display name, theme, and emoji
subagentsWhich agents this agent can invoke as subagents

Heartbeat fields

FieldDescription
everyInterval (e.g. 30m, 1h, 2h)
activeHours.startStart of active hours (24h format)
activeHours.endEnd of active hours (24h format, can wrap midnight)
modelModel to use for heartbeat (use a cheap/fast model)
sessionisolated — heartbeat runs in its own session
targetlast — target the most recent session
promptPrompt sent during heartbeat
ackMaxCharsMaximum characters in the heartbeat acknowledgment

tools

Configures which tools are available and how they behave.

{
"tools": {
"sessions": {
"visibility": "agent"
},
"agentToAgent": {
"enabled": true
},
"elevated": {
"enabled": true
},
"exec": {
"host": "gateway"
}
}
}
FieldDescription
sessions.visibilityagent — agents can see their own sessions. Required for Agent Monitor.
agentToAgent.enabledAllow agents to invoke other agents. Required for subagent tracking.
elevated.enabledEnable elevated (privileged) tools
exec.hostWhere exec commands run: gateway

messages

Controls message acknowledgment behavior.

{
"messages": {
"ackReactionScope": "all"
}
}
FieldValuesDescription
ackReactionScopeall, agent, noneWhich messages get reaction acknowledgments

commands

Controls native command and skill behavior.

{
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true,
"ownerDisplay": "raw"
}
}
FieldValuesDescription
nativeauto, on, offEnable native commands
nativeSkillsauto, on, offEnable skills as commands
restarttrue, falseAllow the /restart command
ownerDisplayraw, formattedHow owner messages are displayed in the gateway

channels

Configures communication channel integrations.

Telegram

{
"channels": {
"telegram": {
"enabled": true,
"streaming": "partial",
"groupAllowFrom": ["tg:123456789"],
"allowFrom": ["tg:123456789"],
"accounts": {
"default": {
"botToken": "${TELEGRAM_BOT_TOKEN}",
"dmPolicy": "pairing",
"groupPolicy": "allowlist",
"groups": {
"-1001234567890": {
"requireMention": false
}
},
"groupAllowFrom": ["tg:123456789"],
"allowFrom": ["tg:123456789"]
}
}
}
}
}
Use Topics for Parallel Sessions If you use a Telegram Supergroup with Topics enabled,

OpenClaw treats each topic as a separate session. This allows a single agent to handle multiple parallel tasks (e.g. "Dev", "Research") without needing multiple agent definitions. :::

Telegram top-level fields

FieldValuesDescription
enabledbooleanEnable/disable Telegram channel
streamingstringStreaming mode (e.g., "partial")
groupAllowFromarrayDefault user IDs allowed to interact in groups (applies to all accounts)
allowFromarrayDefault user IDs allowed to interact (set when using groupPolicy: "allowlist" to avoid validation warnings)

When using groupPolicy: "allowlist" at the account level, you should set both groupAllowFrom and allowFrom at the top-level channels.telegram object to avoid validation warnings.

Telegram account fields

FieldValuesDescription
botTokenstringTelegram bot token (use ${ENV_VAR})
dmPolicypairing, open, closedWho can DM the bot
groupPolicyallowlist, open, closedWhich groups the bot responds in
groupsobjectGroup-specific settings (keyed by group ID)
groupAllowFromarrayUser IDs allowed to interact in groups
allowFromarrayUser IDs allowed to interact (set when using groupPolicy: "allowlist" to avoid validation warnings)
groups[id].requireMentionbooleanWhether the bot must be @mentioned in the group

bindings

Maps agents to channels. Determines which agent responds to messages from which channel account.

{
"bindings": [
{
"agentId": "coo",
"match": {
"channel": "telegram",
"accountId": "default"
}
},
{
"agentId": "pa",
"match": {
"channel": "telegram",
"accountId": "maya"
}
}
]
}
FieldDescription
agentIdThe agent that handles messages from this channel
match.channelChannel type (e.g. telegram)
match.accountIdAccount ID within the channel (matches key in channels.<channel>.accounts)

gateway

Configures the OpenClaw gateway service.

{
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowedOrigins": ["http://localhost:18789", "https://your-domain.example.com"],
"allowInsecureAuth": true
},
"auth": {
"mode": "token"
},
"tls": {
"enabled": true,
"autoGenerate": true
}
}
}
FieldDescription
portGateway port (default: 18789)
modelocal for local/LAN operation
bindlan to bind to all LAN interfaces
controlUi.allowedOriginsCORS allowed origins for the gateway UI — must include your MosBot dashboard URL
controlUi.allowInsecureAuthAllow operator-scoped connections without device auth. Required when device auth is not configured.
auth.modetoken for bearer token authentication
tls.enabledEnable TLS
tls.autoGenerateAuto-generate a self-signed certificate
MosBot Integration

MosBot API connects to the gateway via WebSocket. For this to work:

  1. Add your MosBot dashboard URL to controlUi.allowedOrigins
  2. Either configure device auth credentials in MosBot API's .env, or set controlUi.allowInsecureAuth: true

See Key Settings for MosBot for details. :::


memory

Configures the agent memory backend.

{
"memory": {
"backend": "qmd",
"citations": "auto",
"qmd": {
"includeDefaultMemory": true,
"paths": [
{
"path": "../shared/docs",
"name": "shared-docs",
"pattern": "**/*.md"
}
],
"update": {
"interval": "5m",
"debounceMs": 15000
},
"limits": {
"maxResults": 6,
"timeoutMs": 4000
}
}
}
}
FieldDescription
backendMemory backend type: qmd (query-based markdown)
citationsauto — automatically include memory citations
qmd.includeDefaultMemoryInclude the agent's default memory files
qmd.pathsAdditional paths to include in memory search
qmd.update.intervalHow often to refresh the memory index
qmd.update.debounceMsDebounce delay for memory updates
qmd.limits.maxResultsMaximum memory results per query
qmd.limits.timeoutMsMemory query timeout

Memory paths

Each entry in qmd.paths adds a directory to the memory search:

FieldDescription
pathPath relative to the agent's workspace
nameIdentifier for this memory source
patternGlob pattern for files to include

plugins

Enables optional plugins.

{
"plugins": {
"entries": {
"telegram": {
"enabled": true
}
}
}
}

Enable the Telegram plugin to activate Telegram channel support.