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_xxxxxxxxxxxx"
)
print(monitor_response.data.name)
print(monitor_response.data.status)
curl --request GET \
--url https://api.deeprails.com/monitor/{monitor_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deeprails.com/monitor/{monitor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deeprails.com/monitor/{monitor_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deeprails.com/monitor/{monitor_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.deeprails.com/monitor/{monitor_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deeprails.com/monitor/{monitor_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"monitor_id": "mon_xxxxxxxxxxxx",
"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": "fast",
"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": [
{
"role": "user",
"content": "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_xxxxxxxxxxxx",
"file_size": 1024
}
],
"description": "A monitor used to test the DeepRails SDK"
}Monitor
Retrieve a Monitor's Details
Use this endpoint to retrieve the details and evaluations associated with a specific monitor
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_xxxxxxxxxxxx"
)
print(monitor_response.data.name)
print(monitor_response.data.status)
curl --request GET \
--url https://api.deeprails.com/monitor/{monitor_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deeprails.com/monitor/{monitor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deeprails.com/monitor/{monitor_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deeprails.com/monitor/{monitor_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.deeprails.com/monitor/{monitor_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deeprails.com/monitor/{monitor_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"monitor_id": "mon_xxxxxxxxxxxx",
"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": "fast",
"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": [
{
"role": "user",
"content": "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_xxxxxxxxxxxx",
"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
The
Use the optional
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
Query Parameters
Response
Monitor retrieved successfully
