Introduction

Authentication

All API requests require authentication via an API key passed in the Authorization header.

API Key Format

text
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxx

Creating API Keys

  1. Go to the API Keys page in the portal
  2. Click Create New Key
  3. Optionally specify scopes to restrict the key's access
  4. Copy the key immediately — it won't be displayed again

Scopes

API keys can be scoped to limit access:

ScopeDescription
chatAccess to chat completion endpoints
embeddingsAccess to embedding endpoints
metrics:readAccess to usage metrics

If no scopes are specified, the key has access to all endpoints.

Security Best Practices

  • Never expose keys in client-side code. Use a backend proxy.
  • Rotate keys regularly. Delete old keys and create new ones.
  • Use scoped keys when possible to limit blast radius.
  • Monitor usage in the dashboard to detect anomalies.

Error Responses

StatusMeaning
401 UnauthorizedMissing or invalid API key
403 ForbiddenKey doesn't have the required scope