API Keys API

Create and manage API keys for server-to-server authentication.

createKey(name: string): Promise<ApiKey & { key_value: string }>
Create a new API key
const apiKey = await client.apiKeys.createKey('Production API Key')

// Store the key_value securely (only shown once)
console.log('API Key:', apiKey.key_value)
// Store in environment variables or secure storage
listKeys(): Promise<ApiKey[]>
List all API keys
const keys = await client.apiKeys.listKeys()
keys.forEach(key => {
  console.log(`${key.name}: ${key.key_prefix}... (status: ${key.status})`)
})
revokeKey(keyId: string): Promise<void>
Revoke an API key
await client.apiKeys.revokeKey('key-id')