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

# Get prompt by package name

> Retrieve a prompt by package name and optionally substitute variables



## OpenAPI

````yaml /api-reference/openapi.json post /prompts/get
openapi: 3.1.0
info:
  title: Claro API - Bayt OS
  version: 1.0.0
  description: >-
    REST API for Claro, part of Bayt OS - The Collaborative Intelligence
    platform. Manage and deploy AI prompts programmatically.
  contact:
    name: Bayt Support
    email: support@baytos.ai
    url: https://claro.baytos.ai
servers:
  - url: https://api.baytos.ai/v1
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Prompts
    description: Prompt management and generation
paths:
  /prompts/get:
    post:
      tags:
        - Prompts
      summary: Get prompt by package name
      description: Retrieve a prompt by package name and optionally substitute variables
      operationId: getPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - package_name
              properties:
                package_name:
                  type: string
                  pattern: ^@[a-z0-9-]+/[a-z0-9-]+(?::(v\d+|latest|draft))?$
                  description: >-
                    Package name (combination of workspace, package, and
                    version)
                  example: '@workspace/customer-support:v1'
                variables:
                  type: object
                  additionalProperties:
                    type: string
                  description: Variables to substitute in the prompt
      responses:
        '200':
          description: Successfully retrieved and processed prompt
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique prompt identifier
                  title:
                    type: string
                    description: Prompt title
                  content:
                    type: string
                    description: Main prompt content (with variables substituted)
                  systemPrompt:
                    type: string
                    nullable: true
                    description: System prompt content
                  critiquePrompt:
                    type: string
                    nullable: true
                    description: Critique prompt content
                  description:
                    type: string
                    nullable: true
                    description: Prompt description
                  category:
                    type: string
                    nullable: true
                    description: Prompt category
                  tags:
                    type: array
                    items:
                      type: string
                    description: Prompt tags
                  version:
                    type: string
                    description: Version identifier
                  workspaceSlug:
                    type: string
                    description: Workspace slug
                  packageName:
                    type: string
                    description: Full package name
                  context:
                    type: array
                    description: Attached context files and URLs
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - file
                            - url
                        label:
                          type: string
                          nullable: true
                        createdAt:
                          type: number
                        url:
                          type: string
                          nullable: true
                        urlFetchedAt:
                          type: number
                          nullable: true
                        fileName:
                          type: string
                          nullable: true
                        fileSize:
                          type: number
                          nullable: true
                        mimeType:
                          type: string
                          nullable: true
                  metadata:
                    type: object
                    properties:
                      createdAt:
                        type: number
                      generatedAt:
                        type: number
              examples:
                withContext:
                  summary: Prompt with file and URL context
                  value:
                    id: pmt_abc123
                    title: Customer Support Assistant
                    content: You are a helpful customer support agent for Acme Corp...
                    systemPrompt: Be professional, courteous, and helpful
                    description: AI assistant for customer support inquiries
                    category: support
                    tags:
                      - customer-service
                      - support
                    version: v1
                    workspaceSlug: acme-corp
                    packageName: '@acme-corp/support-assistant:v1'
                    context:
                      - id: ctx_file_123
                        type: file
                        label: Product FAQ
                        fileName: product-faq.pdf
                        fileSize: 52428
                        mimeType: application/pdf
                        createdAt: 1705497600000
                      - id: ctx_url_456
                        type: url
                        label: Knowledge Base
                        url: https://example.com/kb
                        urlFetchedAt: 1705497600000
                        createdAt: 1705497000000
                    metadata:
                      createdAt: 1705400000000
                      generatedAt: 1705497600000
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Invalid API key
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Not Found
                message: ''
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from https://claro.baytos.ai

````