Skip to main content
POST
POST /v1/prompts/{slug}/run Execute a saved prompt from the dashboard by its slug. The gateway fetches the prompt’s template, interpolates your variables, and routes through the normal chat completions pipeline. By default the published version is used. Use the version query parameter to target a specific version.

Auth

All three schemes are accepted:
Bearer (OIDC) is supported but in Alpha. Contact us if you need OIDC auth.

Path parameters

Query parameters

Version values:

Request body

Examples

File inputs

File variables (type: "file" in the prompt editor) hold either an http(s) URL or a base64 data URL. They are used inside JSON content blocks in the message templates — the same shapes /v1/chat/completions accepts:
Supported block shapes:
file.url is always fetched server-side into base64 (no provider accepts URL file parts). image_url URLs are fetched by the gateway for Anthropic and Google, which only accept base64, and left for OpenAI-family providers to fetch themselves. Text files (text/*, CSV, JSON) are inlined as plain text and work on every model (oversized text files are truncated). Requests whose content blocks the chosen model cannot process are rejected with a 400 — check the model catalog for image/document support.

Response

Same shape as /v1/chat/completions. Response headers include x-gatelit-request-id and x-gatelit-model.

Errors

Authorizations

Authorization
string
header
required

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.

Path Parameters

slug
string
required

The prompt slug from the dashboard.

Pattern: ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$

Query Parameters

version
string
default:published

Which version of the prompt to execute.

  • published — published version (default)
  • current — latest saved version, even if unpublished
  • <number> — a specific version number (e.g. 3)
Examples:

"published"

"current"

"3"

Body

application/json

Variables to inject into the saved prompt's template. Which variables are required depends on the prompt's definition in the dashboard.

variables
object

Key-value map of variable name → value.

metadata
object

Arbitrary tags attached to the request — see the chat completions metadata field. Stored on the log entry, stripped before forwarding.

user
string

End-user identifier — see the chat completions user field.

stream
boolean
default:false
max_tokens
integer
temperature
number
Required range: 0 <= x <= 2

Response

Same response shape as /v1/chat/completions. Headers include x-gatelit-request-id and x-gatelit-model.

OpenAI-compatible chat completion response. Returned when stream is false (default).

id
string
object
string
Example:

"chat.completion"

created
integer
model
string

The upstream model that handled the request.

choices
object[]
usage
object