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

# Configuration

> Environment variables and local server state.

## Environment Variables

\| Variable | Description |
\|---|---|---|
\| `PORT` | Server port. Defaults to `4096`. |
\| `OPENAI_API_KEY` | Enables the `codex` provider. |
\| `ANTHROPIC_API_KEY` | Enables the `claude` provider. |

Providers can be listed even when they are not configured. A request fails if it targets a
provider without the matching API key.

When `0x0 server` starts in an interactive terminal and neither provider key is present, it asks
for `OPENAI_API_KEY` and `ANTHROPIC_API_KEY`. Values entered at the prompt are used only for that
server process. Add exports to your shell config for durable setup:

```bash theme={null}
export OPENAI_API_KEY=...
export ANTHROPIC_API_KEY=...
```

## Server URL

The server binds through Bun and prints its local URL on boot:

```bash theme={null}
PORT=4107 bun run --cwd apps/server dev
```

## State

Agent sessions use local git worktrees and refs. The default state root is:

```text theme={null}
~/.local/state/0x0/
```

Each session stores:

* A detached agent worktree
* A baseline ref
* An agent-head ref
* A `sessions.json` registry

Clients should treat this directory as server-owned state.
