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

# Environment Variables

> Every SYNTI_ environment variable Synti reads, what it controls, and how values take precedence.

Synti reads a set of environment variables at launch to locate its config, authenticate against providers, and run in server mode. Variables are useful for automation, CI, containers, and the [headless server](/server/headless), where you don't want to rely on the desktop UI or the on-disk stores. Synti's own variables are prefixed `SYNTI_`; it also honors the standard provider keys.

## Provider credentials

| Variable                  | Purpose                                                                                     | Default          |
| ------------------------- | ------------------------------------------------------------------------------------------- | ---------------- |
| `ANTHROPIC_API_KEY`       | Anthropic API key.                                                                          | —                |
| `SYNTI_ANTHROPIC_API_KEY` | Synti-scoped Anthropic key; wins over `ANTHROPIC_API_KEY`.                                  | —                |
| `OPENAI_API_KEY`          | OpenAI API key.                                                                             | —                |
| `GOOGLE_API_KEY`          | Google (Gemini) API key.                                                                    | —                |
| `LLM_API_KEY`             | Generic key for the active provider when no provider-specific key is set.                   | —                |
| `LLM_PROVIDER`            | Default provider (`anthropic`, `openai`, `google`, `openrouter`, `groq`, `mistral`, `xai`). | `anthropic`      |
| `LLM_MODEL`               | Default model ID.                                                                           | provider default |
| `LLM_BASE_URL`            | Custom base URL for a proxy, gateway, or self-hosted endpoint.                              | provider default |

See [API Providers](/reference/config/custom-endpoint) for how these map to connections.

## Configuration and paths

| Variable                    | Purpose                               | Default     |
| --------------------------- | ------------------------------------- | ----------- |
| `SYNTI_CONFIG_DIR`          | Location of the config directory.     | `~/.synti`  |
| `SYNTI_LOCAL_MCP_ENABLED`   | Allow local (stdio) MCP servers.      | `true`      |
| `SYNTI_BUNDLED_ASSETS_ROOT` | Root path for bundled runtime assets. | app default |
| `SYNTI_DEBUG`               | Enable verbose diagnostic logging.    | disabled    |
| `SYNTI_DEEPLINK_SCHEME`     | URL scheme for deep links.            | `synti`     |

## Server mode

Used when running Synti as a headless server or connecting a client to one.

| Variable             | Purpose                                                       | Default     |
| -------------------- | ------------------------------------------------------------- | ----------- |
| `SYNTI_SERVER_TOKEN` | Bearer token clients authenticate with.                       | —           |
| `SYNTI_SERVER_URL`   | WebSocket URL a client connects to (`ws://` or `wss://`).     | —           |
| `SYNTI_RPC_HOST`     | Address the server binds to. Set `0.0.0.0` for remote access. | `127.0.0.1` |
| `SYNTI_RPC_PORT`     | Port the server listens on.                                   | `9100`      |
| `SYNTI_RPC_TLS_CERT` | Path to the server's PEM certificate (enables `wss://`).      | —           |
| `SYNTI_RPC_TLS_KEY`  | Path to the server's PEM private key.                         | —           |
| `SYNTI_RPC_TLS_CA`   | Optional CA chain for the server certificate.                 | —           |
| `SYNTI_TLS_CA`       | Client-side CA cert for trusting a self-signed server.        | —           |

See [Headless Server](/server/headless) and the [CLI reference](/reference/cli) for usage.

## Precedence

When the same setting can come from more than one place, Synti resolves it in a fixed order.

<AccordionGroup>
  <Accordion title="Provider credential lookup">
    1. `SYNTI_ANTHROPIC_API_KEY` (or the Synti-scoped key for the active provider)
    2. The standard provider key, e.g. `ANTHROPIC_API_KEY` / `OPENAI_API_KEY`
    3. `LLM_API_KEY`
    4. Encrypted [credential store](/reference/config/credentials)
    5. Interactive prompt in the app
  </Accordion>

  <Accordion title="Base URL">
    1. `LLM_BASE_URL`
    2. The connection's configured base URL
    3. The provider's default endpoint
  </Accordion>

  <Accordion title="Config directory">
    1. `SYNTI_CONFIG_DIR`
    2. `~/.synti` (default)
  </Accordion>
</AccordionGroup>

<Note>
  Environment values override what's stored on disk. That's intentional — it lets a container or CI job inject a key without writing it into `~/.synti`.
</Note>

## Related

<CardGroup cols={2}>
  <Card title="Credentials" icon="lock" href="/reference/config/credentials">
    The encrypted store env vars can override.
  </Card>

  <Card title="Headless Server" icon="server" href="/server/headless">
    Where the server-mode variables apply.
  </Card>

  <Card title="Network Proxy" icon="network-wired" href="/reference/config/network-proxy">
    Proxy and CA variables for restricted networks.
  </Card>

  <Card title="Config File" icon="file-code" href="/reference/config/config-file">
    Settings that persist between launches.
  </Card>
</CardGroup>
