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.
To confirm which account is active, use oz whoami:
To end the session:
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):
oz run list --api-key sk_warp_...
As an environment variable (recommended for CI/CD):
export WARP_API_KEY=sk_warp_...
oz run list
In CI environments, store WARP_API_KEY as a secret in your pipeline configuration rather than hard-coding it in scripts.
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.
oz logout
Removes the locally stored session token.
oz whoami
Prints information about the currently authenticated user, including your user ID and email.
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 |
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"
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.