Chat Completions
OpenAI-compatible chat endpoint. Any provider, any model.
POST /v1/chat/completions
Send a chat request to any supported provider through the gateway. The response format is identical to OpenAI’s chat completions API regardless of which provider handles the request.
Auth
All three schemes are accepted:Bearer (OIDC) is supported but in Alpha. Contact us if you need OIDC auth.Request
Gateway-specific fields
Response
Non-streaming
Response headers
Streaming
Whenstream: true, the response is an OpenAI-compatible SSE stream. Each data: line is a JSON chunk. Final line is data: [DONE].
Examples
Structured output
With fallback chain
Errors
Authorizations
OIDC JWT issued by your auth provider (Alpha). Full self-serve configuration is coming soon — contact us for early access. Use this for browser/frontend clients where a user is signed in.
Body
Model in provider/model-id format.
Supported providers: openai, anthropic, google, mistral.
"openai/gpt-4o"
"anthropic/claude-3-5-sonnet-20241022"
"google/gemini-2.5-flash"
"mistral/mistral-large-latest"
1Maximum tokens to generate. The gateway maps this to the correct
upstream parameter — max_completion_tokens for OpenAI reasoning
models, max_tokens for everything else.
1024
Sampling temperature. Omit for reasoning models (o3, o3-mini, o4-mini) — the gateway strips it automatically based on the model catalog.
0 <= x <= 20.7
Nucleus sampling. Supported by all providers.
0 <= x <= 1When true, the response is an OpenAI-compatible SSE stream.
Each data: line is a JSON object regardless of the upstream provider.
Structured output configuration. The gateway translates to the correct provider-specific format automatically.
Associates this request with a saved prompt in the dashboard. The prompt's content is not used — only the ID is logged for correlation.
Ordered list of fallback models to try if the primary model fails. Each entry specifies a model and the error types that trigger it.
Response
Successful response.
- Non-streaming:
Content-Type: application/json - Streaming:
Content-Type: text/event-stream
Response headers always include:
x-gatelit-request-id— use for log lookup in the dashboardx-gatelit-model— the provider/model that respondedx-gatelit-auth-mode—Bearer,GatelitSigned, orGatelitKey