Two principals
ai-cmo.dev has two mutually exclusive authentication modes.API key format
A production key starts withgp_live_ followed by exactly 43 base64url characters:
401 invalid_key.
Scope matrix
Health and OpenAPI discovery are public (no auth required).
Session-only actions
These can never be performed with an API key:- Create a workspace
- Create, deliver, rotate, confirm-rotation, acknowledge, or revoke API keys
- Write or reveal stored connector credentials
- Add mock top-up credit
- Backfill AgentMail inboxes
- Invite, change, or remove team members
Full scope list
API keys carry one or more of these scopes:["workspace:read"].
API key lifecycle
Creating a key
Use the dashboard (Workspace → API Keys) orPOST /api/v1/workspaces/{workspace}/api-keys with a session cookie.
resume-delivery (see below). Once the delivery is acknowledged or its 10-minute window expires, the plaintext is gone for good.
Response:
Delivery window
The secret is available for 10 minutes via encrypted delivery. After that, delivery expires and you must create a new key. Use theacknowledge or resume-delivery actions on POST /api/v1/workspaces/{workspace}/api-keys/{keyId} to manage delivery.
Acknowledge
active and clears the encrypted delivery ciphertext.
Rotating a key
pending replacement. The old key keeps working and only enters grace — a 15-minute window before it is revoked — once that replacement’s delivery is acknowledged. Call confirm-rotation on the new key to revoke the old one immediately.
Confirm rotation
Revoke
CIDR restrictions
Keys can be restricted by client IP at creation time. Requests from outside theallowedCidrs range are rejected with 403 ip_forbidden.
Workspace binding
An API key is bound to exactly one workspace at creation. Using a path segment that differs from the bound workspace returns404 workspace_not_found.
Device authorization
For agents and CLIs, ai-cmo.dev supports device authorization as an alternative to API keys. Theai-cmo-mcp package uses this flow: it opens a browser for login, and credentials are cached at ~/.ai-cmo/credentials.json (mode 0600).
The flow uses POST /api/v1/device-authorizations (public), then polling at GET /api/v1/device-authorizations/{code} (session), and POST /api/v1/device-authorizations/{code}/token (public), which returns a real workspace-bound apiKey — not a short-lived token. Clients such as the MCP server persist it as their credential, so it is a way to provision an API key without copy-paste, not an alternative to API keys.
Anti-enumeration
Invalid, absent, unauthorized, and cross-workspace workspace identifiers all return404 workspace_not_found. Do not use 404 responses to infer whether a workspace or resource exists.