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

# Authentication

> How to authenticate with Trace.

## Cloud Login

The easiest way to authenticate is using the CLI. This connects your local environment to your Trace Cloud account.

```bash theme={null}
trace login
```

This will open your browser to authorize the device. Once successful, your API key will be securely stored in `~/.trace/config`.

## API Keys

For CI/CD, MCP, or explicit usage, you can use an API Key.

1. Go to the [Trace Dashboard](https://trace.probebrowser.com/dashboard).
2. Create a new **Service Token**.
3. Set it as an environment variable:

```bash theme={null}
export TRACE_API_KEY=sk_live_...
```

### Usage

**CLI**:

```bash theme={null}
trace analyze --api-key sk_live_...
```

**MCP**:
Configure the `env` block in your server settings:

```json theme={null}
"env": {
  "TRACE_API_KEY": "sk_live_..."
}
```
