API Key Format
All keys use thecai_ prefix followed by a 32-character URL-safe random string:
Creating an API Key
Via CLI (recommended for first key)
Via API
Key Types
Every API key has akey_type — either "human" (default) or "agent":
The
trigger_source for workflow execution is derived server-side from the API key’s key_type — it is not a request body field. This ensures agents cannot bypass approval gates by claiming to be human.
Using API Keys
Include the key in theAuthorization header with the Bearer prefix:
Scopes
Each API key has one or more scopes that control access:Key Prefix Display
For display and audit purposes, only the key prefix (first 8 characters, e.g.,cai_a1b2) is stored. This identifies which key was used in logs without exposing the full secret.
Rate Limiting
All endpoints are rate-limited. Authenticated requests are limited by API key prefix. Unauthenticated requests are limited by IP address. When rate-limited, the response includes aRetry-After header.
Allowed Sources
API keys can optionally restrict which alert sources they can ingest from:allowed_sources is null (default), the key can ingest from any source.
