Skip to main content
POST
/
v1
/
prompts
/
run
Run a prompt version through the gateway playground
curl --request POST \
  --url https://api.example.com/v1/prompts/run \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "promptId": "<string>",
  "versionId": "<string>",
  "variables": {}
}
'
{
  "output": "<string>",
  "inputTokens": 123,
  "outputTokens": 123,
  "costUsd": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
promptId
string
required

Parent prompt UUID

versionId
string
required

Version UUID to run

variables
object | null
required

Variable substitution map for {{key}} placeholders

Response

200 - application/json
output
string
required

Model output text

inputTokens
number
required

Prompt tokens consumed (excl. cache tokens)

outputTokens
number
required

Completion tokens produced

costUsd
number
required

Estimated cost in USD