> ## Documentation Index
> Fetch the complete documentation index at: https://docs.px0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Specific Prompt Version

> Renders a specific template version of a prompt and executes it against the configured model provider.



## OpenAPI

````yaml /openapi.yaml post /v1/projects/{projectID}/prompts/{slug}/versions/{version}/run
openapi: 3.1.0
info:
  title: px0 API
  description: >
    px[0] is an open-source prompt infrastructure toolkit for managing prompts
    in production. It replaces hardcoded prompt strings with versioned
    templates, in-process caching, and OpenTelemetry observability, so teams can
    iterate on prompts without touching application code. This is the OpenAPI
    specification for all the public APIs of px0.
  version: 1.0.0
servers:
  - url: http://localhost:3000
    description: Local development server
security: []
paths:
  /v1/projects/{projectID}/prompts/{slug}/versions/{version}/run:
    post:
      tags:
        - Prompt Runs
      summary: Run Specific Prompt Version
      description: >-
        Renders a specific template version of a prompt and executes it against
        the configured model provider.
      operationId: runVersion
      parameters:
        - name: projectID
          in: path
          required: true
          description: The ID of the project the prompt belongs to.
          schema:
            type: string
            format: uuid
        - name: slug
          in: path
          required: true
          description: Prompt slug, unique within the project.
          schema:
            type: string
        - name: version
          in: path
          required: true
          description: >-
            Version sequence number (integer) or version tag (string) to
            execute.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
      responses:
        '200':
          description: >-
            Completed response text or stream chunks (Streaming SSE events where
            each line is formatted as data: {"delta": string, "done": boolean}).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
            text/event-stream:
              schema:
                type: string
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '502':
          description: Provider failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      security:
        - BearerAuth: []
components:
  schemas:
    RunRequest:
      type: object
      properties:
        variables:
          type: object
          additionalProperties: true
          description: Variables to interpolate into the template.
        stream:
          type: boolean
          description: Set to true to receive token stream instead of a blocked response.
          default: false
        model:
          type: string
          nullable: true
          description: >-
            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:
          type: object
          nullable: true
          additionalProperties: true
          description: Ad-hoc model parameters override.
    RunResponse:
      type: object
      properties:
        response:
          type: string
          description: Text content produced by the model provider completion.
          example: Greetings from the model!
        model:
          type: string
          description: The model identifier that was executed.
          example: openai/gpt-4o
        version:
          type: integer
          description: The prompt version number that was used.
          example: 2
        slug:
          type: string
          description: Prompt slug.
          example: my-prompt
      required:
        - response
        - model
        - version
        - slug
    APIError:
      type: object
      properties:
        error:
          type: string
          example: invalid credentials
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an access token retrieved from login (Bearer sess_...) or a
        programmatic API key (Bearer ak_...).

````