API keys
- API Keys are scoped to all models and providers available to your organisation.
- Provisioning keys (coming soon) allow you to manage your API keys programatically.
- Rotation is manual today, but you can create a new key at any time without downtime.
aistats_v1_k_xx_xxx. Treat them like passwords and avoid storing them in client-side code or public repositories.
Request headers
Include the key in theAuthorization header on every request:
fetch:
Key management
| Practice | Why it matters |
|---|---|
| Use one key per app | Makes it easy to rotate without affecting other services. |
| Store keys securely | Secrets managers prevent accidental exposure in logs or error tracking. |
| Monitor usage | The dashboard shows per-key metrics so you can detect anomalies quickly. |
| Remove unused keys | Deleting stale keys reduces the surface area for potential abuse. |
Troubleshooting
- 401 Unauthorized — The key is missing, invalid, or belongs to a disabled workspace.
- 403 Forbidden — The key exists but cannot access the requested provider or model. Check your plan or contact support.
- 429 Too Many Requests - You exceeded a rate limit. See the Rate limits guide.
- 5xx errors — Retry with exponential backoff and report persistent issues via the support channel.