Authentication
Managing API Keys
Create, rotate, and revoke API keys
Learn how to create, manage, rotate, and revoke your API keys for secure access to the BrainUs API.
Creating API Keys
### Generate New Key Click "Generate New Key" button
Name Your Key Give your key a descriptive name (e.g., "Production Server",
"Development", "Staging")
Copy Immediately
Important: Copy your key immediately - you won't be able to see it again!
Key Naming Best Practices
Use descriptive names that indicate:
- Environment:
prod-api-server,dev-local,staging-app - Purpose:
backend-api,mobile-app,data-pipeline - Owner/Team:
frontend-team,john-dev,analytics
Good naming makes it easier to identify which key to rotate or revoke when needed.
Rotating API Keys
Regularly rotate your keys for security:
# 1. Generate a new key
NEW_KEY=$(brainus keys create --name "production-v2")
# 2. Update your application with new key
export BRAINUS_API_KEY=$NEW_KEY
# 3. Deploy and verify new key works
# 4. Revoke old key after successful deployment
brainus keys revoke key_old_abc123Rotation Schedule
| Environment | Recommended Frequency |
|---|---|
| Production | Every 90 days |
| Staging | Every 6 months |
| Development | Yearly or as needed |
Revoking API Keys
Revoke keys immediately if:
- Compromised: Key was exposed publicly
- Employee departure: Team member leaves
- No longer needed: Deprecated project or service
- Suspicious activity: Unusual usage patterns detected
How to Revoke
- Go to Dashboard → API Keys
- Find the key to revoke
- Click "Revoke"
- Confirm the action
Revoking a key is immediate and irreversible. All requests using that key will fail instantly.
Key Limits by Plan
| Plan | Max API Keys |
|---|---|
| Free | 3 |
| Pro | 10 |
| Enterprise | Unlimited |
Viewing Key Usage
Track which keys are being used:
# View usage per key
brainus usage --key-id key_abc123 --last 7dIn the dashboard, you can see:
- Last used timestamp
- Total requests made
- Current rate limit status
- Geographic usage patterns (Enterprise)
Unused keys for 90+ days are flagged for review. Consider revoking them to reduce security risk.
Next Steps
- Security Best Practices - Keep your keys safe
- Environment Setup - Configure your development environment