Fundamentals

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-key

Native 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-01
Google Gemini · http
x-goog-api-key: sk-your-api-key

Key controls

Apply the narrowest controls that still fit the workload.

FieldTypeDescription
Model accessallowlistRestrict a key to an explicit set of model IDs.
IP accessCIDR listAllow requests only from configured addresses or networks.
QuotanumberLimit how much billable usage a key may consume.
ExpirationtimestampAutomatically 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.