Skip to main content
POST
/
v1
/
projects
/
{projectID}
/
prompts
/
{slug}
/
run
Run Live Prompt Version
curl --request POST \
  --url http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "variables": {},
  "stream": false,
  "model": "<string>",
  "model_params": {}
}
'
import requests

url = "http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run"

payload = {
    "variables": {},
    "stream": False,
    "model": "<string>",
    "model_params": {}
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({variables: {}, stream: false, model: '<string>', model_params: {}})
};

fetch('http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_PORT => "3000",
  CURLOPT_URL => "http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'variables' => [
        
    ],
    'stream' => false,
    'model' => '<string>',
    'model_params' => [
        
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run"

	payload := strings.NewReader("{\n  \"variables\": {},\n  \"stream\": false,\n  \"model\": \"<string>\",\n  \"model_params\": {}\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"variables\": {},\n  \"stream\": false,\n  \"model\": \"<string>\",\n  \"model_params\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:3000/v1/projects/{projectID}/prompts/{slug}/run")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"variables\": {},\n  \"stream\": false,\n  \"model\": \"<string>\",\n  \"model_params\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "response": "Greetings from the model!",
  "model": "openai/gpt-4o",
  "version": 2,
  "slug": "my-prompt"
}
{
  "error": "invalid credentials"
}
{
  "error": "invalid credentials"
}
{
  "error": "invalid credentials"
}
{
  "error": "invalid credentials"
}

Authorizations

Authorization
string
header
required

Use an access token retrieved from login (Bearer sess_...) or a programmatic API key (Bearer ak_...).

Path Parameters

projectID
string<uuid>
required

The ID of the project the prompt belongs to.

slug
string
required

Prompt slug, unique within the project.

Body

application/json
variables
object

Variables to interpolate into the template.

stream
boolean
default:false

Set to true to receive token stream instead of a blocked response.

model
string | null

Ad-hoc model override. Must start with a supported provider prefix: 'openai/', 'anthropic/', 'gemini/', 'deepseek/', 'groq/', or 'openrouter/'. All providers except 'anthropic/' follow standard OpenAI-compatible JSON request, response, and SSE streaming conventions.

model_params
object | null

Ad-hoc model parameters override.

Response

Completed response text (non-streaming) or stream chunk headers (streaming). Streaming SSE events where each line is formatted as data: {"delta": string, "done": boolean}.

response
string
required

Text content produced by the model provider completion.

Example:

"Greetings from the model!"

model
string
required

The model identifier that was executed.

Example:

"openai/gpt-4o"

version
integer
required

The prompt version number that was used.

Example:

2

slug
string
required

Prompt slug.

Example:

"my-prompt"