Skip to content

API Keys

API keys follow the format sk_live_{random} where {random} is a cryptographically random string. Keys are hashed with bcrypt before storage — the full key is only shown once at creation time.

Terminal window
curl -X POST https://cavos.org/api/keys \
-H "Authorization: Bearer <session_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Production Key",
"creditLimit": 100
}'

Response (201):

{
"message": "API key created successfully",
"apiKey": {
"id": "key-uuid",
"name": "My Production Key",
"keyPrefix": "sk_live_abc1...",
"creditLimit": 100,
"creditsUsed": 0,
"status": "ACTIVE",
"createdAt": "2024-01-01T00:00:00Z"
},
"key": "sk_live_abc123def456..."
}
RuleConstraint
NameRequired, non-empty
Credit limit1–10,000 (default: 50)
Max keys per user20
Key formatsk_live_{random}
Terminal window
curl https://cavos.org/api/keys \
-H "Authorization: Bearer <session_token>"

Returns all non-deleted keys with prefix, usage, and status. Full key values are never returned after creation.

StatusDescription
ACTIVEKey is usable
REVOKEDKey has been disabled

Deleted keys are soft-deleted (marked with deletedAt timestamp) and excluded from listing. They can no longer authenticate requests.