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

# Authenticate the oz CLI with your Warp account

> Log in interactively with oz login, or supply a WARP_API_KEY for headless CI/CD authentication. Covers whoami, logout, and server URL overrides.

Before you can run agents or manage resources, the `oz` CLI needs to know who you are. Warp supports two authentication methods: interactive browser-based login (best for local development) and API key authentication (best for CI/CD pipelines and automated scripts). Both methods provide full access to the same CLI commands.

## Interactive login

Run `oz login` to open a browser window and authenticate with your Warp account. Your session is stored locally and reused for subsequent commands.

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

To confirm which account is active, use `oz whoami`:

```bash theme={null}
oz whoami
```

To end the session:

```bash theme={null}
oz logout
```

## API key authentication

For non-interactive environments — such as GitHub Actions, CI pipelines, or scripts running on remote servers — use an API key instead of the browser flow.

You can supply the key in two ways:

**As a flag** (takes precedence over the environment variable):

```bash theme={null}
oz run list --api-key sk_warp_...
```

**As an environment variable** (recommended for CI/CD):

```bash theme={null}
export WARP_API_KEY=sk_warp_...
oz run list
```

<Tip>
  In CI environments, store `WARP_API_KEY` as a secret in your pipeline configuration rather than hard-coding it in scripts.
</Tip>

### When to use API keys vs interactive login

| Scenario                      | Recommended method                  |
| ----------------------------- | ----------------------------------- |
| Local development             | Interactive login (`oz login`)      |
| GitHub Actions / CI           | `WARP_API_KEY` environment variable |
| Automated scripts on a server | `WARP_API_KEY` environment variable |
| Shared workstation            | Interactive login                   |

## Reference

### oz login

Opens a browser window to authenticate with Warp. Stores the session token locally.

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

### oz logout

Removes the locally stored session token.

```bash theme={null}
oz logout
```

### oz whoami

Prints information about the currently authenticated user, including your user ID and email.

```bash theme={null}
oz whoami
```

## Advanced: server URL overrides

In self-hosted or staging deployments, you can override the Warp server endpoints the CLI connects to using environment variables. These are advanced options not required for standard use.

| Environment variable   | Description                        |
| ---------------------- | ---------------------------------- |
| `WARP_SERVER_ROOT_URL` | Override the root HTTPS server URL |
| `WARP_WS_SERVER_URL`   | Override the WebSocket server URL  |

```bash theme={null}
export WARP_SERVER_ROOT_URL=https://warp.example.com
export WARP_WS_SERVER_URL=wss://warp.example.com
oz agent run-cloud --prompt "Run tests"
```

<Warning>
  Setting these overrides points the CLI to a different backend. Only use them if you are running a self-hosted Warp deployment or have been instructed to by Warp support.
</Warning>
