# Environment

[← Back to README](../README.md) • [Docs Index](./index.md)

This page lists environment variables with verified code usage in the current repo.

## Provider credentials

```bash
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GOOGLE_GENERATIVE_AI_API_KEY=...
OPENROUTER_API_KEY=...
OPENCODE_API_KEY=...
OTTOROUTER_PRIVATE_KEY=...
MOONSHOT_API_KEY=...
MINIMAX_API_KEY=...
ZAI_API_KEY=...
ZAI_CODING_API_KEY=...
```

Copilot auth can also be sourced from:

```bash
COPILOT_GITHUB_TOKEN=...
GH_TOKEN=...
GITHUB_TOKEN=...
```

## Server and client ports

```bash
PORT=3000         # API server port for `otto serve` / server startup
OTTO_PORT=9100    # TUI client default API port override
HOST=0.0.0.0      # used by some dev/build flows
```

## Web and app-specific variables

These are used by specific apps rather than the shared server runtime:

```bash
OTTO_SERVER_URL=...
OTTO_SHARE_API_URL=...
EXPO_PUBLIC_API_URL=...
EXPO_PUBLIC_ENV=...
EXPO_PUBLIC_PAY_URL=...
OTTOROUTER_BASE_URL=...
OTTOROUTER_PROXY_PORT=8403
OTTOROUTER_SOLANA_RPC_URL=...
TAURI_DEV_HOST=...
TAURI_RESOURCE_DIR=...
OTUI_TREE_SITTER_WORKER_PATH=...
```

## Build/signing variables

```bash
APPLE_SIGNING_IDENTITY=...
CLOUDFLARE_ACCOUNT_ID=...
BUN_PTY_LIB=...
```

## Variables intentionally removed from docs

These older names were previously documented but are not backed by current code in the main runtime docs surface:

- `GOOGLE_AI_API_KEY`
- `OTTO_PROJECT_ROOT`
- `DB_FILE_NAME`
- `OTTO_RENDER_MARKDOWN`

If you need a compatibility alias, document it as deprecated in the code that actually consumes it before re-adding it here.
