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

# List Prompts

> Get all prompts for the authenticated user

## Request

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key: `Bearer tr_your_api_key`
</ParamField>

## Response

<ResponseField name="prompts" type="array">
  Array of prompt objects

  <Expandable title="Prompt object">
    <ResponseField name="id" type="string">
      Unique identifier for the prompt
    </ResponseField>

    <ResponseField name="slug" type="string">
      URL-friendly identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name of the prompt
    </ResponseField>

    <ResponseField name="description" type="string | null">
      Description of the prompt
    </ResponseField>

    <ResponseField name="provider" type="string | null">
      Model provider: `OPENAI`, `ANTHROPIC`, `GOOGLE`, or `AMAZON_BEDROCK`
    </ResponseField>

    <ResponseField name="model" type="string | null">
      Default model for this prompt
    </ResponseField>

    <ResponseField name="temperature" type="number | null">
      Temperature setting for the model (0-2)
    </ResponseField>

    <ResponseField name="topP" type="number | null">
      Top-p (nucleus) sampling setting (0-1)
    </ResponseField>

    <ResponseField name="maxOutputTokens" type="number | null">
      Maximum output tokens limit
    </ResponseField>

    <ResponseField name="currentVersion" type="number">
      Current version number
    </ResponseField>

    <ResponseField name="variables" type="string[]">
      List of template variables used in the prompt
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://app.tracia.io/api/v1/prompts \
    -H "Authorization: Bearer tr_your_api_key"
  ```

  ```typescript SDK theme={null}
  const { prompts } = await tracia.prompts.list();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "prompts": [
      {
        "id": "clx1abc123",
        "slug": "welcome-email",
        "name": "Welcome Email",
        "description": "A welcome email template",
        "provider": "OPENAI",
        "model": "gpt-4",
        "temperature": 0.7,
        "topP": null,
        "maxOutputTokens": null,
        "currentVersion": 3,
        "variables": ["name", "product"],
        "createdAt": "2024-01-15T10:30:00.000Z",
        "updatedAt": "2024-01-20T14:22:00.000Z"
      },
      {
        "id": "clx2def456",
        "slug": "support-reply",
        "name": "Support Reply",
        "description": null,
        "provider": "OPENAI",
        "model": "gpt-3.5-turbo",
        "temperature": null,
        "topP": null,
        "maxOutputTokens": null,
        "currentVersion": 1,
        "variables": ["customerName", "issue"],
        "createdAt": "2024-01-18T09:15:00.000Z",
        "updatedAt": "2024-01-18T09:15:00.000Z"
      }
    ]
  }
  ```

  ```json 401 theme={null}
  {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /prompts
openapi: 3.1.0
info:
  title: Tracia API
  description: REST API for managing and running AI prompts with tracing
  version: 1.0.0
servers:
  - url: https://app.tracia.io/api/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /prompts:
    get:
      tags:
        - Prompts
      summary: List Prompts
      description: Get all prompts for the authenticated user
      operationId: listPrompts
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  prompts:
                    type: array
                    items:
                      $ref: '#/components/schemas/PromptSummary'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PromptSummary:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        provider:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        temperature:
          type: number
          nullable: true
        topP:
          type: number
          nullable: true
        maxOutputTokens:
          type: integer
          nullable: true
        currentVersion:
          type: integer
        variables:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code
            message:
              type: string
              description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `tr_`

````