Skip to main content

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

  1. Click Settings in the sidebar
  2. Select the API Keys tab
note

API key management requires Admin or Owner role.

Creating Keys

Create a New API Key

  1. Click Create API Key
  2. Enter a name/description
  3. Set permissions (optional)
  4. Click Create

Key Properties

PropertyDescription
NameDescriptive name for the key
KeyThe API key value
CreatedCreation timestamp
Last UsedLast API call timestamp

Managing Keys

View Key

To view a key value:

  1. Find the key in the list
  2. Click Show (eye icon)
  3. Key is displayed temporarily
  4. Copy if needed

Delete Key

To revoke a key:

  1. Find the key in the list
  2. Click Delete (trash icon)
  3. 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

TierRequests/minRequests/day
Free601,000
Starter30010,000
Pro1,000100,000
EnterpriseCustomCustom

Rate Limit Headers

Responses include rate limit info:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200

Best Practices

Security

  1. Keep keys secret: Never commit to version control
  2. Use environment variables: Store keys securely
  3. Rotate regularly: Update keys periodically
  4. Monitor usage: Watch for unusual activity
  5. Limit scope: Use minimal permissions

Naming

Use descriptive names:

  • production-backend
  • staging-integration
  • ci-cd-pipeline
  • data-sync-service

Rotation

Schedule regular key rotation:

  1. Create new key
  2. Update applications
  3. Verify new key works
  4. Delete old key

Troubleshooting

Key Not Working

  1. Verify key is correct (copy/paste exactly)
  2. Check key hasn't been deleted
  3. Confirm key has required permissions
  4. Check rate limits

Rate Limited

  1. Check current usage
  2. Implement backoff strategy
  3. Cache responses when possible
  4. Contact support for limit increase

Unauthorized Errors

  1. Verify Authorization header format
  2. Check key is for correct environment
  3. Ensure key has API access enabled

Next Steps