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

# Create a Monitor

> Use this endpoint to create a new monitor to evaluate model inputs and outputs using guardrails


Monitors are assigned to a production LLM use case and are used to evaluate model inputs and outputs against guardrail metrics for observability over your workflows. In order to make one, the request body must include a monitor `name` and a set of `guardrail_metrics` used for evaluation. Optionally, extended capabilities, like `web_search`, `file_search`, and `context_awareness`, and a `description` can be included.<br /><br />Once created, the monitor can be used to log and evaluate model outputs against guardrail metrics for LLM use in your production environment.<br /><br />When you create a monitor, you'll receive a monitor ID. Use this ID to submit new events to the Monitor for tracking usage, cost, latency, and evaluation scores.


## OpenAPI

````yaml /api-reference/openapi.yaml post /monitor
openapi: 3.0.0
info:
  title: DeepRails API
  description: >
    DeepRails is a powerful developer tool with a comprehensive set of adaptive
    & accurate guardrails to protect against LLM hallucinations - deploy our
    Monitor and Defend APIs in less than 15 minutes for the best out-of-the-box
    guardrails available.
  version: v3.0
  contact:
    name: DeepRails Support
    email: support@deeprails.ai
servers:
  - url: https://api.deeprails.com
    description: Production server
security:
  - BearerAuth: []
paths:
  /monitor:
    post:
      tags:
        - Monitor
      summary: Create a Monitor
      description: >
        Use this endpoint to create a new monitor to evaluate model inputs and
        outputs using guardrails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the new monitor.
                description:
                  type: string
                  description: Description of the new monitor.
                guardrail_metrics:
                  type: array
                  description: >
                    An array of guardrail metrics that the model input and
                    output pair will be evaluated on.  For non-enterprise users,
                    these will be limited to `correctness`, `completeness`,
                    `instruction_adherence`, `context_adherence`,
                    `ground_truth_adherence`, and/or `comprehensive_safety`.
                  items:
                    type: string
                    enum:
                      - correctness
                      - completeness
                      - instruction_adherence
                      - context_adherence
                      - ground_truth_adherence
                      - comprehensive_safety
                web_search:
                  type: boolean
                  description: >-
                    Whether to enable web search for this monitor's evaluations.
                    Defaults to false.
                  default: false
                file_search:
                  type: array
                  description: >-
                    An array of file IDs to search in the monitor's evaluations.
                    Files must be uploaded via the DeepRails API first.
                  items:
                    type: string
                    description: >-
                      A file ID corresponding to a file to search in the
                      monitor's evaluations.
                context_awareness:
                  type: boolean
                  description: >-
                    Context includes any structured information that directly
                    relates to the model’s input and expected output—e.g., the
                    recent turn-by-turn history between an AI tutor and a
                    student, facts or state passed through an agentic workflow,
                    or other domain-specific signals your system already knows
                    and wants the model to condition on. This field determines
                    whether to enable context awareness for this monitor's
                    evaluations. Defaults to false.
                  default: false
              required:
                - name
                - guardrail_metrics
      responses:
        '200':
          description: Monitor created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorCreateResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: python
          label: Create a Monitor
          source: |
            from deeprails import DeepRails

            DEEPRAILS_API_KEY = "YOUR_API_KEY"

            client = DeepRails(
                api_key=DEEPRAILS_API_KEY,
            )

            monitor_response = client.monitor.create(
                name="Test Monitor",
                description="A monitor used to test the DeepRails SDK",
                guardrail_metrics=["correctness", "completeness"],
                web_search=True,
                file_search=["file_xxxxxxxxxxxx"],
                context_awareness=True,
            )
            print(monitor_response)
components:
  schemas:
    MonitorCreateResponse:
      type: object
      properties:
        monitor_id:
          type: string
          description: A unique monitor ID.
          example: mon_xxxxxxxxxxxx
        status:
          type: string
          description: >-
            Status of the monitor.  Can be `active` or `inactive`.  Inactive
            monitors no longer record and evaluate events.
          example: active
          enum:
            - active
            - inactive
        created_at:
          type: string
          format: date-time
          description: The time the monitor was created in UTC.
          example: '2025-01-15T10:30:00Z'
      required:
        - monitor_id
        - status
        - created_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````