> ## Documentation Index
> Fetch the complete documentation index at: https://docs.botmux.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

> Configure BotMux via environment variables

| Variable                     | Equivalent Flag | Description                                                                                                                                          |
| ---------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TELEGRAM_BOT_TOKEN`         | `-token`        | Telegram bot token                                                                                                                                   |
| `TELEGRAM_API_URL`           | `-tg-api`       | Custom Telegram API base URL                                                                                                                         |
| `DEMO_MODE`                  | `-demo`         | Set to `true` for demo mode                                                                                                                          |
| `BOTMUX_ALLOW_AUTO_REGISTER` | —               | Set to `1` to allow the API proxy's `setWebhook` interception to auto-register unknown bot tokens. Disabled by default.                              |
| `BOTMUX_STRICT_WEBHOOK`      | —               | Set to `1` to require HTTPS for all webhook URLs, including loopback addresses. When unset, HTTP is allowed for `localhost`, `127.0.0.1`, and `::1`. |

## Usage

```bash theme={null}
export TELEGRAM_BOT_TOKEN="123456:ABC-DEF..."
export TELEGRAM_API_URL="http://localhost:8081"
./botmux
```

Environment variables and CLI flags can be combined. CLI flags take precedence.
