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

# Configuration

> Environment variables, Postgres, multi-user auth, and the end-to-end smoke test

## Environment variables & flags

| Variable / flag                                           | Default                      | Description                                                                                                                                                                                                                               |
| --------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dev`                                                   | off                          | Opens the dashboard in your browser on startup. The API behaves identically without it.                                                                                                                                                   |
| `--port` / `PORT`                                         | `4700`                       | Port for the engine's HTTP API (the dashboard is served on the same port).                                                                                                                                                                |
| `--db-url` / `AGENTX_DB_URL`                              | local SQLite                 | Postgres connection string, e.g. `postgres://user:pass@host:5432/db`.                                                                                                                                                                     |
| `AGENTX_HOME`                                             | `~/.agentx`                  | Where the SQLite file and config live.                                                                                                                                                                                                    |
| `OPENAI_API_KEY` / `ANTHROPIC_API_KEY` / `GEMINI_API_KEY` | unset                        | Unlock the LLM-judge features (evaluation scoring, online evaluators, semantic patterns, suggestion drafting, Playground). Also settable live from Platform Settings. Trace ingest and phrase/regex patterns need none.                   |
| `AGENTX_AUTH`                                             | disabled                     | `enabled` turns on real user accounts for the dashboard - owner setup on first boot, sessions, org-scoped project keys. See [Authentication](/authentication#multi-user-mode-agentx_auth-enabled).                                        |
| `AGENTX_MULTI_TENANT`                                     | `false`                      | With auth enabled: every signup gets its own organization + seeded project, per-org LLM keys and pricing catalog, invitations via Settings → Team. The SaaS/multi-tenant posture - see [Authentication](/authentication#the-three-modes). |
| `AGENTX_PUBLIC_URL`                                       | unset                        | The externally-reachable base URL in `AGENTX_AUTH=enabled` mode (cookie/redirect correctness behind a proxy).                                                                                                                             |
| `AGENTX_TRUSTED_ORIGINS`                                  | unset                        | Comma-separated extra origins allowed to hit the auth routes in enabled mode.                                                                                                                                                             |
| `AGENTX_RESEND_API_KEY`                                   | unset                        | Sends auth email (invitations, password reset, verification) through [Resend](https://resend.com). Configuring any mail transport turns on the dashboard's "Forgot password?" flow.                                                       |
| `AGENTX_SMTP_URL`                                         | unset                        | Alternative mail transport: an SMTP connection URL, e.g. `smtp://user:pass@smtp.example.com:587`.                                                                                                                                         |
| `AGENTX_EMAIL_FROM`                                       | `AgentX <noreply@localhost>` | From address for auth email.                                                                                                                                                                                                              |
| `AGENTX_EMAIL_DEBUG_DIR`                                  | unset                        | Dev-only mail transport: writes each email as a JSON file into this directory instead of sending it.                                                                                                                                      |
| `AGENTX_REQUIRE_EMAIL_VERIFICATION`                       | `false`                      | With a mail transport configured: new accounts must click a verification link before signing in.                                                                                                                                          |
| `AGENTX_GOOGLE_CLIENT_ID` / `AGENTX_GOOGLE_CLIENT_SECRET` | unset                        | Enables "Continue with Google" on the sign-in screen. OAuth callback: `<AGENTX_PUBLIC_URL>/api/v1/auth/callback/google`.                                                                                                                  |
| `AGENTX_GITHUB_CLIENT_ID` / `AGENTX_GITHUB_CLIENT_SECRET` | unset                        | Enables "Continue with GitHub". OAuth callback: `<AGENTX_PUBLIC_URL>/api/v1/auth/callback/github`.                                                                                                                                        |
| `AGENTX_QUOTA_JUDGE_CALLS_PER_DAY`                        | unset (unlimited)            | Daily cap on judge LLM calls - per organization in multi-tenant mode, per instance otherwise.                                                                                                                                             |
| `AGENTX_QUOTA_TRACES_PER_DAY`                             | unset (unlimited)            | Daily cap on ingested root traces, per project. Child spans of existing traces don't count.                                                                                                                                               |
| `AGENTX_ADMIN_TOKEN`                                      | unset                        | Unlocks the operator endpoint `GET /api/v1/admin/overview` (send as `x-admin-token`): per-org members, projects, and 24h judge/trace usage. Unset = the endpoint doesn't exist.                                                           |
| `AGENTX_SESSION_SWEEP`                                    | `true`                       | `false` disables the background sweep that judges idle sessions for session-scoped online evaluators (`POST /agent-monitoring/session-sweep/run` still works on demand).                                                                  |
| `--engine-bin`                                            | auto-detected                | Overrides which engine executable `agentx-server` launches.                                                                                                                                                                               |

## The project API key

The startup log's `Default project API key: agtx_local_...` is generated once on first run and
reused after that. It's what the dashboard's connect screen asks for and what SDK/CI/OTel
callers send as `x-api-key`. Additional projects (created from the project switcher) each get
their own key, visible in that project's **Settings → API access**.

## Using Postgres

```bash theme={null}
AGENTX_DB_URL=postgres://user:pass@host:5432/agentx ./dist/agentx-server --dev
```

Tables are created automatically on first connection - no separate migration step. SQLite
(default) is a real, durable option for a single-machine install; reach for Postgres when you
want backups, replicas, or multiple engine instances against one store.

## Verifying end-to-end

The repo ships a smoke test that runs the real Python SDK against a fresh instance - Trace,
Evaluate (judge scoring), and Monitor (built-in + custom pattern detection):

```bash theme={null}
OPENAI_API_KEY=sk-... ./scripts/smoke-test.sh
```
