Overview
API keys control client authentication to the CLI Proxy API server. The proxy supports multiple API keys for different clients and teams, along with a separate management API key for administrative access.Client API Keys
List of API keys for authenticating clients to the proxy server.Example:
Clients must include the API key in the
Authorization header as Bearer <api-key> when making requests.Authentication Methods
Clients authenticate using theAuthorization header:
Authentication Directory
Directory where authentication token files are stored. Supports Custom path:
~ for home directory expansion.Purpose:- Stores OAuth tokens for providers (Gemini, Claude, Codex, etc.)
- Maintains session state for authenticated providers
- Persists credentials across server restarts
Management API
The Management API provides administrative access to the proxy for configuration, monitoring, and OAuth session management.Management API settings for administrative access.
Management API Authentication
Management endpoints require the management key in theX-Management-Key header:
Management Endpoints
GET /v0/management/sessions- List OAuth sessionsPOST /v0/management/oauth/{provider}- Initiate OAuth flowDELETE /v0/management/sessions/{id}- Revoke sessionGET /v0/management/config- View configuration
Complete API Keys Example
Per-Client Upstream API Keys (Amp Integration)
When using Amp integration, you can map different client API keys to different upstream Amp accounts:Client keys not listed in
upstream-api-keys will use the default upstream-api-key.Best Practices
Empty Management Key:Leaving
secret-key empty disables the Management API entirely:Key Rotation
To rotate client API keys:- Add new keys to the
api-keyslist - Update clients to use new keys
- Remove old keys after verification
- Update
secret-keywith new plaintext password - Restart server (key will be hashed automatically)
- Update admin tools with new key