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

FieldTypeRequiredDescription
namestringDescriptive name for the key
environmentstringproduction 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

StatusErrorDescription
400Invalid RequestMissing required parameters
401UnauthorizedInvalid API key
403ForbiddenNo permission to manage keys
404Not FoundProject 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