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

# JoBot environment variables reference

> Complete list of environment variables for JoBot. Covers required credentials, optional integrations, AI tuning, and per-guild default settings.

JoBot is configured entirely through environment variables set in your `docker-compose.yml` or `.env` file. Required variables must be provided before the bot starts — the bot will fail to connect to Discord, Anthropic, or your Subsonic server if any of them are missing.

## Required variables

| Variable                   | Description                                                                                                                           |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Anthropic__Token`         | Your Anthropic API key. Used to authenticate all Claude AI requests.                                                                  |
| `Discord__Token`           | Your Discord bot token from the [Discord Developer Portal](https://discord.com/developers/applications).                              |
| `Lavalink__Passphrase`     | The passphrase securing your Lavalink server. You set this value; it must match `LAVALINK_SERVER_PASSWORD` in the Lavalink container. |
| `ConnectionStrings__JoBot` | SQLite connection string. Mount a persistent volume and point this at it, e.g. `Data Source=/app/config/jobot.db`.                    |

## Optional — Lavalink

| Variable                | Default                | Description                                                                                                                 |
| ----------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `Lavalink__BaseAddress` | `http://lavalink:2333` | Internal address of the Lavalink container. Change this if you rename the service or run Lavalink on a different host/port. |

## Optional — AI tuning

| Variable                 | Default             | Description                                                                                            |
| ------------------------ | ------------------- | ------------------------------------------------------------------------------------------------------ |
| `Ai__Model`              | `claude-sonnet-4-6` | Anthropic model slug to use for all AI responses. Accepts any valid Anthropic model ID.                |
| `Ai__MaxTokens`          | `4096`              | Maximum number of tokens in a single Claude response.                                                  |
| `Ai__Temperature`        | `0.7`               | Global default creativity level (0.0 = deterministic, 1.0 = most creative).                            |
| `Ai__MaxToolIterations`  | `50`                | Maximum number of tool calls Claude can chain in a single message turn. Lower values reduce API costs. |
| `Ai__MaxHistoryMessages` | `40`                | Global cap on conversation history messages sent to Claude per request.                                |

## Optional — Guild defaults

| Variable                            | Default | Description                                                                                          |
| ----------------------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `GuildDefaults__MaxHistoryMessages` | `20`    | Default history message count for guilds that have not customized their setting.                     |
| `GuildDefaults__AiTemperature`      | `0.7`   | Default AI temperature for guilds that have not customized their setting.                            |
| `GuildDefaults__MusicVolume`        | `0.5`   | Default music volume for guilds that have not customized their setting (0.0–1.0, where `0.5` = 50%). |

## Optional — Subsonic

| Variable             | Default  | Description                                                                                                                           |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Subsonic__BaseUrl`  | *(none)* | Base URL of your Subsonic-compatible server, e.g. `https://music.example.com`. Required to enable Subsonic music search and playback. |
| `Subsonic__Username` | *(none)* | Username for your Subsonic server.                                                                                                    |
| `Subsonic__Password` | *(none)* | Password for your Subsonic server.                                                                                                    |

## Optional — ElevenLabs / TTS

| Variable              | Default  | Description                                                     |
| --------------------- | -------- | --------------------------------------------------------------- |
| `ElevenLabs__ApiKey`  | *(none)* | ElevenLabs API key. Required to enable text-to-speech features. |
| `ElevenLabs__VoiceId` | *(none)* | ElevenLabs voice ID to use for TTS output.                      |

## Example `.env` file

Create a `.env` file alongside your `docker-compose.yml` and populate it before running `docker compose up`.

```dotenv theme={null}
# Required
ANTHROPIC_API_KEY=sk-ant-...
DISCORD_TOKEN=...
LAVALINK_PASSPHRASE=changeme

# Optional — Subsonic (remove if you don't have a Subsonic server)
SUBSONIC_BASE_URL=https://music.example.com
SUBSONIC_USERNAME=jobot
SUBSONIC_PASSWORD=supersecret

# Optional — Lavalink
LAVALINK_BASE_ADDRESS=http://lavalink:2333

# Optional — AI tuning
AI_MODEL=claude-sonnet-4-6
AI_MAX_TOKENS=4096
AI_TEMPERATURE=0.7
AI_MAX_TOOL_ITERATIONS=50
AI_MAX_HISTORY_MESSAGES=40

# Optional — ElevenLabs TTS
ELEVENLABS_API_KEY=
ELEVENLABS_VOICE_ID=
```

Reference these variables in your `docker-compose.yml`:

```yaml theme={null}
services:
  JoBot:
    restart: unless-stopped
    image: ghcr.io/jeppevinkel/jobot:latest
    depends_on:
      - lavalink
    environment:
      # Required
      - Anthropic__Token=${ANTHROPIC_API_KEY}
      - Discord__Token=${DISCORD_TOKEN}
      - Lavalink__Passphrase=${LAVALINK_PASSPHRASE}
      - Subsonic__BaseUrl=${SUBSONIC_BASE_URL}
      - Subsonic__Username=${SUBSONIC_USERNAME}
      - Subsonic__Password=${SUBSONIC_PASSWORD}
      - ConnectionStrings__JoBot=Data Source=/app/config/jobot.db

      # Optional — Lavalink
      - Lavalink__BaseAddress=${LAVALINK_BASE_ADDRESS:-http://lavalink:2333}

      # Optional — AI tuning
      - Ai__Model=${AI_MODEL:-claude-sonnet-4-6}
      - Ai__MaxTokens=${AI_MAX_TOKENS:-4096}
      - Ai__Temperature=${AI_TEMPERATURE:-0.7}
      - Ai__MaxToolIterations=${AI_MAX_TOOL_ITERATIONS:-50}
      - Ai__MaxHistoryMessages=${AI_MAX_HISTORY_MESSAGES:-40}

      # Optional — ElevenLabs TTS
      - ElevenLabs__ApiKey=${ELEVENLABS_API_KEY}
      - ElevenLabs__VoiceId=${ELEVENLABS_VOICE_ID}

  lavalink:
    image: ghcr.io/lavalink-devs/lavalink:4
    environment:
      - LAVALINK_SERVER_PASSWORD=${LAVALINK_PASSPHRASE}
```

<Note>
  Guild-level settings — AI temperature, music volume, and history length — can be changed at runtime using `/settings` slash commands without restarting the bot. Environment variables serve as the global defaults that apply to any guild that has not overridden them.
</Note>
