Overview
The API Key Management API allows you to create, list, update, delete, and regenerate API keys for authenticating proxy requests. API keys support model restrictions, usage limits (token-based and cost-based), and expiration dates.All API Key Management endpoints require dashboard authentication via session cookie.
Create API Key
endpoint
Create a new API key with optional restrictions and limits.
Request Body
string
required
Human-readable name for the API key (1-128 characters)
array
List of allowed model names. If null or empty, all models are allowed.
string
ISO 8601 timestamp when the key should expire. If null, the key never expires.
array
Array of usage limit rules
integer
deprecated
Legacy field for weekly token limit. Use
limits array instead.Response
string
required
Unique key identifier (UUID)
string
required
Key name
string
required
The full API key (format:
sk-clb-{48 hex chars}). Only returned once on creation.string
required
First 16 characters of the key for identification
array
List of allowed models, or null for all models
string
Expiration timestamp
boolean
required
Whether the key is active
string
required
Creation timestamp
string
Last usage timestamp
array
required
Array of limit rules with current usage
Example Request
Example Response
Error Responses
error
invalid_api_key_payload: Invalid request payload (e.g., invalid limit configuration)
List API Keys
endpoint
Retrieve all API keys with their metadata and current usage.
Response
Returns an array of API key objects (same structure as create response, but without thekey field).
Example Request
Example Response
Update API Key
endpoint
Update an existing API key’s properties. Only provided fields are updated.
Path Parameters
string
required
The API key ID to update
Request Body
string
New name for the key (1-128 characters)
array
Updated list of allowed models
string
New expiration timestamp
boolean
Set to false to deactivate the key
array
Updated limit rules. If omitted, existing limits are preserved. See create endpoint for structure.
boolean
Set to true to reset all usage counters to zero
Response
Returns the updated API key object (same structure as list endpoint).Example Request - Deactivate Key
Example Request - Update Limits
When updating limits, existing usage state is preserved for matching rules (same type, window, and model_filter). Only the max_value can be changed without resetting usage.
Error Responses
error
Not Found: The specified key ID does not exist
error
invalid_api_key_payload: Invalid request payload
Delete API Key
endpoint
Permanently delete an API key. The key will immediately stop authenticating.
Path Parameters
string
required
The API key ID to delete
Response
Returns HTTP 204 No Content on success.Example Request
Error Responses
error
Not Found: The specified key ID does not exist
Regenerate API Key
endpoint
Generate a new key value while preserving all other properties. The old key immediately stops working.
Path Parameters
string
required
The API key ID to regenerate
Response
Returns the updated API key object with the newkey and key_prefix. The full key is only shown once.
Example Request
Example Response
Error Responses
error
Not Found: The specified key ID does not exist
Key Format
All API keys follow the format:sk-clb-a1b2c3d4e5f6789012345678901234567890123456789012
The system stores only the SHA256 hash of the key. The plain key is returned only during creation and regeneration.
Usage Limits
Limit Types
- total_tokens: Total input + output tokens
- input_tokens: Input tokens only
- output_tokens: Output tokens only
- cost_usd: Cost in US dollars
Limit Windows
- daily: Resets every 24 hours
- weekly: Resets every 7 days
- monthly: Resets on the 1st of each month
Model-Scoped Limits
Limits can be scoped to specific models using themodel_filter field:
model_filter: null- Applies to all requests (global limit)model_filter: "claude-opus-4-20250514"- Applies only to requests using this model
- Limits total daily tokens across all models to 1M
- Limits monthly cost for Opus requests to $50