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

# Monitor Single Prompt

> Monitor a prompt output



## OpenAPI

````yaml POST /monitor/log
openapi: 3.1.0
info:
  title: Basalt API
  description: Basalt API
  version: 0.2.1
servers:
  - url: https://api.getbasalt.ai
    description: Basalt Endpoint API
security:
  - bearerAuth: []
paths:
  /monitor/log:
    post:
      summary: Monitor a prompt output
      description: Monitor a prompt output
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                    - string
                    - 'null'
                  description: The name of the trace
                  example: qa-chatbot
                slug:
                  type: string
                  description: The slug of the prompt
                  example: qa
                version:
                  type:
                    - string
                    - 'null'
                  description: The version of the prompt
                  example: 1.0.0
                tag:
                  type:
                    - string
                    - 'null'
                  description: The tag of the prompt
                  example: production
                input:
                  anyOf:
                    - type: string
                    - type: object
                      additionalProperties: {}
                    - type: array
                      items: {}
                    - type: 'null'
                  description: The input of the prompt.
                  example: What is the capital of France?
                output:
                  anyOf:
                    - type: string
                    - type: object
                      additionalProperties: {}
                    - type: array
                      items: {}
                  description: The output of the prompt.
                  example: Paris
                idealOutput:
                  anyOf:
                    - type: string
                    - type: object
                      additionalProperties: {}
                    - type: array
                      items: {}
                    - type: 'null'
                  description: The ideal output of the prompt.
                  example: Paris
                variables:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                      value:
                        type:
                          - string
                          - 'null'
                    required:
                      - label
                  description: Variables used in the prompt.
                  example:
                    - label: question
                      value: What is the capital of France?
                startTime:
                  anyOf:
                    - type: string
                    - type: number
                      exclusiveMinimum: 0
                    - type: 'null'
                  description: The start time of the prompt.
                  example: '2021-01-01T00:00:00Z'
                endTime:
                  anyOf:
                    - type: string
                    - type: number
                      exclusiveMinimum: 0
                    - type: 'null'
                  description: The end time of the prompt.
                  example: '2021-01-01T00:00:00Z'
                inputTokens:
                  type:
                    - number
                    - 'null'
                  description: >-
                    The number of input tokens. If not provided, it will be
                    computed based on the input
                  example: 100
                outputTokens:
                  type:
                    - number
                    - 'null'
                  description: >-
                    The number of output tokens. If not provided, it will be
                    computed based on the output
                  example: 100
                cost:
                  type:
                    - number
                    - 'null'
                  description: >-
                    The cost of the prompt. If not provided, it will be computed
                    based on the input and output tokens
                  example: 100
                organization:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                      description: A unique identifier for the organization
                    name:
                      type: string
                      description: The name of the organization
                  required:
                    - id
                    - name
                  description: >-
                    The organization related to the prompt. Used to identify the
                    organization of the user that triggered the prompt.
                  example:
                    id: '123'
                    name: ACME
                user:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                      description: A unique identifier for the user
                    name:
                      type: string
                      description: The name of the user
                  required:
                    - id
                    - name
                  description: >-
                    The user related to the prompt. Used to identify the user
                    that triggered the prompt.
                  example:
                    id: '123'
                    name: John Doe
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties: {}
                  description: Additional metadata to be associated with the prompt.
                  example:
                    sessionId: '456'
                    userType: admin
              required:
                - slug
                - output
      responses:
        '200':
          description: The id of the created trace and log
          content:
            application/json:
              schema:
                type: object
                properties:
                  trace:
                    type: object
                    properties:
                      id:
                        type: string
                    required:
                      - id
                    description: The ID of the trace
                    example:
                      id: '123'
                  log:
                    type: object
                    properties:
                      id:
                        type: string
                    required:
                      - id
                    description: The ID of the log
                    example:
                      id: '123'
                  warning:
                    type:
                      - string
                      - 'null'
                    description: The warning message
                    example: >-
                      No prompt found with the given slug or no production
                      version found or no prompt found with the given version or
                      tag (production version also missing)
                required:
                  - trace
                  - log
        '400':
          description: Bad Request - Invalid query parameters
        '404':
          description: Not found - No prompt found for the given slug
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````