Skip to content

Authentication

Connecting to Gate takes two things: the base URL you point your client at, and a Gate API key. From there you can let Gate serve the model for you, or route through your own provider key. The same key works for both.

Base URL

Point your app, SDK, or agent at Gate instead of at your provider:

https://gateway.constellationgate.ai

OpenAI-compatible clients use the /v1 suffix (https://gateway.constellationgate.ai/v1), the same as they would with OpenAI. Anthropic-style clients keep the bare host and target /v1/messages.

API keys

Create an API key in the dashboard under API keys to get started. Gate keys start with sk-gw-. Each key is scoped to a single user. The value is shown only once at creation, so store it somewhere secure like a secrets manager.

Pay through Gate

Using Gate as your model provider is as simple as pointing your client at the base URL and putting your Gate key in the Authorization header. Gate routes each request to an upstream provider and runs its security, audit, and caching on top. Requests are billed pay-as-you-go against your Gate balance.

Authorization: Bearer sk-gw-...
content-type: application/json
HeaderRequiredNotes
Authorization: Bearer sk-gw-...YesYour Gate key.
X-Gate-ProviderNoLock your model to specific provider. Otherwise, your request will be routed to the lowest cost and/or fastest provider that supports your chosen model.

For Anthropic-shaped requests (/v1/messages), Gate also requires the upstream’s standard anthropic-version: 2023-06-01 header.

Use your own provider keys

Gate can also sit in front of a provider you already call, as a passthrough proxy. This works with any provider that speaks the OpenAI-compatible (/v1/chat/completions) or Anthropic Messages (/v1/messages) format. Keep your request as it is, swap your provider’s base URL for Gate’s base URL, and add two headers: X-Gate-Upstream-Url (your provider’s original base URL) and X-Gate-Api-Key (your Gate key). Your existing Authorization header still goes to the provider, which authenticates and bills you directly. Gate adds its security, audit, and rate limiting in between.

Authorization: Bearer <your-upstream-key>
X-Gate-Api-Key: sk-gw-...
X-Gate-Upstream-Url: https://openrouter.ai/api/v1
content-type: application/json
HeaderRequiredNotes
Authorization: Bearer <upstream-key>YesYour provider (e.g. OpenAI, OpenRouter, or Anthropic) authorization key.
X-Gate-Api-Key: sk-gw-...YesYour Gate API key.
X-Gate-Upstream-UrlYesFull base URL of the provider you want to reach.

The same Gate API key works for either Pay through Gate or using your own keys.