API Keys API
Complete API reference for managing API keys programmatically.
Overview
The API Keys API allows you to create, list, and revoke API keys for your projects. All endpoints require authentication.
Base URL: https://cencori.com/api
List API Keys
Get all API keys for a project.
Request
request
Response
response.json
Example
list-keys.ts
Create API Key
Generate a new API key for a project.
Request
request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ❌ | Descriptive name for the key |
environment | string | ✅ | production or test |
Response
response.json
Important: The full API key is only shown once during creation. Store it securely!
Example
create-key.ts
Revoke API Key
Permanently revoke an API key.
Request
request
Response
response.json
Note: Revoked keys stop working immediately. All requests using the revoked key will return 401 errors.
Example
revoke-key.ts
Get Key Usage Stats
Retrieve usage statistics for a specific API key.
Request
request
Response
response.json
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Invalid Request | Missing required parameters |
| 401 | Unauthorized | Invalid API key |
| 403 | Forbidden | No permission to manage keys |
| 404 | Not Found | Project or key doesn't exist |
Best Practices
- Use descriptive names to identify key purpose
- Rotate keys regularly (every 90 days)
- Use separate keys for different environments
- Revoke unused keys immediately
- Monitor key usage for anomalies
- Never commit keys to version control

