Gateway Configuration
Configuring the OpenClaw gateway.
Configuration File
Location: ~/.config/openclaw/config.json5
Full Example
json5
{
// Gateway settings
gateway: {
port: 3000,
host: "localhost",
cors: {
enabled: true,
origins: ["http://localhost:*"]
}
},
// Model configuration
models: {
default: "claude-3-5-sonnet",
providers: {
anthropic: {
apiKey: "sk-ant-..."
}
}
},
// Agent configuration
agent: {
name: "Assistant",
systemPrompt: "You are a helpful assistant.",
temperature: 0.7
},
// Channel configuration
channels: {
whatsapp: {
enabled: true
},
telegram: {
enabled: true,
botToken: "..."
}
},
// Session settings
sessions: {
maxAge: "7d",
maxMessages: 100
},
// Memory settings
memory: {
enabled: true,
maxItems: 100
}
}Configuration Sections
Gateway
json5
{
gateway: {
port: 3000, // Server port
host: "localhost", // Bind address
debug: false, // Debug mode
timeout: 60000 // Request timeout (ms)
}
}CORS
json5
{
gateway: {
cors: {
enabled: true,
origins: ["http://localhost:*", "https://myapp.com"]
}
}
}Environment Variables
Override config with environment variables:
bash
OPENCLAW_PORT=8080
OPENCLAW_DEBUG=true
ANTHROPIC_API_KEY=sk-ant-...Validation
Validate your configuration:
bash
openclaw doctor --config