Skip to main content

API Keys

API keys authenticate your application with Brainz Lab.

Key Types

TypePrefixUse
Secret (Live)sk_live_Server-side, production
Secret (Test)sk_test_Server-side, testing
Public (Live)pk_live_Client-side, read-only
Public (Test)pk_test_Client-side, testing

Creating Keys

  1. Go to Project Settings > API Keys
  2. Click “Create Key”
  3. Choose key type
  4. Copy the key (shown only once)

Best Practices

  • Use environment variables
  • Never commit keys to git
  • Use test keys for development
  • Rotate keys periodically
  • Use public keys for client-side

Revoking Keys

  1. Go to Project Settings > API Keys
  2. Find the key
  3. Click “Revoke”
Revoked keys stop working immediately.

Key Permissions

PermissionSecretPublic
Send logsYesNo
Query logsYesRead-only
Send errorsYesNo
View errorsYesRead-only
Manage projectNoNo

Rate Limits

Each key has rate limits based on your plan:
PlanRequests/min
Free60
Starter300
Pro1000
EnterpriseUnlimited