> ## 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.

# Batch Run Live Prompt Version

> Renders the active 'live' template version and executes it concurrently against multiple variable payloads.



## OpenAPI

````yaml /openapi.yaml post /v1/projects/{projectID}/prompts/{slug}/batch-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}/batch-run:
    post:
      tags:
        - Prompt Runs
      summary: Batch Run Live Prompt Version
      description: >-
        Renders the active 'live' template version and executes it concurrently
        against multiple variable payloads.
      operationId: batchRunLive
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchRunRequest'
      responses:
        '200':
          description: Correlated list of model completions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchRunResponse'
        '400':
          description: Missing keys or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Prompt or version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      security:
        - BearerAuth: []
components:
  schemas:
    BatchRunRequest:
      type: object
      properties:
        batch:
          type: array
          items:
            type: object
            properties:
              variables:
                type: object
                additionalProperties: true
        model:
          type: string
          nullable: true
        model_params:
          type: object
          nullable: true
          additionalProperties: true
      required:
        - batch
    BatchRunResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              response:
                type: string
              error:
                type: string
        model:
          type: string
        version:
          type: integer
        slug:
          type: string
      required:
        - results
        - 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_...).

````