Skip to main content
POST
/
monitor
Create a Monitor
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_xxxxxxxx"],
    context_awareness=True,
)
print(monitor_response)
{
  "monitor_id": "mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "status": "active",
  "created_at": "2025-01-15T10:30:00Z"
}
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.

Once created, the monitor can be used to log and evaluate model outputs against guardrail metrics for LLM use in your production environment.

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.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name of the new monitor.

guardrail_metrics
enum<string>[]
required

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.

Available options:
correctness,
completeness,
instruction_adherence,
context_adherence,
ground_truth_adherence,
comprehensive_safety
description
string

Description of the new monitor.

Whether to enable web search for this monitor's evaluations. Defaults to false.

An array of file IDs to search in the monitor's evaluations. Files must be uploaded via the DeepRails API first.

A file ID corresponding to a file to search in the monitor's evaluations.

context_awareness
boolean
default:false

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.

Response

Monitor created successfully

monitor_id
string
required

A unique monitor ID.

Example:

"mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

status
enum<string>
required

Status of the monitor. Can be active or inactive. Inactive monitors no longer record and evaluate events.

Available options:
active,
inactive
Example:

"active"

created_at
string<date-time>
required

The time the monitor was created in UTC.

Example:

"2025-01-15T10:30:00Z"