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

# Get a Prompt

> Returns details of a specific prompt container by its unique UUID or unique slug. Optionally retrieves version or tag details if requested via query parameters.



## OpenAPI

````yaml /openapi.yaml get /v1/prompts/{id}
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/prompts/{id}:
    get:
      tags:
        - Prompts
      summary: Get a Prompt
      description: >-
        Returns details of a specific prompt container by its unique UUID or
        unique slug. Optionally retrieves version or tag details if requested
        via query parameters.
      operationId: getPrompt
      parameters:
        - name: id
          in: path
          required: true
          description: The unique UUID or unique slug of the prompt.
          schema:
            type: string
        - name: version
          in: query
          required: false
          description: >-
            Optional version sequence number (integer) or version tag (string)
            to retrieve along with the prompt details.
          schema:
            type: string
        - name: tag
          in: query
          required: false
          description: >-
            Optional version tag (string) to retrieve along with the prompt
            details.
          schema:
            type: string
      responses:
        '200':
          description: Prompt details
          content:
            application/json:
              schema:
                type: object
                properties:
                  prompt:
                    $ref: '#/components/schemas/Prompt'
                  version:
                    $ref: '#/components/schemas/PromptVersion'
                required:
                  - prompt
        '400':
          description: Invalid UUID format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: invalid prompt id
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: unauthorized
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: prompt not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: internal error
      security:
        - BearerAuth: []
components:
  schemas:
    Prompt:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier.
        team_id:
          type: string
          format: uuid
          description: Unique identifier of the team.
        slug:
          type: string
          description: Unique slug within the team.
        name:
          type: string
          description: Name of the prompt container.
        description:
          type: string
          description: Brief summary explaining the prompt purpose.
        status:
          type: string
          enum:
            - active
            - archived
          description: Current status of the prompt container (active, archived).
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - team_id
        - slug
        - name
        - description
        - status
        - created_at
        - updated_at
    PromptVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique version identifier.
        prompt_id:
          type: string
          format: uuid
          description: Reference to parent Prompt ID.
        version:
          type: integer
          description: Incrementing sequence number of the version.
        template:
          type: string
          description: The template syntax code with Go template parameters.
          example: Hello {{.name}}!
        status:
          type: string
          enum:
            - draft
            - stable
            - live
            - archived
          description: Active lifecycle status of this template version.
        created_at:
          type: string
          format: date-time
        published_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when status was set to live. Null if draft.
        tags:
          type: array
          items:
            type: string
          description: List of tag strings attached to this version.
      required:
        - id
        - prompt_id
        - version
        - template
        - status
        - created_at
        - published_at
        - tags
    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_...).

````