Skip to main content
POST
/
api
/
v1
/
prompts
/
{slug}
/
{version}
/
runs
Create and trigger a prompt run
curl --request POST \
  --url https://promptjuggler.com/api/v1/api/v1/prompts/{slug}/{version}/runs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "inputs": {
    "topic": "AI safety"
  },
  "thread": null,
  "priority": "normal",
  "environment": null,
  "envVars": {
    "MY_API_KEY": "sk-..."
  },
  "metadata": {
    "user_id": "42"
  },
  "channel": "default"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "thread": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

slug
string
required

Prompt Handle

version
required

Specific version or tag or id

Body

application/json

Request payload for creating a prompt run.

inputs
object
required

Key-value map of input variable names to their values.

Example:
{ "topic": "AI safety" }
thread
string<uuid> | null

Thread ID to continue a multi-turn conversation. Omit to start a new thread.

priority
enum<string>
default:normal

Processing priority.

Available options:
onsite,
normal,
low
environment
string | null

Environment that scopes which webhooks fire and which environment variables the run can access. Uses the default environment when omitted.

envVars
object

Runtime environment variable overrides for this run. Keys must be UPPER_CASE. At most 50 entries, 64 KB total.

Example:
{ "MY_API_KEY": "sk-..." }
metadata
object

Arbitrary key-value metadata attached to the run. Values can be strings or arrays of strings.

Example:
{ "user_id": "42" }
channel
string
default:default

Memory channel within the thread. Prompts on the same channel share conversational history; different channels are isolated.

Response

Prompt run created

id
string<uuid>
required

Prompt run ID

thread
string<uuid>
required

Thread ID for multi-turn runs