Authentication
Inference requests use scoped API keys. Keep dashboard sessions and personal access tokens separate from keys issued for applications.
Bearer authentication
Send the API key in the Authorization header on OpenAI-compatible routes.
Authorization header · http
Authorization: Bearer sk-your-api-keyNative provider headers
Provider-native clients can keep their usual authentication shape while targeting the gateway.
Anthropic · http
x-api-key: sk-your-api-key
anthropic-version: 2023-06-01Google Gemini · http
x-goog-api-key: sk-your-api-keyKey controls
Apply the narrowest controls that still fit the workload.
| Field | Type | Description |
|---|---|---|
Model access | allowlist | Restrict a key to an explicit set of model IDs. |
IP access | CIDR list | Allow requests only from configured addresses or networks. |
Quota | number | Limit how much billable usage a key may consume. |
Expiration | timestamp | Automatically reject the key after a fixed time. |
Production practices
- Store keys in a secret manager or encrypted environment variable.
- Create separate keys for development, staging, and production.
- Rotate a key immediately if it appears in logs or source control.
- Never expose a gateway key in browser or mobile application code.