Skip to Content
Legacy ConfigurationEnvironment Variables

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

VariableRequiredDefaultDescription
OPENROUTER_API_KEYYes-Your BYOK provider API key
AI_MODELNoopenrouter/autoDefault AI model
MAX_TOKENSNo4096Maximum response tokens
TEMPERATURENo0.7Response creativity (0-1)
SYSTEM_PROMPTNoDefault promptCustom system prompt

Application Settings

VariableRequiredDefaultDescription
APP_NAMENoOpenClawDisplay name
APP_URLNoAuto-detectedBase URL for the application
NODE_ENVNoproductionEnvironment (development/production)
LOG_LEVELNoinfoLogging level (debug/info/warn/error)

Integration Settings

Slack (Coming Soon for Hosted OpenClaw VPS)

VariableRequiredDefaultDescription
SLACK_BOT_TOKENFor Slack-Bot OAuth token (xoxb-…)
SLACK_APP_TOKENSocket Mode-App-level token (xapp-…)
SLACK_SIGNING_SECRETFor Slack-Request signing secret
SLACK_ALLOWED_CHANNELSNoAllComma-separated channel IDs

Discord (Coming Soon for Hosted OpenClaw VPS)

VariableRequiredDefaultDescription
DISCORD_BOT_TOKENFor Discord-Bot token
DISCORD_APPLICATION_IDFor Discord-Application ID
DISCORD_PUBLIC_KEYFor Discord-Public key for verification
DISCORD_ALLOWED_CHANNELSNoAllComma-separated channel IDs
DISCORD_ALLOWED_ROLESNoAllComma-separated role IDs

Telegram (Live Now)

VariableRequiredDefaultDescription
TELEGRAM_BOT_TOKENFor Telegram-Bot token from BotFather
TELEGRAM_WEBHOOK_URLWebhook mode-Webhook URL
TELEGRAM_USE_POLLINGNofalseUse polling instead of webhooks
TELEGRAM_ALLOWED_USERSNoAllComma-separated user IDs
TELEGRAM_ALLOWED_GROUPSNoAllComma-separated group IDs

Web Interface

VariableRequiredDefaultDescription
WEB_API_KEYNo-API key for authentication
WEB_CORS_ORIGINSNoSame originAllowed CORS origins

Feature Flags

VariableDefaultDescription
ENABLE_CODE_EXECUTIONfalseAllow code execution
ENABLE_FILE_UPLOADStrueAllow file uploads
ENABLE_WEB_SEARCHfalseEnable web search skill
ENABLE_MEMORYtrueEnable long-term memory

Storage Settings

Database (VPS/Local)

VariableDefaultDescription
DATABASE_URLsqlite:./data/openclaw.dbDatabase connection string
DATABASE_TYPEsqliteDatabase type (sqlite/postgres)

File Storage

VariableDefaultDescription
FILE_STORAGE_PATH./data/filesLocal file storage path
MAX_FILE_SIZE25MBMaximum upload size
FILE_RETENTION_DAYS7Days to keep uploaded files

Security Settings

VariableDefaultDescription
RATE_LIMIT_REQUESTS100Requests per window
RATE_LIMIT_WINDOW60000Rate limit window (ms)
SESSION_SECRETAuto-generatedSession encryption key
TRUSTED_PROXIESfalseTrust X-Forwarded-* headers

Example Configurations

Minimal (Cloudflare)

OPENROUTER_API_KEY=your-byok-provider-key
# 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