Authentication

Authenticate API requests using API keys.

API Keys

All API requests must include an API key in the Authorization header:

curl https://api.your-domain.com/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY"

Creating API Keys

  1. Navigate to Account > API Keys
  2. Click Create Key
  3. Give it a descriptive name
  4. Copy the key — it won't be shown again

Key Types

TypePermissionsUse Case
Secret KeyFull accessServer-side integrations
Publishable KeyChat onlyClient-side embed widgets

Security Best Practices

  • Never expose secret keys in client-side code
  • Use environment variables to store keys
  • Rotate keys periodically
  • Use publishable keys for browser-facing code

Rate Limiting

API keys are rate-limited based on your plan. When you exceed the limit, requests return 429 Too Many Requests with a Retry-After header.

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Too many requests. Try again in 30 seconds."
  }
}

On this page