API Keys
Manage API keys for programmatic access to ZenSearch.
Overview
API keys allow you to:
- Access ZenSearch APIs programmatically
- Integrate with external tools
- Build custom applications
- Automate workflows
Accessing API Keys
- Click Settings in the sidebar
- Select the API Keys tab
note
API key management requires Admin or Owner role.
Creating Keys
Create a New API Key
- Click Create API Key
- Enter a name/description
- Set permissions (optional)
- Click Create
Key Properties
| Property | Description |
|---|---|
| Name | Descriptive name for the key |
| Key | The API key value |
| Created | Creation timestamp |
| Last Used | Last API call timestamp |
Managing Keys
View Key
To view a key value:
- Find the key in the list
- Click Show (eye icon)
- Key is displayed temporarily
- Copy if needed
Delete Key
To revoke a key:
- Find the key in the list
- Click Delete (trash icon)
- Confirm deletion
warning
Deleting an API key immediately revokes access. Any applications using the key will stop working.
Using API Keys
Authentication Header
Include the API key in requests:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.zensearch.ai/v1/search
SDK Usage
import { ZenSearch } from '@zensearch/sdk';
const client = new ZenSearch({
apiKey: 'YOUR_API_KEY'
});
const results = await client.search('your query');
Rate Limits
Default Limits
| Tier | Requests/min | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Starter | 300 | 10,000 |
| Pro | 1,000 | 100,000 |
| Enterprise | Custom | Custom |
Rate Limit Headers
Responses include rate limit info:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200
Best Practices
Security
- Keep keys secret: Never commit to version control
- Use environment variables: Store keys securely
- Rotate regularly: Update keys periodically
- Monitor usage: Watch for unusual activity
- Limit scope: Use minimal permissions
Naming
Use descriptive names:
production-backendstaging-integrationci-cd-pipelinedata-sync-service
Rotation
Schedule regular key rotation:
- Create new key
- Update applications
- Verify new key works
- Delete old key
Troubleshooting
Key Not Working
- Verify key is correct (copy/paste exactly)
- Check key hasn't been deleted
- Confirm key has required permissions
- Check rate limits
Rate Limited
- Check current usage
- Implement backoff strategy
- Cache responses when possible
- Contact support for limit increase
Unauthorized Errors
- Verify Authorization header format
- Check key is for correct environment
- Ensure key has API access enabled
Next Steps
- API Overview - Learn about the API
- Authentication - API authentication details