Caveman Cloud· HostedGovernance & Billing
Create, limit, rotate, and revoke Caveman gateway API keys
Manage Caveman gateway API keys: personal vs shared keys, scopes, model allowlists, rate limits, budgets, expiry, IP allowlists, rotation, and revocation.
Apps and agents authenticate to the Caveman gateway with an API key. Each key carries its own limits, and every request it signs is attributed to it, which makes keys the foundation of both access control and cost attribution. Manage keys in Governance → Keys.
For how to send a key with a request, see Authentication.
Create a key#
Open Governance → Keys
Select the project the key belongs to, then choose Create key.
Name the key and choose an owner
Under Belongs to, pick a member to create a personal key: its traffic appears under that person's name on People. Pick No one (shared key) for services, CI, and production apps. Binding a key to a member requires the Owner or Platform admin role.
Set a spend limit and expiry
Optionally set a Spend limit with a reset period of Day, Week, Month, or Total, and an expiry of Never, 7 days, 30 days, or 90 days.
Configure more options (optional)
Under More options, set a default workflow and the key's scopes. Requests that do not send an
x-cave-workflowheader are attributed to the default workflow.Copy the key
The full key and the gateway base URL are shown once. Store the key in your secret manager. Afterwards, the console only shows the key prefix.
Scopes#
Scopes decide what a key can do. New keys get the two defaults.
Per-key limits#
Open a key to set its limits. A value of 0 means unlimited. Key limits only narrow what the project allows in Governance → Access; they never widen it. Changes take effect on the next request.
A key's budget counter starts when the budget is set: spend before then is not included.
Budget headers#
When a key has a budget, gateway responses include its position so your app can react before it is cut off:
Key status and lifecycle#
Each key shows a status: Active, Near limit, At limit, Blocked, Expired, or Revoked. The list also shows when a key was last used and flags keys with no use in 90 days.
You can also manage keys through the API:
# Block a key
curl -X POST "${CAVE_API_URL}/api/v1/projects/$PROJECT_ID/keys/$KEY_ID/block" \
-H "Authorization: Bearer $CAVE_TOKEN"The same path accepts unblock, rotate, and revoke. Use PATCH /api/v1/projects/{id}/keys/{keyId} to update limits.
Best practices#
- Issue one key per person and one per service, so spend and incidents trace back to an owner.
- Use separate keys for production, staging, and CI.
- Give experimental and autonomous-agent keys a hard budget and a spend-rate quota.
- Set an expiry on every key that does not need to live forever, and review keys flagged as unused.
- Rotate on a schedule and immediately after anyone with access leaves.