Authentication

Every API request must carry a valid API key in the Authorization header.

Header format

Authorization: Bearer gw-your-key-here

Key format

API keys follow the pattern gw-{name}-{hash}:

  • gw- — fixed gateway key prefix
  • {name} — the name you gave the key
  • {hash} — 64 hex characters (SHA-256)

The full key is shown only once, at creation. Only its SHA-256 hash is stored.

What a key can do

FeatureDescription
Model allowlistRestrict which models the key may call (allowed_models)
Spending capSet a maximum spend per key, with optional automatic reset (daily / weekly / monthly)
ExpiryGive the key an expiry date (expires_at)
Enable / disableRevoke access immediately without deleting the key

Error responses

StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENKey is disabled or expired, or the requested model is not on its allowlist
403INSUFFICIENT_BALANCEAccount balance is zero