Skip to main content

Gateway API

The gateway is OpenAI-compatible. Point any OpenAI SDK at {ZEAGATE_PUBLIC_URL}/v1 with a zea- virtual key.

MethodPathAuthPurpose
POST/v1/chat/completionsBearerChat (streaming and non-streaming)
POST/chat/completionsBearerAlias
POST/v1/embeddingsBearerEmbeddings (OpenAI / Azure only)
POST/embeddingsBearerAlias
GET/v1/modelsBearerModel groups the key may use
GET/healthNoneDB connectivity
GET/health/livelinessNoneProcess up
GET/health/readinessNoneDB + Redis

There are no other public HTTP routes. Cache invalidation is Redis pub/sub, not HTTP.

Request lifecycle (chat)

  1. Auth — hash lookup; blocked/expired keys rejected
  2. Model access — key allowlist
  3. Budgets — every level must pass
  4. Rate limits — RPM/TPM for key, team, application, customer
  5. Pre-request guardrails
  6. Routing — weighted pick, retries, fallbacks
  7. Stream or return the provider response
  8. Post-response guardrails
  9. Async spend log

Error envelope

Gateway-generated errors:

{
"error": {
"message": "human-readable message",
"type": "authentication_error",
"code": "invalid_api_key"
}
}

Upstream provider errors are passed through with the upstream status and body.

See Error codes, headers and SDK snippets.