Skip to main content
The native Canary detection endpoint extends the Azure-compatible response with regime classification, raw energy scores, and z-scores. When a machine_id with an active baseline is provided, regimes are classified relative to the baseline. Without a baseline, z-scores are computed from the series itself and regimes are set to UNKNOWN.

Regime Types

RegimeMeaning
HEALTHYOperating within baseline parameters
ACTIVEElevated activity but within expected range
TRANSITIONShifting between operational states
SHOCKSudden extreme deviation from baseline
UNKNOWNNo baseline available for comparison
series
array
required
Array of data points, each with timestamp (ISO 8601) and value (number). Minimum 12 points, maximum 8640 points. Timestamps must be sorted ascending with no duplicates.
granularity
string
default:"none"
Time interval between points. One of: yearly, monthly, weekly, daily, hourly, minutely, secondly, microsecond, none.
sensitivity
integer
default:95
Detection sensitivity (0-99). Higher values flag more anomalies.
maxAnomalyRatio
number
Maximum fraction of points that can be flagged. Must be between 0 and 0.5 (exclusive).
machine_id
string
Machine identifier for baseline comparison. If a baseline exists for this machine, regimes are classified using the baseline’s mean and standard deviation.
include_energy
boolean
default:true
Include raw energy scores in the response.
include_embeddings
boolean
default:false
Include 192-dimensional embedding vectors per point.
period
integer
Detected seasonality period (0 if none detected).
expectedValues
number[]
The model’s expected value for each point.
upperMargins
number[]
Upper bound margin for each point.
lowerMargins
number[]
Lower bound margin for each point.
isAnomaly
boolean[]
Whether each point is an anomaly.
isNegativeAnomaly
boolean[]
Whether each point is a negative anomaly.
isPositiveAnomaly
boolean[]
Whether each point is a positive anomaly.
severity
number[]
Severity score from 0.0 to 1.0 for each point.
regimes
string[]
Per-point regime classification: HEALTHY, ACTIVE, TRANSITION, SHOCK, or UNKNOWN.
energies
number[]
Raw prediction error (energy) per point.
z_scores
number[]
Normalized energy relative to baseline (or series mean if no baseline).
embeddings
number[][]
192-dimensional embedding vectors per point (null unless include_embeddings is true).
model_version
string
Model checkpoint version identifier.
engine
string
Engine identifier (e.g., canary-v1).
inference_time_ms
number
Inference wall time in milliseconds.
curl -X POST https://api.canaryedge.com/v1/detect \
  -H "Content-Type: application/json" \
  -H "X-Canary-Key: YOUR_API_KEY" \
  -d '{
    "series": [
      {"timestamp": "2024-01-01T00:00:00Z", "value": 1.0},
      {"timestamp": "2024-01-01T00:01:00Z", "value": 1.1},
      {"timestamp": "2024-01-01T00:02:00Z", "value": 0.9},
      {"timestamp": "2024-01-01T00:03:00Z", "value": 1.0},
      {"timestamp": "2024-01-01T00:04:00Z", "value": 1.2},
      {"timestamp": "2024-01-01T00:05:00Z", "value": 0.8},
      {"timestamp": "2024-01-01T00:06:00Z", "value": 1.1},
      {"timestamp": "2024-01-01T00:07:00Z", "value": 1.0},
      {"timestamp": "2024-01-01T00:08:00Z", "value": 0.9},
      {"timestamp": "2024-01-01T00:09:00Z", "value": 1.0},
      {"timestamp": "2024-01-01T00:10:00Z", "value": 5.0},
      {"timestamp": "2024-01-01T00:11:00Z", "value": 1.0}
    ],
    "granularity": "minutely",
    "sensitivity": 95,
    "machine_id": "pump-47",
    "include_energy": true,
    "include_embeddings": false
  }'
{
  "period": 0,
  "expectedValues": [1.0, 1.05, 0.95, 1.0, 1.1, 0.9, 1.05, 1.0, 0.95, 1.0, 3.0, 1.5],
  "upperMargins": [0.12, 0.13, 0.11, 0.12, 0.14, 0.10, 0.13, 0.12, 0.11, 0.12, 2.5, 0.15],
  "lowerMargins": [0.12, 0.13, 0.11, 0.12, 0.14, 0.10, 0.13, 0.12, 0.11, 0.12, 2.5, 0.15],
  "isAnomaly": [false, false, false, false, false, false, false, false, false, false, true, false],
  "isNegativeAnomaly": [false, false, false, false, false, false, false, false, false, false, false, false],
  "isPositiveAnomaly": [false, false, false, false, false, false, false, false, false, false, true, false],
  "severity": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.85, 0.0],
  "regimes": ["HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "HEALTHY", "SHOCK", "HEALTHY"],
  "energies": [0.02, 0.03, 0.02, 0.02, 0.03, 0.02, 0.03, 0.02, 0.02, 0.02, 4.5, 0.03],
  "z_scores": [0.1, 0.3, 0.1, 0.1, 0.3, 0.1, 0.3, 0.1, 0.1, 0.1, 12.5, 0.3],
  "embeddings": null,
  "model_version": "canary-v0.1",
  "engine": "canary-v1",
  "inference_time_ms": 2.3
}