Environment Variables
Complete reference for all OpenClaw configuration options.
Use the provider secrets and model IDs that match the BYOK setup you want to run.
Core Settings
AI Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
OPENROUTER_API_KEY | Yes | - | Your BYOK provider API key |
AI_MODEL | No | openrouter/auto | Default AI model |
MAX_TOKENS | No | 4096 | Maximum response tokens |
TEMPERATURE | No | 0.7 | Response creativity (0-1) |
SYSTEM_PROMPT | No | Default prompt | Custom system prompt |
Application Settings
| Variable | Required | Default | Description |
|---|---|---|---|
APP_NAME | No | OpenClaw | Display name |
APP_URL | No | Auto-detected | Base URL for the application |
NODE_ENV | No | production | Environment (development/production) |
LOG_LEVEL | No | info | Logging level (debug/info/warn/error) |
Integration Settings
Slack (Coming Soon for Hosted OpenClaw VPS)
| Variable | Required | Default | Description |
|---|---|---|---|
SLACK_BOT_TOKEN | For Slack | - | Bot OAuth token (xoxb-…) |
SLACK_APP_TOKEN | Socket Mode | - | App-level token (xapp-…) |
SLACK_SIGNING_SECRET | For Slack | - | Request signing secret |
SLACK_ALLOWED_CHANNELS | No | All | Comma-separated channel IDs |
Discord (Coming Soon for Hosted OpenClaw VPS)
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_BOT_TOKEN | For Discord | - | Bot token |
DISCORD_APPLICATION_ID | For Discord | - | Application ID |
DISCORD_PUBLIC_KEY | For Discord | - | Public key for verification |
DISCORD_ALLOWED_CHANNELS | No | All | Comma-separated channel IDs |
DISCORD_ALLOWED_ROLES | No | All | Comma-separated role IDs |
Telegram (Live Now)
| Variable | Required | Default | Description |
|---|---|---|---|
TELEGRAM_BOT_TOKEN | For Telegram | - | Bot token from BotFather |
TELEGRAM_WEBHOOK_URL | Webhook mode | - | Webhook URL |
TELEGRAM_USE_POLLING | No | false | Use polling instead of webhooks |
TELEGRAM_ALLOWED_USERS | No | All | Comma-separated user IDs |
TELEGRAM_ALLOWED_GROUPS | No | All | Comma-separated group IDs |
Web Interface
| Variable | Required | Default | Description |
|---|---|---|---|
WEB_API_KEY | No | - | API key for authentication |
WEB_CORS_ORIGINS | No | Same origin | Allowed CORS origins |
Feature Flags
| Variable | Default | Description |
|---|---|---|
ENABLE_CODE_EXECUTION | false | Allow code execution |
ENABLE_FILE_UPLOADS | true | Allow file uploads |
ENABLE_WEB_SEARCH | false | Enable web search skill |
ENABLE_MEMORY | true | Enable long-term memory |
Storage Settings
Database (VPS/Local)
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | sqlite:./data/openclaw.db | Database connection string |
DATABASE_TYPE | sqlite | Database type (sqlite/postgres) |
File Storage
| Variable | Default | Description |
|---|---|---|
FILE_STORAGE_PATH | ./data/files | Local file storage path |
MAX_FILE_SIZE | 25MB | Maximum upload size |
FILE_RETENTION_DAYS | 7 | Days to keep uploaded files |
Security Settings
| Variable | Default | Description |
|---|---|---|
RATE_LIMIT_REQUESTS | 100 | Requests per window |
RATE_LIMIT_WINDOW | 60000 | Rate limit window (ms) |
SESSION_SECRET | Auto-generated | Session encryption key |
TRUSTED_PROXIES | false | Trust X-Forwarded-* headers |
Example Configurations
Minimal (Cloudflare)
OPENROUTER_API_KEY=your-byok-provider-keyFull Featured (VPS)
# Core
OPENROUTER_API_KEY=your-byok-provider-key
AI_MODEL=openrouter/auto
APP_NAME=My AI Assistant
APP_URL=https://ai.example.com
# Integrations
TELEGRAM_BOT_TOKEN=...
# Features
ENABLE_CODE_EXECUTION=true
ENABLE_WEB_SEARCH=true
# Storage
DATABASE_URL=postgres://user:pass@localhost:5432/openclaw
FILE_STORAGE_PATH=/var/data/openclaw/files
# Security
WEB_API_KEY=your-secret-key
RATE_LIMIT_REQUESTS=200