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

# Environment Variables

> All environment variables supported by Daydream Scope

# Scope Environment Variables

Scope reads the following environment variables at startup. Set them in your shell, `.env` file, or cloud provider's configuration panel. The `HF_TOKEN` can also be set directly in the Scope UI via **Settings > API Keys** - see [HuggingFace Auth](/scope/guides/huggingface) for details.

***

## Authentication

| Variable   | Default | Description                                                                                                                                                                                                                                        |
| :--------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HF_TOKEN` | -       | HuggingFace access token for downloading gated models and obtaining Cloudflare TURN credentials for WebRTC. Can also be set via **Settings > API Keys** in the Scope UI. See [HuggingFace Auth](/scope/guides/huggingface) for setup instructions. |

***

## TURN Server Credentials

Scope uses TURN servers for WebRTC connections behind firewalls. By default, it obtains credentials from Cloudflare using your `HF_TOKEN`. You can override this with direct Cloudflare or Twilio credentials.

| Variable                        | Default | Description                                                                             |
| :------------------------------ | :------ | :-------------------------------------------------------------------------------------- |
| `CLOUDFLARE_TURN_KEY_ID`        | -       | Cloudflare TURN key ID for direct TURN configuration (alternative to `HF_TOKEN`)        |
| `CLOUDFLARE_TURN_KEY_API_TOKEN` | -       | Cloudflare TURN key API token for direct TURN configuration (alternative to `HF_TOKEN`) |
| `TWILIO_ACCOUNT_SID`            | -       | Twilio account SID for TURN server credentials                                          |
| `TWILIO_AUTH_TOKEN`             | -       | Twilio auth token for TURN server credentials                                           |

***

## Recording

| Variable                            | Default | Description                                                                                                                  |
| :---------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------- |
| `RECORDING_ENABLED`                 | `false` | Enable recording as a fallback when no recording parameter is provided via the UI. The UI recording toggle takes precedence. |
| `RECORDING_MAX_LENGTH`              | `1h`    | Maximum total recording length (sum of all segments). Supports `1h`, `30m`, `120s`, or plain seconds (e.g. `3600`).          |
| `RECORDING_STARTUP_CLEANUP_ENABLED` | `true`  | Clean up recording files from previous sessions at startup.                                                                  |

***

## Directory Overrides

By default, Scope stores data in `~/.daydream-scope/`. Use these variables to override specific directories.

| Variable                     | Default                     | Description                            |
| :--------------------------- | :-------------------------- | :------------------------------------- |
| `DAYDREAM_SCOPE_MODELS_DIR`  | `~/.daydream-scope/models`  | Directory for downloaded model weights |
| `DAYDREAM_SCOPE_LOGS_DIR`    | `~/.daydream-scope/logs`    | Directory for application logs         |
| `DAYDREAM_SCOPE_PLUGINS_DIR` | `~/.daydream-scope/plugins` | Directory for node data and state      |

***

## Debugging

| Variable          | Default | Description                                             |
| :---------------- | :------ | :------------------------------------------------------ |
| `PIPELINE`        | -       | Force-load a specific pipeline at startup (for testing) |
| `VERBOSE_LOGGING` | -       | Enable verbose logging for uvicorn, FastAPI, and aiortc |

***

## See Also

<CardGroup cols={2}>
  <Card title="HuggingFace Auth" icon="key" href="/scope/guides/huggingface">
    Set up your HuggingFace token
  </Card>

  <Card title="System Requirements" icon="server" href="/scope/reference/system-requirements">
    Hardware and software requirements
  </Card>
</CardGroup>
