Why are API keys managed under Service Accounts? API keys are now organized under Service Accounts so you can group related keys, assign granular permissions per service, and rotate or revoke keys without affecting other integrations. You can still create direct (personal) keys for quick development — but for production workloads, Service Account keys give you better security and auditability.
API Key Format
ak-prefix identifies the string as an API key- Access ID — 32 hex characters (UUID without hyphens), public identifier
- Secret — private credential appended directly after the access ID
Generating API Keys
Service Account Keys
The primary method. API keys are automatically generated when you create a service account:- Go to Team > Service Accounts
- Click Create Service Account
- Fill in name, description, role
- Click Create
- Copy the displayed API key immediately
- Go to Team > Service Accounts > Select account
- Click API Keys tab
- Click Generate New Key
- Copy and store securely
Direct API Keys
For personal development and quick integrations:- Go to Settings > API Keys
- Click Create API Key
- Set a name, scope, and permissions
- Click Create
- Copy the displayed API key immediately
Using API Keys
Authentication Header
Include your API key in theX-API-Key header:
Environment Variable
Store your key in an environment variable:In Application Code
JavaScript:Managing API Keys
View All Keys
- Go to Team > Service Accounts > Select account
- Click API Keys tab
- See all active keys with:
- Last 6 characters (for identification)
- Creation date
- Last used date
- Status (Active/Revoked)
Rotate Keys
Replace an active key with a new one:Revoke Keys
Instantly disable a key without deleting the service account:- Go to Team > Service Accounts > Select account
- Click API Keys tab
- Find the key you want to revoke
- Click Revoke
- Confirm revocation
401 Unauthorized on all API calls. This is immediate.
Delete Keys
Permanently remove a key (only possible after revocation):- Revoke the key first
- Wait 24 hours (safety period)
- Click Delete
- Confirm deletion
API Key Security
Storage Best Practices
Do NOT:- Hardcode keys in source code
- Store in version control (git, etc.)
- Share via email or chat
- Store in plain text config files
- Log or expose in error messages
- Store in environment variables
- Use a secret manager (e.g., HashiCorp Vault, 1Password)
- Encrypt at rest if stored on disk
- Restrict file permissions (chmod 600)
- Use
.gitignoreto exclude credential files
Secret Manager Examples
GitHub Secrets:Least Privilege
- Create separate service accounts for different purposes
- Assign only required role and resource restrictions
- Use Viewer role for read-only access
- Use Developer role for resource creation/modification
Monitoring
Enable audit logging to track API key usage:- Go to Team > Service Accounts > Select account
- View Activity tab
- Monitor for:
- Unexpected API calls
- Failed authentication attempts
- Access from unusual IP addresses or times
- Unusual data access patterns
Troubleshooting
”Invalid API Key” Error
Check:- Key format is correct (
ak-prefix) - Key hasn’t been revoked
- Key hasn’t been deleted
- No extra whitespace in the header
“Unauthorized” (401) Error
The key is valid but doesn’t have permission:- Check service account role (Developer or higher needed)
- Verify resource isn’t restricted to other accounts
- Ensure service account isn’t disabled
Key Stops Working After Rotation
Old key was revoked before all applications updated:- Generate a new key
- Update remaining applications
- Monitor logs for any old key usage
- If critical, create new service account as backup
Lost API Key
If compromised:- Revoke the key immediately
- Generate a new key
- Update all applications
- Monitor for unauthorized access
- Generate a new key
- Delete the old key after rotation
API Key Limits
| Limit | Value |
|---|---|
| Keys per service account | 10 |
| Key lifetime | Unlimited (until rotation) |
| Key length | 44 characters |
| Rotation delay | Immediate |
| Rate limiting | 1000 req/min per key |
API Key Permissions
API keys have the same permissions as their associated service account:- Developer role permissions
- Resource restrictions
- Account access scope