> ## 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.

# Authentication

> API keys and session authentication

AgentX uses two authentication mechanisms depending on the caller.

## API key — SDK and CI pipelines

SDK routes (submitting traces, running CI evaluations) use an API key passed in the `x-api-key` header.

```http theme={null}
x-api-key: ax_live_xxxxxxxxxxxxxxxx
```

Get your key from **Settings → API Keys** in the [dashboard](https://app.agentx.so/settings/account).

**Python SDK** — pass it at initialization or set the environment variable:

```python theme={null}
from agentx import AgentX

# Explicit
client = AgentX(api_key="ax_live_xxxxxxxxxxxxxxxx")

# From environment (AGENTX_API_KEY)
client = AgentX.from_env()
```

```bash theme={null}
export AGENTX_API_KEY=ax_live_xxxxxxxxxxxxxxxx
```

## Session — browser UI routes

Routes called by the AgentX frontend (`GET /ingest/traces`, tracked-agent management) use the session cookie set by the login flow. No extra header is required when calling from the browser.

## Which routes use which

| Route                                          | Auth    |
| ---------------------------------------------- | ------- |
| `POST /api/v1/ingest/traces`                   | API key |
| `POST /api/v1/ingest/traces/:id/evaluate`      | API key |
| `POST /api/v1/ingest/ci-runs`                  | API key |
| `POST /api/v1/ingest/ci-runs/:id/results`      | API key |
| `POST /api/v1/ingest/ci-runs/:id/finalize`     | API key |
| `GET /api/v1/ingest/ci-runs/:id`               | API key |
| `GET /api/v1/ingest/datasets/:id/test-cases`   | API key |
| `GET /api/v1/ingest/traces`                    | Session |
| `GET/PUT/DELETE /api/v1/ingest/tracked-agents` | Session |
