Configuration
OpenClaw is configured primarily through environment variables. This guide covers all available options.
Configuration Topics
Quick Reference
The current build is BYOK-first. Use the provider secret and model IDs that match the setup you want to run.
Required Variables
| Variable | Description |
|---|---|
OPENROUTER_API_KEY | Your BYOK provider API key |
Integration Variables
| Variable | Description |
|---|---|
SLACK_BOT_TOKEN | Slack bot OAuth token for future hosted support |
DISCORD_BOT_TOKEN | Discord bot token for future hosted support |
TELEGRAM_BOT_TOKEN | Telegram bot token for the live public channel |
Optional Variables
| Variable | Default | Description |
|---|---|---|
AI_MODEL | openrouter/auto | Default AI model |
MAX_TOKENS | 4096 | Maximum response tokens |
WEB_API_KEY | none | API key for web authentication |
Configuration Methods
Cloudflare Workers
Use wrangler.toml for non-secret values:
[vars]
AI_MODEL = "openrouter/auto"
MAX_TOKENS = 4096Use Wrangler secrets for sensitive values:
wrangler secret put OPENROUTER_API_KEYVPS / Local
Use a .env file:
OPENROUTER_API_KEY=your-byok-provider-key
AI_MODEL=openrouter/auto
TELEGRAM_BOT_TOKEN=your-telegram-tokenValidation
OpenClaw validates configuration on startup. Check logs for warnings about missing or invalid values.
[WARN] TELEGRAM_BOT_TOKEN not set - Telegram integration disabled
[INFO] Configuration validated successfully