Authentication
API keys, how auth works, and key management.
API keys
Every request to the CueAPI (except health, status, and auth endpoints) requires a Bearer token:
Authorization: Bearer cue_sk_YOUR_API_KEY
API keys start with cue_sk_ followed by 32 hex characters.
Getting an API key
- Go to cueapi.ai/signup
- Enter your email
- Your API key is displayed once — copy it immediately
How auth works
- Your API key is sent as a Bearer token in the
Authorizationheader - CueAPI hashes it with SHA-256 and checks against a Redis cache (5-minute TTL)
- On cache miss, it falls back to a PostgreSQL lookup
- If valid, the request proceeds with your user context (plan, limits, etc.)
Note
CueAPI never stores your API key in plaintext. Only the SHA-256 hash is stored in the database. The plaintext key is shown once at creation and never again.
Key management
Check your current key
cueapi whoamiOr via API:
curl https://api.cueapi.ai/v1/auth/me \
-H "Authorization: Bearer cue_sk_YOUR_KEY"Regenerate your key
If your key is compromised, regenerate it immediately:
cueapi key regenerateWarning
Regenerating your API key immediately revokes the old key. All requests using the old key will return 401 Unauthorized. Update your integrations before regenerating.
Credential resolution order
The CLI and worker resolve API keys in this order:
--api-keyflag (CLI) orapi_keyin config (worker)CUEAPI_API_KEYenvironment variable~/.config/cueapi/credentials.json(saved bycueapi login)
Credential storage
Credentials are stored at:
| OS | Path |
|---|---|
| macOS / Linux | ~/.config/cueapi/credentials.json |
| Windows | %APPDATA%\cueapi\credentials.json |
The file has 600 permissions (owner read/write only) and supports multiple profiles:
{
"default": {
"api_key": "cue_sk_...",
"email": "you@example.com",
"api_base": "https://api.cueapi.ai"
}
}