Skip to main content
GET
/
monitor
/
{monitor_id}
Retrieve a monitor
from deeprails import DeepRails

DEEPRAILS_API_KEY = "YOUR_API_KEY"

client = DeepRails(
    api_key=DEEPRAILS_API_KEY,
)

monitor_response = client.monitor.retrieve(
    monitor_id="mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
print(monitor_response.data.name)
print(monitor_response.data.status)
{
  "monitor_id": "mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "name": "Test Monitor",
  "status": "active",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z",
  "stats": {
    "total_evaluations": 1,
    "completed_evaluations": 0,
    "failed_evaluations": 0,
    "queued_evaluations": 0,
    "in_progress_evaluations": 1
  },
  "evaluations": [
    {
      "evaluation_status": "in_progress",
      "run_mode": "smart",
      "model_input": {
        "user_prompt": "Hello, how are you?",
        "system_prompt": "You are a helpful assistant.",
        "ground_truth": "The user prefers that you refer to them as 'the user' instead of 'you'.",
        "context": [
          "User: 'Can you help me update my code from 5 years ago to use modern C++ practices?'"
        ]
      },
      "model_output": "I am good, thank you!",
      "guardrail_metrics": [
        "correctness"
      ],
      "nametag": "Test Evaluation",
      "progress": 50,
      "error_message": null,
      "evaluation_result": null,
      "evaluation_total_cost": null,
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "capabilities": [
    {
      "capability": "web_search"
    }
  ],
  "files": [
    {
      "file_name": "example.pdf",
      "file_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "file_size": 1024
    }
  ],
  "description": "A monitor used to test the DeepRails SDK"
}
Monitors track all the data from each of the events submitted to them. This endpoint returns comprehensive information for the monitor including recent event history and observability stats, plus configuration details like name, description, and its status.

The stats object in the response has counts of the evaluations in each status and an evaluations array containing all evaluation records.

Use the optional limit query parameter to control the number of returned evaluations (defaults to 10).

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 to retrieve.

Query Parameters

limit
integer
default:10

Limit the number of returned evaluations associated with this monitor. Defaults to 10.

Response

Monitor retrieved successfully

monitor_id
string
required

A unique monitor ID.

Example:

"mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

name
string
required

Name of this monitor.

Example:

"Test Monitor"

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"

updated_at
string<date-time>
required

The most recent time the monitor was modified in UTC.

Example:

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

stats
object
required

Contains five fields used for stats of this monitor: total evaluations, completed evaluations, failed evaluations, queued evaluations, and in progress evaluations.

evaluations
object[]
required

An array of all evaluations performed by this monitor. Each one corresponds to a separate monitor event.

capabilities
object[]
required

An array of extended AI capabilities associated with this monitor. Can be web_search, file_search, and/or context_awareness.

files
object[]
required

An array of files associated with this monitor.

description
string

Description of this monitor.

Example:

"A monitor used to test the DeepRails SDK"