Skip to main content

Create Baseline

POST /v1/baseline Create or update a healthy baseline for a specific machine. This computes energy statistics from the provided time series and fine-tunes a per-machine predictor (~462K params, approximately 10-15 seconds on CPU).
machine_id
string
required
Unique machine identifier within your organization.
series
array
required
Array of healthy operating data points, each with timestamp (ISO 8601) and value (number). Minimum 100 points. Do not include known anomalies.
granularity
string
default:"none"
Data frequency hint for model selection.
label
string
Human-readable label for the baseline (e.g., “Normal operating conditions, January 2024”).
machine_id
string
The machine identifier.
baseline_id
string
Baseline identifier (format: bl_ + machine_id).
created_at
string
ISO 8601 creation timestamp.
stats
object
Baseline energy statistics.
  • energy_mean (number): Mean energy during healthy operation.
  • energy_std (number): Standard deviation of healthy energy.
  • energy_p99 (number): 99th percentile of healthy energy.
  • num_windows (integer): Number of sliding windows computed.
  • series_length (integer): Length of the input series.
finetune_stats
object
Fine-tuning results.
  • status (string): completed or skipped.
  • final_loss (number): Best predictor loss achieved.
  • epochs_run (integer): Actual epochs trained.
  • epochs_max (integer): Maximum allowed epochs.
  • early_stopped (boolean): Whether early stopping triggered.
  • windows (integer): Training windows used.
  • duration_seconds (number): Fine-tuning wall time.
status
string
Baseline status (active).
curl -X POST https://api.canaryedge.com/v1/baseline \
  -H "Content-Type: application/json" \
  -H "X-Canary-Key: YOUR_API_KEY" \
  -d '{
    "machine_id": "pump-47",
    "series": [
      {"timestamp": "2024-01-01T00:00:00Z", "value": 1.0},
      {"timestamp": "2024-01-01T00:01:00Z", "value": 1.02},
      {"timestamp": "2024-01-01T00:02:00Z", "value": 0.98}
    ],
    "granularity": "minutely",
    "label": "Normal operating conditions, January 2024"
  }'
{
  "machine_id": "pump-47",
  "baseline_id": "bl_pump-47",
  "created_at": "2026-03-30T12:00:00Z",
  "stats": {
    "energy_mean": 0.023,
    "energy_std": 0.008,
    "energy_p99": 0.051,
    "num_windows": 1984,
    "series_length": 2048
  },
  "finetune_stats": {
    "status": "completed",
    "final_loss": 0.000342,
    "epochs_run": 35,
    "epochs_max": 50,
    "early_stopped": true,
    "windows": 1984,
    "duration_seconds": 12.3
  },
  "status": "active"
}

Get Baseline

GET /v1/baseline?machine_id={machine_id} Retrieve the current baseline for a machine. Returns the same response format as the create endpoint.