Skip to main contentAPI Keys
API keys authenticate your application with Brainz Lab.
Key Types
| Type | Prefix | Use |
|---|
| 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
- Go to Project Settings > API Keys
- Click “Create Key”
- Choose key type
- 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
- Go to Project Settings > API Keys
- Find the key
- Click “Revoke”
Revoked keys stop working immediately.
Key Permissions
| Permission | Secret | Public |
|---|
| Send logs | Yes | No |
| Query logs | Yes | Read-only |
| Send errors | Yes | No |
| View errors | Yes | Read-only |
| Manage project | No | No |
Rate Limits
Each key has rate limits based on your plan:
| Plan | Requests/min |
|---|
| Free | 60 |
| Starter | 300 |
| Pro | 1000 |
| Enterprise | Unlimited |