Retrieve a Monitor Event's Details
from deeprails import DeepRails
DEEPRAILS_API_KEY = "YOUR_API_KEY"
client = DeepRails(
api_key=DEEPRAILS_API_KEY,
)
event_response = client.monitor.retrieve_event(
monitor_id="mon_xxxxxxxxxxxx",
event_id="evt_xxxxxxxxxxxx",
)
print(event_response)
curl --request GET \
--url https://api.deeprails.com/monitor/{monitor_id}/events/{event_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deeprails.com/monitor/{monitor_id}/events/{event_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}/events/{event_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}/events/{event_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}/events/{event_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deeprails.com/monitor/{monitor_id}/events/{event_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{
"event_id": "evt_xxxxxxxxxxxx",
"monitor_id": "mon_xxxxxxxxxxxx",
"timestamp": "2025-01-15T10:30:00Z",
"status": "completed",
"model_input": {
"system_prompt": "You are a helpful tutor. Answer with only the final answer as a single digit (0-9).",
"user_prompt": "What is 3 + 4? Reply with only one digit.",
"context": [
{
"role": "student",
"content": "Please keep it short."
},
{
"role": "tutor",
"content": "OK. I will answer with one digit only."
},
{
"role": "student",
"content": "What is 3 + 4?"
}
]
},
"model_output": "I am good, thank you!",
"eval_time": 10.5,
"run_mode": "fast",
"nametag": "Test Event",
"evaluation_result": {
"correctness": {
"score": 1,
"rationale": "The response is correct.",
"threshold": 0.9
}
},
"guardrail_metrics": [
"correctness"
],
"capabilities": [
{
"capability": "web_search"
}
],
"files": [
{
"file_name": "example.pdf",
"file_id": "file_xxxxxxxxxxxx",
"file_size": 1024
}
]
}Monitor
Retrieve a Monitor Event's Details
Use this endpoint to retrieve the details of a specific monitor event
GET
/
monitor
/
{monitor_id}
/
events
/
{event_id}
Retrieve a Monitor Event's Details
from deeprails import DeepRails
DEEPRAILS_API_KEY = "YOUR_API_KEY"
client = DeepRails(
api_key=DEEPRAILS_API_KEY,
)
event_response = client.monitor.retrieve_event(
monitor_id="mon_xxxxxxxxxxxx",
event_id="evt_xxxxxxxxxxxx",
)
print(event_response)
curl --request GET \
--url https://api.deeprails.com/monitor/{monitor_id}/events/{event_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deeprails.com/monitor/{monitor_id}/events/{event_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}/events/{event_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}/events/{event_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}/events/{event_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deeprails.com/monitor/{monitor_id}/events/{event_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{
"event_id": "evt_xxxxxxxxxxxx",
"monitor_id": "mon_xxxxxxxxxxxx",
"timestamp": "2025-01-15T10:30:00Z",
"status": "completed",
"model_input": {
"system_prompt": "You are a helpful tutor. Answer with only the final answer as a single digit (0-9).",
"user_prompt": "What is 3 + 4? Reply with only one digit.",
"context": [
{
"role": "student",
"content": "Please keep it short."
},
{
"role": "tutor",
"content": "OK. I will answer with one digit only."
},
{
"role": "student",
"content": "What is 3 + 4?"
}
]
},
"model_output": "I am good, thank you!",
"eval_time": 10.5,
"run_mode": "fast",
"nametag": "Test Event",
"evaluation_result": {
"correctness": {
"score": 1,
"rationale": "The response is correct.",
"threshold": 0.9
}
},
"guardrail_metrics": [
"correctness"
],
"capabilities": [
{
"capability": "web_search"
}
],
"files": [
{
"file_name": "example.pdf",
"file_id": "file_xxxxxxxxxxxx",
"file_size": 1024
}
]
}Monitor events include a detailed set of data from the corresponding evaluation. Poll this endpoint for these details, plus the
When waiting on the completion of an event, you can poll this endpoint until the
status, input parameters, and timestamps.When waiting on the completion of an event, you can poll this endpoint until the
status is completed, then all the evaluation details will be available.Authorizations
Path Parameters
Response
Monitor event retrieved successfully
The model input used to create the monitor event.
Example:
{
"system_prompt": "You are a helpful tutor. Answer with only the final answer as a single digit (0-9).",
"user_prompt": "What is 3 + 4? Reply with only one digit.",
"context": [
{
"role": "student",
"content": "Please keep it short."
},
{
"role": "tutor",
"content": "OK. I will answer with one digit only."
},
{
"role": "student",
"content": "What is 3 + 4?"
}
]
}
