Endpoint
- Fetches the prompt’s published version (cached for fast retrieval).
- Resolves any prompt partials (
{{> partial_name}}). - Interpolates
{{variable_name}}tokens with the values you supply. - Merges any runtime overrides (model, temperature, max tokens).
- Routes the assembled request through the normal
/v1/chat/completionspipeline.
POST /v1/chat/completions.
Authentication
SameAuthorization header schemes as /v1/chat/completions:
Path parameter
Request
Content-Type:application/json
Body fields
object
Key-value pairs for
{{variable_name}} substitutions in the prompt’s system prompt and user message templates.Variable names must match [A-Za-z_][A-Za-z0-9_]*. Values are coerced to the type declared in the prompt’s variable definitions:If a required variable is missing, the gateway returns
400.boolean
default:"false"
Enable Server-Sent Events streaming. Uses the same SSE format as
/v1/chat/completions.object
Runtime overrides applied on top of the prompt’s saved configuration.
Response
The response is identical in structure toPOST /v1/chat/completions — an OpenAI-compatible completion object for non-streaming requests, or an SSE stream when stream: true.
Response headers include x-gatelit-request-id, x-gatelit-model, and x-gatelit-auth-mode.
Examples
Partial resolution
If your prompt templates reference partials with{{> partial_name}}, the gateway resolves them automatically before variable interpolation. This means partials can themselves contain {{variable_name}} tokens — they are expanded in the correct order.
Partials not found in the dashboard are substituted with an empty string
rather than causing an error, so your prompt degrades gracefully if a partial
is deleted.
Error codes
See the Errors reference for the full error shape and handling guidance.