Skip to main content
POST
/
monitor
/
{monitor_id}
/
events
Submit a Monitor Event
from deeprails import DeepRails

DEEPRAILS_API_KEY = "YOUR_API_KEY"

client = DeepRails(
    api_key=DEEPRAILS_API_KEY,
)

monitor_response = client.monitor.submit_event(
    monitor_id="mon_xxxxxxxxxxxx",
    model_input={
        "user_prompt": "What is the capital of France?"
    },
    model_output="Paris",
    run_mode="fast"
)
print(monitor_response)
{
  "event_id": "evt_xxxxxxxxxxxx",
  "monitor_id": "mon_xxxxxxxxxxxx",
  "created_at": "2025-01-15T10:30:00Z"
}
Monitor events represent individual LLM usages in your production use case. Whenever you receive a new LLM response, submit an event to this endpoint to have it evaluated.

The request body must include a model_input dictionary (containing at least a system_prompt field or a user_prompt field), a model_output string to be evaluated, and a guardrail_metrics array specifying which metrics to evaluate against. Optionally, include the model_used, selected run_mode, and a human-readable nametag. Including the web_search, file_search, and context_awareness fields will allow the evaluation model to use those extended AI capabilities.

Run modes determine the models that power evaluations (fastest to most thorough):
- ultra_fast - Maximum throughput evaluation
- super_fast - High-speed lightweight checks
- fast - Balanced speed and accuracy (default)
- precision - Deep multi-model analysis
- precision_codex - Code-optimized deep analysis
- precision_max - Exhaustive multi-pass verification
- precision_max_codex - Ultimate code-aware verification

Note: ultra_fast and super_fast do not support Web Search or File Search capabilities. Requests using these modes on monitors with Web Search or File Search enabled will be rejected.

When you create a monitor event, you’ll receive an event ID. Use this ID to track the event’s progress and retrieve the evaluation results.

Authorizations

Authorization
string
header
required

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

Path Parameters

monitor_id
string
required

The ID of the monitor associated with this event.

Body

application/json
model_input
object
required

A dictionary of inputs sent to the LLM to generate output. The dictionary must contain a user_prompt field. For ground_truth_adherence guardrail metric, ground_truth should be provided.

model_output
string
required

Output generated by the LLM to be evaluated.

run_mode
enum<string>

Run mode for the monitor event. The run mode allows the user to optimize for speed, accuracy, and cost by determining which models are used to evaluate the event. Available run modes (fastest to most thorough): ultra_fast, super_fast, fast, precision, precision_codex, precision_max, and precision_max_codex. Defaults to fast. Note: ultra_fast and super_fast do not support Web Search or File Search — if your monitor has these capabilities enabled, use a different run mode or edit the monitor to disable them.

Available options:
ultra_fast,
super_fast,
fast,
precision,
precision_codex,
precision_max,
precision_max_codex
nametag
string

An optional, user-defined tag for the event.

Response

Monitor event created successfully

event_id
string
required

A unique monitor event ID.

Example:

"evt_xxxxxxxxxxxx"

monitor_id
string
required

Monitor ID associated with this event.

Example:

"mon_xxxxxxxxxxxx"

created_at
string<date-time>

The time the monitor event was created in UTC.

Example:

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