# `max auth`

Max session: save per-user API key, clear credentials, show current profile

```bash
max auth [options] [command]
```

## `max auth login`

Store a per-user API key on the chosen profile. Saves the key to BOTH the Max store and the Frontline store under the same profile name, so `max` and `frontline` commands share credentials.

```bash
max auth login [options] <api-key>
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--profile <name>` | Max profile: uses the per-user API key and Public API base URL from the Frontline CLI profile of the same name (`max config-path` shows the Max-only store). |  |
| `--base-url <url>` | Public API base URL for this profile (…/public/v1; default: https://prod-api.getfrontline.ai/public/v1) |  |
| `--json` | Output the saved profile as JSON |  |


## `max auth logout`

Remove stored Max credentials (API key) for a profile. Also clears the matching Frontline profile unless --keep-frontline is passed.

```bash
max auth logout [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--profile <name>` | Profile to clear (default: current). Removes API key, any legacy tokens, and saved --api-base-url for that profile. |  |
| `--keep-frontline` | Only clear the Max store; leave the matching Frontline CLI profile untouched. |  |


## `max auth whoami`

Show the profile used by the Max CLI: API key preview, resolved Public API base URL (…/public/v1), and config path.

```bash
max auth whoami [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--json` | Output as JSON |  |
| `--profile <name>` | Max profile: uses the per-user API key and Public API base URL from the Frontline CLI profile of the same name (`max config-path` shows the Max-only store). |  |