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

# Configuration

> Environment variables and settings for the OpenBunny service.

The service is configured through environment variables. Copy `.env.example` to `.env` and adjust as needed.

## Core settings

| Variable      | Description                                               | Default               |
| ------------- | --------------------------------------------------------- | --------------------- |
| `BACKEND`     | Storage backend: `local` (SQLite) or `remote` (cloud API) | `local`               |
| `SQLITE_PATH` | Path to SQLite database file                              | `./data/openbunny.db` |
| `PORT`        | REST API port                                             | `3100`                |

## LLM settings

| Variable               | Description                              | Default                     |
| ---------------------- | ---------------------------------------- | --------------------------- |
| `OPENROUTER_API_KEY`   | OpenRouter API key                       | Required                    |
| `OPENROUTER_MODEL`     | Primary model ID                         | `anthropic/claude-sonnet-4` |
| `LLM_TEMPERATURE`      | Sampling temperature                     | `0.3`                       |
| `LLM_MAX_TOKENS`       | Max tokens per response                  | `4096`                      |
| `AGENT_MAX_ITERATIONS` | Max tool-use iterations per conversation | `10`                        |

## Scheduler settings

| Variable           | Description                                    | Default       |
| ------------------ | ---------------------------------------------- | ------------- |
| `DEBOUNCE_SECONDS` | Wait time after last message before processing | `300` (5 min) |
| `TICK_BATCH_SIZE`  | Max conversations processed per tick           | `50`          |
| `TICK_INTERVAL_MS` | Scheduler interval                             | `60000` (60s) |

## Remote backend settings

These are required when `BACKEND=remote`:

| Variable           | Description                          |
| ------------------ | ------------------------------------ |
| `REMOTE_API_URL`   | Cloud API base URL                   |
| `REMOTE_API_TOKEN` | API token (PAK) starting with `obk_` |
| `REMOTE_TEAM_ID`   | Team UUID for scoping requests       |

## Channel credentials

### Slack

| Variable          | Description                                 |
| ----------------- | ------------------------------------------- |
| `SLACK_APP_TOKEN` | Slack app-level token (starts with `xapp-`) |
| `SLACK_BOT_TOKEN` | Slack bot token (starts with `xoxb-`)       |

### WhatsApp

WhatsApp uses QR code authentication via the Baileys library. No environment variables required — run the setup wizard.

### Telegram

| Variable            | Description                          |
| ------------------- | ------------------------------------ |
| `TELEGRAM_API_ID`   | Telegram API ID from my.telegram.org |
| `TELEGRAM_API_HASH` | Telegram API hash                    |

### Gmail

| Variable               | Description                                       |
| ---------------------- | ------------------------------------------------- |
| `GOOGLE_CLIENT_ID`     | Google OAuth client ID                            |
| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret                        |
| `GOOGLE_PUBSUB_TOPIC`  | Google Cloud Pub/Sub topic for push notifications |

### iMessage

iMessage requires macOS. The service runs a Swift bridge daemon that communicates with the Messages database. No environment variables required.
