BrainUs LogoBrainUs AI
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

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_abc123

Rotation Schedule

EnvironmentRecommended Frequency
ProductionEvery 90 days
StagingEvery 6 months
DevelopmentYearly 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

  1. Go to Dashboard → API Keys
  2. Find the key to revoke
  3. Click "Revoke"
  4. Confirm the action

Revoking a key is immediate and irreversible. All requests using that key will fail instantly.

Key Limits by Plan

PlanMax API Keys
Free3
Pro10
EnterpriseUnlimited

Viewing Key Usage

Track which keys are being used:

# View usage per key
brainus usage --key-id key_abc123 --last 7d

In 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

On this page