Skip to main content
POST
https://api.rotavision.com
/
guardian
/
monitors
curl -X POST https://api.rotavision.com/v1/guardian/monitors \
  -H "Authorization: Bearer rv_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "recommendation-v3",
    "name": "Production Recommendations",
    "description": "Monitoring for product recommendation model",
    "metrics": ["prediction_drift", "data_drift", "latency_p99", "error_rate"],
    "baseline": {
      "window": "30d"
    },
    "alerts": [
      {
        "metric": "prediction_drift",
        "threshold": 0.1,
        "severity": "warning"
      },
      {
        "metric": "prediction_drift",
        "threshold": 0.2,
        "severity": "critical"
      },
      {
        "metric": "latency_p99",
        "threshold": 500,
        "severity": "warning"
      },
      {
        "metric": "error_rate",
        "threshold": 0.01,
        "severity": "critical"
      }
    ],
    "notifications": {
      "email": ["[email protected]"],
      "slack_webhook": "https://hooks.slack.com/services/..."
    }
  }'
{
  "id": "mon_abc123",
  "model_id": "recommendation-v3",
  "name": "Production Recommendations",
  "description": "Monitoring for product recommendation model",
  "status": "active",
  "metrics": ["prediction_drift", "data_drift", "latency_p99", "error_rate"],
  "baseline": {
    "type": "rolling_window",
    "window": "30d",
    "status": "collecting"
  },
  "alerts": [
    {
      "id": "alert_cfg_1",
      "metric": "prediction_drift",
      "threshold": 0.1,
      "operator": "gt",
      "severity": "warning",
      "window": "1h"
    },
    {
      "id": "alert_cfg_2",
      "metric": "prediction_drift",
      "threshold": 0.2,
      "operator": "gt",
      "severity": "critical",
      "window": "1h"
    }
  ],
  "notifications": {
    "email": ["[email protected]"],
    "slack_webhook": "https://hooks.slack.com/services/..."
  },
  "schedule": {
    "evaluation_interval": "1h"
  },
  "created_at": "2026-02-01T10:00:00Z"
}

Request

model_id
string
required
Unique identifier for the model to monitor.
name
string
required
Human-readable name for the monitor.
description
string
Description of what this monitor tracks.
metrics
array
required
Metrics to track:
  • prediction_drift - Output distribution drift (PSI)
  • data_drift - Input feature drift
  • accuracy - Accuracy vs ground truth (requires labels)
  • latency_p50 - 50th percentile latency
  • latency_p95 - 95th percentile latency
  • latency_p99 - 99th percentile latency
  • error_rate - Percentage of failed predictions
  • throughput - Requests per second
baseline
object
Baseline data for drift comparison.
alerts
array
Alert configurations.
notifications
object
Notification channels.
schedule
object
Monitoring schedule.
curl -X POST https://api.rotavision.com/v1/guardian/monitors \
  -H "Authorization: Bearer rv_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "recommendation-v3",
    "name": "Production Recommendations",
    "description": "Monitoring for product recommendation model",
    "metrics": ["prediction_drift", "data_drift", "latency_p99", "error_rate"],
    "baseline": {
      "window": "30d"
    },
    "alerts": [
      {
        "metric": "prediction_drift",
        "threshold": 0.1,
        "severity": "warning"
      },
      {
        "metric": "prediction_drift",
        "threshold": 0.2,
        "severity": "critical"
      },
      {
        "metric": "latency_p99",
        "threshold": 500,
        "severity": "warning"
      },
      {
        "metric": "error_rate",
        "threshold": 0.01,
        "severity": "critical"
      }
    ],
    "notifications": {
      "email": ["[email protected]"],
      "slack_webhook": "https://hooks.slack.com/services/..."
    }
  }'
{
  "id": "mon_abc123",
  "model_id": "recommendation-v3",
  "name": "Production Recommendations",
  "description": "Monitoring for product recommendation model",
  "status": "active",
  "metrics": ["prediction_drift", "data_drift", "latency_p99", "error_rate"],
  "baseline": {
    "type": "rolling_window",
    "window": "30d",
    "status": "collecting"
  },
  "alerts": [
    {
      "id": "alert_cfg_1",
      "metric": "prediction_drift",
      "threshold": 0.1,
      "operator": "gt",
      "severity": "warning",
      "window": "1h"
    },
    {
      "id": "alert_cfg_2",
      "metric": "prediction_drift",
      "threshold": 0.2,
      "operator": "gt",
      "severity": "critical",
      "window": "1h"
    }
  ],
  "notifications": {
    "email": ["[email protected]"],
    "slack_webhook": "https://hooks.slack.com/services/..."
  },
  "schedule": {
    "evaluation_interval": "1h"
  },
  "created_at": "2026-02-01T10:00:00Z"
}