---
title: "Run Live Prompt Version"
method: POST
path: "/v1/projects/{projectID}/prompts/{slug}/run"
tags: ["Prompt Runs"]
---

# Run Live Prompt Version

`POST /v1/projects/{projectID}/prompts/{slug}/run`

Renders the active 'live' template version and executes it against the configured model provider (e.g. OpenAI or Anthropic). Supports ad-hoc overrides for models and params, and unified stream mode.

## Path parameters

- `projectID` string, uuid, required
- `slug` string, required

## Request body

- RunRequest
  - `variables` object — Variables to interpolate into the template.
  - `stream` boolean — Set to true to receive token stream instead of a blocked response.
  - `model` string, nullable — 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, nullable — Ad-hoc model parameters override.

## Response `200`

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

- RunResponse
  - `response` string, required — Text content produced by the model provider completion.
  - `model` string, required — The model identifier that was executed.
  - `version` integer, required — The prompt version number that was used.
  - `slug` string, required — Prompt slug.

## Other responses

- `400` — Missing keys or invalid parameters
- `401` — Unauthorized
- `404` — Prompt or version not found
- `502` — Upstream model provider error

---

[API](https://skmtc.net/px0-ai/apis/px0-api.md) · [All operations](https://skmtc.net/px0-ai/apis/px0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/px0-ai/px0-api/revisions/3ed72443989d/schema)
