Create an API Key
- In your organization’s DeepRails API Console, go to API Keys.
- Click Create key, name it, then copy the key.
- (Optional) Save it as the
DEEPRAILS_API_KEYenvironment variable.

Create and manage API keys in the API Console.
Install the SDK
- Python
- TypeScript / Node
- Ruby
- Go
Create a Monitor
Before you can send events, you need to create a monitor. A monitor is a container for tracking production events and their evaluations. In this example, the evaluations in the monitor will leverage a file as context, which will need to be uploaded first.Tip: You can also create a monitor via the DeepRails API Console.
- Python
- TypeScript / Node
- Ruby
- Go
Required Parameters
| Field | Type | Description |
|---|---|---|
name | string | The human-readable name of the monitor |
guardrail_metrics | string[] | A list of one or more metrics that events associated with this monitor will be evaluated on |
Optional Parameters
| Field | Type | Description |
|---|---|---|
description | string | A description of the monitor and/or the associated production use case |
web_search | bool | Whether or not web search is added as an extended capability for this monitor’s evaluations. Defaults to false |
file_search | string[] | A list of file IDs to be used for file search in this monitor’s evaluations. If nothing is passed, file search will not be used |
Send Your First Monitor Event
Use the SDK to log a production event (input + output). The SDK automatically triggers an evaluation of the guardrail metrics assigned to the monitor and links the result to the event. Retrieve the details of the event until it gives acompleted status; then, you can view the outcome of the evaluation.
- Python
- TypeScript / Node
- Ruby
- Go
Required Parameters
| Field | Type | Description |
|---|---|---|
monitor_id | string | The ID of the monitor to receive the event (find it in Console → Monitor → Manage Monitors). |
model_input | object | Must include at least system_prompt or user_prompt. |
model_output | string | The LLM output to be evaluated and recorded with the event. |
Optional Parameters
| Field | Type | Description |
|---|---|---|
run_mode | string | Run mode for the workflow event that determines which models are used to evaluate the event. Available run modes include precision_plus, precision, smart, and economy. Defaults to smart. |
Retrieve Monitor Data
You can retrieve a monitor’s details via API including a list of recent events and stats on associated evaluation progress.- Python
- TypeScript / Node
- Ruby
- Go
Check Monitor Analytics via the API Console
- Open DeepRails API Console → Monitor → Data.
- Filter by model, time range, or search by
monitor_idto find events. - Open any event to see the linked evaluation scores and rationales.

Browse real-time monitor events, filters, and linked evaluation details.
