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"
)
print(monitor_response.data.monitor_id)
{
  "success": true,
  "data": {
    "name": "<string>",
    "description": "<string>",
    "monitor_id": "<string>",
    "user_id": "<string>",
    "monitor_status": "active",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  },
  "message": "<string>"
}
The request body must include a monitor name, and a description.

Once created, the monitor can be used to log and evaluate model outputs against guardrail metrics for observability over your generative AI workflows.

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.

description
string

Description of the new monitor.

Response

Monitor created successfully

Response wrapper for operations returning a MonitorResponse.

success
boolean
required

Represents whether the request was completed successfully.

data
object
message
string

The accompanying message for the request. Includes error details when applicable.

I