Environment Variables Configuration
MetaPilot uses environment variables for security, multi-tenancy secrets, database configuration, Redis channel layers, and OpenRouter AI integrations.
Environment variables are loaded automatically from via .
services/api/.envpython-dotenvCore Variables Reference Table
| Variable Name | Required? | Default (Dev) | Description |
|---|---|---|---|
| Yes | | Django core cryptographic signing key |
| Yes | | Debug mode ( |
| Yes | | Comma-separated list of allowed hostnames |
| Yes | Dev fallback key | 32 url-safe base64-encoded bytes key for AES-256 tenant secret encryption |
| No | (Empty -> Uses SQLite) | PostgreSQL connection URL e.g. |
| Yes | | Redis database URL for Celery task queue |
| Yes | | Redis database URL for Celery task results |
| Yes | | Redis database URL for Django Channels WebSockets |
| No | | Meta WhatsApp Graph API version |
| No | | Public base URL for receiving Meta webhooks |
| No | | OpenRouter API Key for AI Chatbot and Vision models |
| No | | Enables/Disables WhatsApp AI Auto-responder |
| No | | LLM model name for text responses |
| No | | Vision model name for analyzing images |
| No | | Batch size for broadcast job processing |
| No | | Maximum messages per second limit |
Fernet Key Generation
To generate a production Fernet key, execute:
bash
python scripts/generate_fernet_key.py --write-env
Or via Python directly:
python
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
[!WARNING] In production (), starting MetaPilot without a valid 32 url-safe base64-encodedDEBUG=Falsewill raise aFERNET_KEYduring initialization to prevent storing unencrypted tenant secrets.ValueError