Skip to Content
Legacy ConfigurationOverview

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

VariableDescription
OPENROUTER_API_KEYYour BYOK provider API key

Integration Variables

VariableDescription
SLACK_BOT_TOKENSlack bot OAuth token for future hosted support
DISCORD_BOT_TOKENDiscord bot token for future hosted support
TELEGRAM_BOT_TOKENTelegram bot token for the live public channel

Optional Variables

VariableDefaultDescription
AI_MODELopenrouter/autoDefault AI model
MAX_TOKENS4096Maximum response tokens
WEB_API_KEYnoneAPI key for web authentication

Configuration Methods

Cloudflare Workers

Use wrangler.toml for non-secret values:

[vars] AI_MODEL = "openrouter/auto" MAX_TOKENS = 4096

Use Wrangler secrets for sensitive values:

wrangler secret put OPENROUTER_API_KEY

VPS / Local

Use a .env file:

OPENROUTER_API_KEY=your-byok-provider-key AI_MODEL=openrouter/auto TELEGRAM_BOT_TOKEN=your-telegram-token

Validation

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