Anomaly API

The Anomaly API keeps detectors for your account. Fit a detector on reference data that represents normal operation, then score new records: each record gets a score, an alarm decision against a threshold set for a false-alarm rate you choose, and the features that deviate most. Every fit, decision, analyst label and model change is written to a receipt chain for that detector, which you can export and verify. When you label alarms as real or false, a supervised model can be trained on your labels; it replaces nothing unless it measures better on labels it has not seen.

POST /v1/anomaly/detectors

Create a detector

Creates a detector with a method, an ordered list of feature names and a threshold policy. With the method auto the method is chosen at fitting: the default for data without labels, or the supervised method when the labels include enough labelled anomalies; the model card and the model receipt record which.The creation is a receipt. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Request body (application/json)

FieldTypeDescription
name requiredstring
methodstring: "auto", "knn", "isolation_forest", "gradient_boosting"auto selects knn for data without labels and gradient_boosting when the labels include enough labelled anomalies.
features requiredarray of string
threshold_policyobject
parametersobjectMethod parameters; each method accepts only its own.

Responses

201Success.
400invalid_features: The feature names do not meet the naming rules. invalid_json: The request body is not valid JSON. invalid_limit_header: A limit header is not a whole number. invalid_method: The method is not one of the documented methods. invalid_name: The detector name must be 1 to 80 printable characters. invalid_parameters: A method parameter is unknown or out of range. invalid_request: The request does not have the documented shape. invalid_threshold_policy: The threshold policy is malformed or out of range. method_not_available: This method is not offered by the service at present.
401Missing or invalid API key.
403detector_limit_reached: The account has as many detectors as its plan allows.
413body_too_large: The request body is larger than 10 MB.
500internal_error: The service failed to handle the request.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors" \
  -H "Authorization: Bearer $QRITON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Pump 3 bearing","method":"knn","features":["temperature_c","vibration_mm_s","pressure_bar"],"threshold_policy":{"false_positive_rate":0.05,"calibration_fraction":0.5}}'

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "name": "Pump 3 bearing",
  "method": "knn",
  "requested_method": "knn",
  "features": [
    "temperature_c",
    "vibration_mm_s",
    "pressure_bar"
  ],
  "threshold_policy": {
    "false_positive_rate": 0.05,
    "calibration_fraction": 0.5
  },
  "parameters": {
    "n_neighbors": 5
  },
  "created_at": "2026-11-15T07:46:50.490Z",
  "status": "created",
  "description": "Nearest neighbours (knn): the score is the distance from the record to its k-th nearest training row in standardised units, with k = 5 by default.",
  "decisions": 0,
  "alerts": 0,
  "receipts": 1,
  "receipt_head": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
  "model": null,
  "supervised": null,
  "last_evaluation": null,
  "receipt": {
    "sequence": 0,
    "timestamp_utc": "2026-11-15T07:46:50.490Z",
    "operation": "inject",
    "previous_hash": null,
    "payload": {
      "kind": "detector",
      "fact_id": "det_d3b2ed7804c6104d",
      "requested_method": "knn",
      "method": "knn",
      "features": [
        "temperature_c",
        "vibration_mm_s",
        "pressure_bar"
      ],
      "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
      "false_positive_rate": "0.05",
      "calibration_fraction": "0.5",
      "parameters": {
        "n_neighbors": 5
      }
    },
    "receipt_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3"
  }
}

GET /v1/anomaly/detectors

List detectors

Lists the detectors of the account with their model summary.

Responses

200Success.
400invalid_limit_header: A limit header is not a whole number.
401Missing or invalid API key.
500internal_error: The service failed to handle the request.

Example request

curl -X GET "https://api.qriton.com/v1/anomaly/detectors" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "detectors": [
    {
      "detector_id": "det_d3b2ed7804c6104d",
      "name": "Pump 3 bearing",
      "method": "knn",
      "requested_method": "knn",
      "features": [
        "temperature_c",
        "vibration_mm_s",
        "pressure_bar"
      ],
      "threshold_policy": {
        "calibration_fraction": 0.5,
        "false_positive_rate": 0.05
      },
      "parameters": {
        "n_neighbors": 5
      },
      "created_at": "2026-11-15T07:46:50.490Z",
      "status": "fitted",
      "description": "Nearest neighbours (knn): the score is the distance from the record to its k-th nearest training row in standardised units, with k = 5 by default.",
      "decisions": 4,
      "alerts": 14,
      "receipts": 32,
      "receipt_head": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25",
      "model": {
        "fitted_at": "2026-11-15T07:46:50.962Z",
        "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "threshold": 2.6104302896612586,
        "threshold_rule": "split_conformal",
        "calibration_rank": 20,
        "expected_alert_rate": 0.047619047619047616,
        "reference_rows": 40,
        "training_rows": 20,
        "calibration_rows": 20,
        "calibration_alerts": 0,
        "labelled_anomalies": 0,
        "labelled_anomalies_evaluated": 0,
        "labelled_anomalies_flagged": null,
        "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
        "labels_sha256": null,
        "explanation_basis": "neighbour_difference",
        "libraries": {
          "numpy": "2.4.6",
          "python": "3.11.14",
          "scikit-learn": "1.9.1"
        }
      },
      "supervised": null,
      "last_evaluation": {
        "auroc_candidate": 0.5,
        "auroc_current": 1,
        "candidate_model_sha256": "d26b917bd0273ba00c06cd2d7784ab2b234ccab176af712dbcb17c0455731acd",
        "current_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "detection_candidate": 1,
        "detection_current": 1,
        "evaluated_at": "2026-11-15T07:46:51.076Z",
        "evaluation_id": "ev_3133ff1ae596f58a",
        "false_alerts_candidate": 0,
        "false_alerts_current": 0,
        "holdout_anomalies": 4,
        "holdout_normals": 4,
        "outcome": "refused",
        "reasons": [
          "calibration_too_small_for_split",
          "auroc_gain_below_rule"
        ],
        "receipt_sequence": 31,
        "trigger": "manual"
      }
    }
  ],
  "count": 1,
  "edge_models": 0,
  "max_detectors": 5
}

GET /v1/anomaly/detectors/{detector_id}

Get the model card

Returns the detector's settings and its model card: method, threshold and how it was set, the expected alert rate, reference, training and calibration sizes, the per-feature profile of the training rows, the hashes, the library versions and the model receipt.

Parameters

NameInTypeDescription
detector_id requiredpathstring

Responses

200Success.
400Missing or invalid API key.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
500internal_error: The service failed to handle the request.

Example request

curl -X GET "https://api.qriton.com/v1/anomaly/detectors/{detector_id}" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "name": "Pump 3 bearing",
  "method": "knn",
  "requested_method": "knn",
  "features": [
    "temperature_c",
    "vibration_mm_s",
    "pressure_bar"
  ],
  "threshold_policy": {
    "calibration_fraction": 0.5,
    "false_positive_rate": 0.05
  },
  "parameters": {
    "n_neighbors": 5
  },
  "created_at": "2026-11-15T07:46:50.490Z",
  "status": "fitted",
  "description": "Nearest neighbours (knn): the score is the distance from the record to its k-th nearest training row in standardised units, with k = 5 by default.",
  "decisions": 4,
  "alerts": 14,
  "receipts": 32,
  "receipt_head": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25",
  "model": {
    "fitted_at": "2026-11-15T07:46:50.962Z",
    "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
    "threshold": 2.6104302896612586,
    "threshold_rule": "split_conformal",
    "calibration_rank": 20,
    "expected_alert_rate": 0.047619047619047616,
    "reference_rows": 40,
    "training_rows": 20,
    "calibration_rows": 20,
    "calibration_alerts": 0,
    "labelled_anomalies": 0,
    "labelled_anomalies_evaluated": 0,
    "labelled_anomalies_flagged": null,
    "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
    "labels_sha256": null,
    "explanation_basis": "neighbour_difference",
    "libraries": {
      "numpy": "2.4.6",
      "python": "3.11.14",
      "scikit-learn": "1.9.1"
    },
    "profile": {
      "pressure_bar": {
        "max": 4.94,
        "mean": 4.580499999999999,
        "min": 4.29,
        "std": 0.14921377282275258
      },
      "temperature_c": {
        "max": 62.61,
        "mean": 60.432,
        "min": 58.72,
        "std": 1.085410521415746
      },
      "vibration_mm_s": {
        "max": 2.46,
        "mean": 2.0749999999999993,
        "min": 1.71,
        "std": 0.19474342094150446
      }
    },
    "model_receipt": {
      "operation": "edit",
      "payload": {
        "calibration_alerts": 0,
        "calibration_indexes_sha256": "c9c011b81c5248de7fd56854e3dcbdd419bc9a320bb8df0b38a71000d4591415",
        "calibration_rank": 20,
        "calibration_rows": 20,
        "calibration_scores_sha256": "219bdf2a603b05c586c6e038b22cd9f186f4c198b176f1a3d17bb1f1f348b369",
        "expected_alert_rate": "0.047619047619047616",
        "fact_id": "det_d3b2ed7804c6104d",
        "false_positive_rate": "0.05",
        "feature_count": 3,
        "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
        "kind": "model",
        "labelled_anomalies": 0,
        "labelled_anomalies_evaluated": 0,
        "labelled_anomalies_flagged": null,
        "labels_sha256": null,
        "libraries": {
          "numpy": "2.4.6",
          "python": "3.11.14",
          "scikit-learn": "1.9.1"
        },
        "method": "knn",
        "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "parameters": {
          "n_neighbors": 5
        },
        "previous_model_sha256": null,
        "reference_rows": 40,
        "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
        "requested_method": "knn",
        "split_seed": 4127530309,
        "supervised_model_dropped": null,
        "threshold": "2.6104302896612586",
        "threshold_rule": "split_conformal",
        "training_rows": 20
      },
      "previous_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
      "receipt_hash": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05",
      "sequence": 1,
      "timestamp_utc": "2026-11-15T07:46:50.962Z"
    }
  },
  "supervised": null,
  "last_evaluation": {
    "auroc_candidate": 0.5,
    "auroc_current": 1,
    "candidate_model_sha256": "d26b917bd0273ba00c06cd2d7784ab2b234ccab176af712dbcb17c0455731acd",
    "current_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
    "detection_candidate": 1,
    "detection_current": 1,
    "evaluated_at": "2026-11-15T07:46:51.076Z",
    "evaluation_id": "ev_3133ff1ae596f58a",
    "false_alerts_candidate": 0,
    "false_alerts_current": 0,
    "holdout_anomalies": 4,
    "holdout_normals": 4,
    "outcome": "refused",
    "reasons": [
      "calibration_too_small_for_split",
      "auroc_gain_below_rule"
    ],
    "receipt_sequence": 31,
    "trigger": "manual"
  }
}

DELETE /v1/anomaly/detectors/{detector_id}

Delete a detector

Deletes the detector's model and settings. The receipt chain is kept with a forget receipt and can still be read and exported.

Parameters

NameInTypeDescription
detector_id requiredpathstring

Responses

200Success.
400Missing or invalid API key.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
500internal_error: The service failed to handle the request.

Example request

curl -X DELETE "https://api.qriton.com/v1/anomaly/detectors/{detector_id}" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "deleted": true,
  "detector_id": "det_d3b2ed7804c6104d",
  "receipt": {
    "sequence": 32,
    "timestamp_utc": "2026-11-15T07:46:51.099Z",
    "operation": "forget",
    "previous_hash": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25",
    "payload": {
      "kind": "detector",
      "fact_id": "det_d3b2ed7804c6104d",
      "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "decisions": 4,
      "receipts_before": 32,
      "deleted": [
        "settings",
        "model",
        "reference",
        "decision_record_hashes",
        "feedback",
        "supervised_model"
      ]
    },
    "receipt_hash": "7c3128a95754123812ad3497217b1e9450459ab93f58585fbcf1347a1929fb23"
  },
  "receipts": 33,
  "receipt_head": "7c3128a95754123812ad3497217b1e9450459ab93f58585fbcf1347a1929fb23"
}

POST /v1/anomaly/detectors/{detector_id}/fit

Fit the detector on reference data

Fits the detector on reference records, replacing any earlier model. Rows labelled 1 are kept out of fitting and calibration for the unsupervised methods. The normal rows are split with a seed taken from the reference hash: the calibration fraction is set aside, the model is fitted on the rest, and the threshold is the calibration score of rank ceil((n + 1) x (1 - rate)). The model receipt records the reference and label hashes, the method and parameters, the library versions, the split, the threshold and how it was set, and the model hash. Hashes of data are SHA-256 over the values as IEEE 754 float64 in little-endian byte order, row after row in the order of the features; labels as one byte each; row indexes as int64 little-endian in ascending order. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Parameters

NameInTypeDescription
detector_id requiredpathstring

Request body (application/json)

FieldTypeDescription
records requiredarray of array of number or objectRows of finite numbers in the order of the detector's features, or the same values as columns keyed by feature name.
labelsarray of integer: 0, 1Optional for unsupervised methods, required for the supervised method: 0 for normal, 1 for anomaly, one per row.

Responses

200Success.
400invalid_json: The request body is not valid JSON. invalid_labels: The labels are not 0 or 1, one per row. invalid_limit_header: A limit header is not a whole number. invalid_records: The records are not rows of finite numbers matching the features. invalid_request: The request does not have the documented shape. labels_required: The supervised method needs labels.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
413body_too_large: The request body is larger than 10 MB. too_many_rows: The request has more rows than allowed.
422fit_failed: The method could not be fitted to this reference data. reference_too_small: The reference has too few rows to set a threshold at this false-positive rate.
500internal_error: The service failed to handle the request.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/fit" \
  -H "Authorization: Bearer $QRITON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"records":[[61,2.13,4.54],[61.36,2.12,4.55],[60.67,1.79,4.65],[59.93,2.12,4.58],[60.45,2.44,4.57],[59.81,1.71,4.43],[61.07,2.31,4.6],[62.61,2.13,4.53],[60.41,1.94,4.77],[60.26,2.6,4.7],[61.59,2.29,4.6],[61.43,1.8,4.7],[61.13,2.12,4.55],[59.88,2.24,4.76],[60.96,2.05,4.6],[61.83,2.27,4.69],[59.39,2.08,4.41],[60.45,2.27,4.65],[58.72,2.46,4.35],[59.45,1.93,4.29],[58.79,2.15,4.55],[60.72,1.98,4.47],[59.48,2.13,4.62],[61.33,1.8,4.94],[61.19,1.96,4.48],[60.78,2.05,4.51],[57.98,2.32,4.63],[60.35,2.39,4.67],[60.94,1.77,4.57],[61.14,1.9,4.57],[59.16,2.26,4.71],[60.43,1.6,4.68],[59.83,1.98,4.44],[60.03,2.08,4.59],[62.27,2.41,4.61],[60.03,2.27,4.44],[60.96,2.02,4.64],[62.06,2.01,4.47],[60.3,2.04,4.75],[60.87,2.48,4.63]]}'

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "name": "Pump 3 bearing",
  "method": "knn",
  "requested_method": "knn",
  "features": [
    "temperature_c",
    "vibration_mm_s",
    "pressure_bar"
  ],
  "threshold_policy": {
    "calibration_fraction": 0.5,
    "false_positive_rate": 0.05
  },
  "parameters": {
    "n_neighbors": 5
  },
  "created_at": "2026-11-15T07:46:50.490Z",
  "status": "fitted",
  "description": "Nearest neighbours (knn): the score is the distance from the record to its k-th nearest training row in standardised units, with k = 5 by default.",
  "decisions": 0,
  "alerts": 0,
  "receipts": 2,
  "receipt_head": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05",
  "model": {
    "fitted_at": "2026-11-15T07:46:50.962Z",
    "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
    "threshold": 2.6104302896612586,
    "threshold_rule": "split_conformal",
    "calibration_rank": 20,
    "expected_alert_rate": 0.047619047619047616,
    "reference_rows": 40,
    "training_rows": 20,
    "calibration_rows": 20,
    "calibration_alerts": 0,
    "labelled_anomalies": 0,
    "labelled_anomalies_evaluated": 0,
    "labelled_anomalies_flagged": null,
    "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
    "labels_sha256": null,
    "explanation_basis": "neighbour_difference",
    "libraries": {
      "python": "3.11.14",
      "numpy": "2.4.6",
      "scikit-learn": "1.9.1"
    },
    "profile": {
      "temperature_c": {
        "mean": 60.432,
        "std": 1.085410521415746,
        "min": 58.72,
        "max": 62.61
      },
      "vibration_mm_s": {
        "mean": 2.0749999999999993,
        "std": 0.19474342094150446,
        "min": 1.71,
        "max": 2.46
      },
      "pressure_bar": {
        "mean": 4.580499999999999,
        "std": 0.14921377282275258,
        "min": 4.29,
        "max": 4.94
      }
    },
    "model_receipt": {
      "sequence": 1,
      "timestamp_utc": "2026-11-15T07:46:50.962Z",
      "operation": "edit",
      "previous_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
      "payload": {
        "kind": "model",
        "fact_id": "det_d3b2ed7804c6104d",
        "requested_method": "knn",
        "method": "knn",
        "parameters": {
          "n_neighbors": 5
        },
        "libraries": {
          "python": "3.11.14",
          "numpy": "2.4.6",
          "scikit-learn": "1.9.1"
        },
        "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
        "reference_rows": 40,
        "feature_count": 3,
        "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
        "labels_sha256": null,
        "labelled_anomalies": 0,
        "labelled_anomalies_evaluated": 0,
        "labelled_anomalies_flagged": null,
        "split_seed": 4127530309,
        "training_rows": 20,
        "calibration_rows": 20,
        "calibration_indexes_sha256": "c9c011b81c5248de7fd56854e3dcbdd419bc9a320bb8df0b38a71000d4591415",
        "calibration_scores_sha256": "219bdf2a603b05c586c6e038b22cd9f186f4c198b176f1a3d17bb1f1f348b369",
        "false_positive_rate": "0.05",
        "threshold_rule": "split_conformal",
        "calibration_rank": 20,
        "threshold": "2.6104302896612586",
        "expected_alert_rate": "0.047619047619047616",
        "calibration_alerts": 0,
        "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "previous_model_sha256": null,
        "supervised_model_dropped": null
      },
      "receipt_hash": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05"
    }
  },
  "supervised": null,
  "last_evaluation": null,
  "receipt": {
    "sequence": 1,
    "timestamp_utc": "2026-11-15T07:46:50.962Z",
    "operation": "edit",
    "previous_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
    "payload": {
      "kind": "model",
      "fact_id": "det_d3b2ed7804c6104d",
      "requested_method": "knn",
      "method": "knn",
      "parameters": {
        "n_neighbors": 5
      },
      "libraries": {
        "python": "3.11.14",
        "numpy": "2.4.6",
        "scikit-learn": "1.9.1"
      },
      "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
      "reference_rows": 40,
      "feature_count": 3,
      "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
      "labels_sha256": null,
      "labelled_anomalies": 0,
      "labelled_anomalies_evaluated": 0,
      "labelled_anomalies_flagged": null,
      "split_seed": 4127530309,
      "training_rows": 20,
      "calibration_rows": 20,
      "calibration_indexes_sha256": "c9c011b81c5248de7fd56854e3dcbdd419bc9a320bb8df0b38a71000d4591415",
      "calibration_scores_sha256": "219bdf2a603b05c586c6e038b22cd9f186f4c198b176f1a3d17bb1f1f348b369",
      "false_positive_rate": "0.05",
      "threshold_rule": "split_conformal",
      "calibration_rank": 20,
      "threshold": "2.6104302896612586",
      "expected_alert_rate": "0.047619047619047616",
      "calibration_alerts": 0,
      "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "previous_model_sha256": null,
      "supervised_model_dropped": null
    },
    "receipt_hash": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05"
  }
}

POST /v1/anomaly/detectors/{detector_id}/score

Score records

Scores a batch of records. Each result gives the score, the threshold, whether the record raises an alert, and the features with the largest share in the explanation (top_features, 3 by default). The decision receipt records the hashes of the input, the model and the scores, the number of alerts and the indexes of the records that raised one. Scores are returned unrounded, so their hash can be recomputed from the response. Hashes of data are SHA-256 over the values as IEEE 754 float64 in little-endian byte order, row after row in the order of the features; labels as one byte each; row indexes as int64 little-endian in ascending order. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Parameters

NameInTypeDescription
detector_id requiredpathstring
top_featuresqueryintegerHow many features to list per record.

Request body (application/json)

FieldTypeDescription
records requiredarray of array of number or objectRows of finite numbers in the order of the detector's features, or the same values as columns keyed by feature name.

Responses

200Success.
400invalid_json: The request body is not valid JSON. invalid_limit_header: A limit header is not a whole number. invalid_records: The records are not rows of finite numbers matching the features. invalid_request: The request does not have the documented shape.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
409not_fitted: The detector has not been fitted yet.
413body_too_large: The request body is larger than 10 MB. too_many_rows: The request has more rows than allowed.
500internal_error: The service failed to handle the request. model_integrity_failed: The stored model does not match its recorded hash, so it was not used.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/score" \
  -H "Authorization: Bearer $QRITON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"records":[[61.11,1.6,4.28],[60.29,1.82,4.73],[60.86,2.19,4.34],[69.41,1.89,4.72]]}'

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "decision_id": "dec_619d4e7bb35056d7",
  "method": "knn",
  "threshold": 2.6104302896612586,
  "rows": 4,
  "alerts": 2,
  "alerted_indexes": [
    0,
    3
  ],
  "results": [
    {
      "index": 0,
      "record_sha256": "017148f77781dc402cef05e6db9e80f5bc91cbb26d75d7765518ca2e51cf8a57",
      "score": 2.611490586095217,
      "threshold": 2.6104302896612586,
      "alert": true,
      "raised_by": [
        "primary"
      ],
      "top_features": [
        {
          "feature": "vibration_mm_s",
          "value": 1.6,
          "reference_mean": 2.075,
          "deviation": -2.43911,
          "share": 0.649928
        },
        {
          "feature": "pressure_bar",
          "value": 4.28,
          "reference_mean": 4.5805,
          "deviation": -2.01389,
          "share": 0.237746
        },
        {
          "feature": "temperature_c",
          "value": 61.11,
          "reference_mean": 60.432,
          "deviation": 0.624648,
          "share": 0.112327
        }
      ]
    },
    {
      "index": 1,
      "record_sha256": "5e716bb9f08aaf87ec28fd907aa49f4f623b1b083aa28595785db557863fa845",
      "score": 1.6492908892933702,
      "threshold": 2.6104302896612586,
      "alert": false,
      "raised_by": [],
      "top_features": [
        {
          "feature": "vibration_mm_s",
          "value": 1.82,
          "reference_mean": 2.075,
          "deviation": -1.30942,
          "share": 0.65528
        },
        {
          "feature": "pressure_bar",
          "value": 4.73,
          "reference_mean": 4.5805,
          "deviation": 1.00192,
          "share": 0.323626
        },
        {
          "feature": "temperature_c",
          "value": 60.29,
          "reference_mean": 60.432,
          "deviation": -0.130826,
          "share": 0.0210943
        }
      ]
    },
    {
      "index": 2,
      "record_sha256": "dc75cce23f4cd3819c6cece8748cb7ccdd97c7f0aca90a3271fd89e73935d5d5",
      "score": 1.8575224473151897,
      "threshold": 2.6104302896612586,
      "alert": false,
      "raised_by": [],
      "top_features": [
        {
          "feature": "pressure_bar",
          "value": 4.34,
          "reference_mean": 4.5805,
          "deviation": -1.61178,
          "share": 0.749785
        },
        {
          "feature": "temperature_c",
          "value": 60.86,
          "reference_mean": 60.432,
          "deviation": 0.394321,
          "share": 0.21277
        },
        {
          "feature": "vibration_mm_s",
          "value": 2.19,
          "reference_mean": 2.075,
          "deviation": 0.590521,
          "share": 0.0374457
        }
      ]
    },
    {
      "index": 3,
      "record_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
      "score": 7.602851736031334,
      "threshold": 2.6104302896612586,
      "alert": true,
      "raised_by": [
        "primary"
      ],
      "top_features": [
        {
          "feature": "temperature_c",
          "value": 69.41,
          "reference_mean": 60.432,
          "deviation": 8.27152,
          "share": 0.958698
        },
        {
          "feature": "pressure_bar",
          "value": 4.72,
          "reference_mean": 4.5805,
          "deviation": 0.9349,
          "share": 0.0376075
        },
        {
          "feature": "vibration_mm_s",
          "value": 1.89,
          "reference_mean": 2.075,
          "deviation": -0.949968,
          "share": 0.00369493
        }
      ]
    }
  ],
  "explanation": {
    "basis": "neighbour_difference",
    "text": "Each feature's share is its part of the squared distance, in standardised units, from the record to the training row whose distance is the score (the k-th nearest)."
  },
  "receipt": {
    "sequence": 2,
    "timestamp_utc": "2026-11-15T07:46:50.964Z",
    "operation": "inject",
    "previous_hash": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05",
    "payload": {
      "kind": "decision",
      "fact_id": "dec_619d4e7bb35056d7",
      "detector_id": "det_d3b2ed7804c6104d",
      "purpose": "score",
      "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "input_sha256": "d986e6413d3c389cb9b29732c0f7a56ffa97de7e32f6735b6666ffe363f11b0c",
      "rows": 4,
      "record_hashes_sha256": "e09c507c27664518de601ffb30ebe7fb514e0b4460de469570a9e2f460275151",
      "scores_sha256": "7dc91fa0f773aef9dd1ca8c8cdfef4b4e624d13c73c06a68af26c741d641294f",
      "threshold": "2.6104302896612586",
      "alerts": 2,
      "alerted_indexes": [
        0,
        3
      ],
      "supervised_model_sha256": null,
      "supervised_scores_sha256": null,
      "supervised_threshold": null,
      "raised_by_primary": null,
      "raised_by_supervised": null
    },
    "receipt_hash": "b2853a7d0e5dae5d9df165c5bf664139f159b246dedc635df559cee98ad2b3a9"
  },
  "receipts": 3,
  "receipt_head": "b2853a7d0e5dae5d9df165c5bf664139f159b246dedc635df559cee98ad2b3a9"
}

POST /v1/anomaly/detectors/{detector_id}/explain

Explain records

Scores up to 100 records and lists every feature with its value, the reference mean and standard deviation, the deviation and its share in the explanation. It appends a decision receipt like scoring. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Parameters

NameInTypeDescription
detector_id requiredpathstring

Request body (application/json)

FieldTypeDescription
records requiredarray of array of number or objectRows of finite numbers in the order of the detector's features, or the same values as columns keyed by feature name.

Responses

200Success.
400invalid_json: The request body is not valid JSON. invalid_limit_header: A limit header is not a whole number. invalid_records: The records are not rows of finite numbers matching the features. invalid_request: The request does not have the documented shape.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
409not_fitted: The detector has not been fitted yet.
413body_too_large: The request body is larger than 10 MB. too_many_rows: The request has more rows than allowed.
500internal_error: The service failed to handle the request. model_integrity_failed: The stored model does not match its recorded hash, so it was not used.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/explain" \
  -H "Authorization: Bearer $QRITON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"records":[[69.41,1.89,4.72]]}'

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "decision_id": "dec_1eaa361b35ccf0e1",
  "method": "knn",
  "threshold": 2.6104302896612586,
  "rows": 1,
  "alerts": 1,
  "alerted_indexes": [
    0
  ],
  "results": [
    {
      "index": 0,
      "record_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
      "score": 7.602851736031334,
      "threshold": 2.6104302896612586,
      "alert": true,
      "raised_by": [
        "primary"
      ],
      "features": [
        {
          "feature": "temperature_c",
          "value": 69.41,
          "reference_mean": 60.432,
          "deviation": 8.27152,
          "share": 0.958698,
          "reference_std": 1.08541
        },
        {
          "feature": "pressure_bar",
          "value": 4.72,
          "reference_mean": 4.5805,
          "deviation": 0.9349,
          "share": 0.0376075,
          "reference_std": 0.149214
        },
        {
          "feature": "vibration_mm_s",
          "value": 1.89,
          "reference_mean": 2.075,
          "deviation": -0.949968,
          "share": 0.00369493,
          "reference_std": 0.194743
        }
      ]
    }
  ],
  "explanation": {
    "basis": "neighbour_difference",
    "text": "Each feature's share is its part of the squared distance, in standardised units, from the record to the training row whose distance is the score (the k-th nearest)."
  },
  "receipt": {
    "sequence": 3,
    "timestamp_utc": "2026-11-15T07:46:50.967Z",
    "operation": "inject",
    "previous_hash": "b2853a7d0e5dae5d9df165c5bf664139f159b246dedc635df559cee98ad2b3a9",
    "payload": {
      "kind": "decision",
      "fact_id": "dec_1eaa361b35ccf0e1",
      "detector_id": "det_d3b2ed7804c6104d",
      "purpose": "explain",
      "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "input_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
      "rows": 1,
      "record_hashes_sha256": "8dc5ec5bef3547efbf7458c4124a008d0e5e954ab901121fdcdc4fc3c33f7e8e",
      "scores_sha256": "2eb84e7130590fa5e4057d2982b7bde7d0f9289b4c0ada0ce86985009d44f242",
      "threshold": "2.6104302896612586",
      "alerts": 1,
      "alerted_indexes": [
        0
      ],
      "supervised_model_sha256": null,
      "supervised_scores_sha256": null,
      "supervised_threshold": null,
      "raised_by_primary": null,
      "raised_by_supervised": null
    },
    "receipt_hash": "ba2639b8e7ba61ec982901e88903b5d626b9e8f746d588930dd788d9a0866cc6"
  },
  "receipts": 4,
  "receipt_head": "ba2639b8e7ba61ec982901e88903b5d626b9e8f746d588930dd788d9a0866cc6"
}

POST /v1/anomaly/detectors/{detector_id}/feedback

Label a scored record

Records an analyst's label, anomaly or normal, for one record of a scoring or explain decision. Identify the record by decision_id and index or record_sha256, and send its values: they must match the hash recorded when it was scored, and they are kept for retraining. A later label for the same record replaces the earlier one. The label is a receipt holding the record hash, the decision, the label and hashes of the reviewer and the note. When the labels reach the automatic trigger, an evaluation runs and its result is included. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Parameters

NameInTypeDescription
detector_id requiredpathstring

Request body (application/json)

FieldTypeDescription
decision_id requiredstring
indexintegerPosition of the record in the scored batch; or give record_sha256.
record_sha256string
record requiredarray of numberThe record's values in the order of the features. They must match the record that was scored; they are kept for retraining.
label requiredstring: "anomaly", "normal"
reviewerstringOptional opaque reviewer reference chosen by you. Receipts hold its hash only.
notestringOptional; receipts hold its hash only.

Responses

200Success.
400invalid_feedback: A feedback field is malformed. invalid_json: The request body is not valid JSON. invalid_records: The records are not rows of finite numbers matching the features. invalid_request: The request does not have the documented shape.
401Missing or invalid API key.
403feedback_limit_reached: The detector holds as many labels as allowed.
404decision_not_found: No decision with this id is kept for this detector. detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account. record_not_in_decision: The decision holds no record with this index or hash.
413body_too_large: The request body is larger than 10 MB.
422record_mismatch: The record values do not match the record that was scored at this position.
500internal_error: The service failed to handle the request.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/feedback" \
  -H "Authorization: Bearer $QRITON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision_id":"dec_619d4e7bb35056d7","index":3,"record":[69.41,1.89,4.72],"label":"anomaly","reviewer":"shift-lead-2","note":"Bearing temperature confirmed on site."}'

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "feedback": {
    "feedback_id": "fb_de7d0eefbbee9d7b",
    "decision_id": "dec_619d4e7bb35056d7",
    "record_index": 3,
    "record_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
    "label": "anomaly",
    "alert_at_decision": true,
    "raised_by": [
      "primary"
    ],
    "reviewer": "shift-lead-2",
    "note": "Bearing temperature confirmed on site.",
    "created_at": "2026-11-15T07:46:50.969Z",
    "receipt_sequence": 4
  },
  "summary": {
    "labelled_records": 1,
    "anomalies": 1,
    "normals": 0,
    "confirmed_anomalies": 1,
    "missed_anomalies": 0,
    "dismissed_alerts": 0,
    "labelled_normals": 0
  },
  "evaluation": null,
  "receipt": {
    "sequence": 4,
    "timestamp_utc": "2026-11-15T07:46:50.969Z",
    "operation": "inject",
    "previous_hash": "ba2639b8e7ba61ec982901e88903b5d626b9e8f746d588930dd788d9a0866cc6",
    "payload": {
      "kind": "feedback",
      "fact_id": "fb_de7d0eefbbee9d7b",
      "decision_id": "dec_619d4e7bb35056d7",
      "decision_sequence": 2,
      "record_index": 3,
      "record_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
      "label": "anomaly",
      "alert_at_decision": true,
      "raised_by": [
        "primary"
      ],
      "reviewer_sha256": "0fd8630a92738d8d9c63d01fc2c4e1735871a5da59ec6fd6233c074aba77c6ca",
      "note_sha256": "8b2d00c2c49b8bd0f21f07121815da5a475da6fe298ee98b1640120366ced08c",
      "supersedes": null
    },
    "receipt_hash": "62c1fd53352e2adb3b1cd70604748bc772426fa6fe0cd96ae9b70860412d203b"
  },
  "receipts": 5,
  "receipt_head": "62c1fd53352e2adb3b1cd70604748bc772426fa6fe0cd96ae9b70860412d203b"
}

GET /v1/anomaly/detectors/{detector_id}/feedback

Feedback summary

Counts of confirmed anomalies, missed anomalies, dismissed alerts and labelled normals over the latest label of each record, the labels in order (without record values), the retraining settings and the last evaluation.

Parameters

NameInTypeDescription
detector_id requiredpathstring
limitqueryinteger
offsetqueryinteger

Responses

200Success.
400invalid_request: The request does not have the documented shape.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
500internal_error: The service failed to handle the request.

Example request

curl -X GET "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/feedback" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "summary": {
    "labelled_records": 25,
    "anomalies": 13,
    "normals": 12,
    "confirmed_anomalies": 12,
    "missed_anomalies": 1,
    "dismissed_alerts": 0,
    "labelled_normals": 12
  },
  "labels_received": 25,
  "items": [
    {
      "alert_at_decision": true,
      "created_at": "2026-11-15T07:46:50.969Z",
      "decision_id": "dec_619d4e7bb35056d7",
      "feedback_id": "fb_de7d0eefbbee9d7b",
      "label": "anomaly",
      "note": "Bearing temperature confirmed on site.",
      "raised_by": [
        "primary"
      ],
      "receipt_sequence": 4,
      "record_index": 3,
      "record_sha256": "0168cb2d719acd7e7d3800916090e31a126917cd677e8e27d72ff93ccb536b43",
      "reviewer": "shift-lead-2"
    },
    {
      "alert_at_decision": true,
      "created_at": "2026-11-15T07:46:50.972Z",
      "decision_id": "dec_62a25023764512e0",
      "feedback_id": "fb_5c78c199ada42ada",
      "label": "anomaly",
      "note": null,
      "raised_by": [
        "primary"
      ],
      "receipt_sequence": 6,
      "record_index": 0,
      "record_sha256": "ba1ac5cfb038909dfb53a3b4e11c0f50a5787fa68dc528af610818c1eab5f905",
      "reviewer": null
    }
  ],
  "offset": 0,
  "limit": 2,
  "retraining": {
    "minimum_anomalies": 10,
    "minimum_normals": 10,
    "automatic": true,
    "automatic_after_anomalies": 50,
    "automatic_after_normals": 200,
    "holdout_fraction": 0.3,
    "rule": {
      "min_auroc_gain": 0.01,
      "detection_must_not_drop": true,
      "text": "Promote only if the area under the ROC curve on the held-out labelled records improves by at least 0.01 and the share of held-out labelled anomalies that raise an alert does not drop."
    }
  },
  "supervised": null,
  "last_evaluation": null
}

POST /v1/anomaly/detectors/{detector_id}/retrain

Train and evaluate a supervised model from the labels

Trains a gradient boosting model on the reference rows and part of the labelled records. For the two models side by side, the candidate's threshold and the primary model's threshold are each set for half the requested false-positive rate on the primary model's calibration rows, so the combined expected alert rate on normal data stays at most the requested rate. The candidate is evaluated it on the held-out labelled records against the current model. It is promoted only if it meets the rule in the service settings (by default: the area under the ROC curve improves by at least 0.01 and the share of held-out labelled anomalies that raise an alert does not drop); otherwise the current models stay. A promoted model runs alongside the primary model, which keeps running. Every evaluation is a receipt with the measured numbers and both model hashes. The example data are illustrative readings of a pump (temperature, vibration and pressure).

Parameters

NameInTypeDescription
detector_id requiredpathstring

Responses

200Success.
400invalid_json: The request body is not valid JSON. invalid_request: The request does not have the documented shape. method_not_available: This method is not offered by the service at present.
401Missing or invalid API key.
404detector_deleted: This detector was deleted; its receipt chain is kept. detector_not_found: No detector with this id exists for this account.
409not_fitted: The detector has not been fitted yet.
422fit_failed: The method could not be fitted to this reference data. not_enough_feedback: There are too few labelled records to train and evaluate.
500internal_error: The service failed to handle the request. model_integrity_failed: The stored model does not match its recorded hash, so it was not used.

Example request

curl -X POST "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/retrain" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "evaluation": {
    "evaluation_id": "ev_3133ff1ae596f58a",
    "evaluated_at": "2026-11-15T07:46:51.076Z",
    "trigger": "manual",
    "outcome": "refused",
    "reasons": [
      "calibration_too_small_for_split",
      "auroc_gain_below_rule"
    ],
    "auroc_current": 1,
    "auroc_candidate": 0.5,
    "detection_current": 1,
    "detection_candidate": 1,
    "false_alerts_current": 0,
    "false_alerts_candidate": 0,
    "holdout_anomalies": 4,
    "holdout_normals": 4,
    "candidate_model_sha256": "d26b917bd0273ba00c06cd2d7784ab2b234ccab176af712dbcb17c0455731acd",
    "current_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
    "receipt_sequence": 31,
    "receipt": {
      "sequence": 31,
      "timestamp_utc": "2026-11-15T07:46:51.076Z",
      "operation": "inject",
      "previous_hash": "08517dbea876a2d12c056842e33dcf1c48587073c66bc9689dbf43726e364ad4",
      "payload": {
        "kind": "evaluation",
        "fact_id": "ev_3133ff1ae596f58a",
        "trigger": "manual",
        "outcome": "refused",
        "reasons": [
          "calibration_too_small_for_split",
          "auroc_gain_below_rule"
        ],
        "rule": {
          "min_auroc_gain": "0.01",
          "detection_must_not_drop": true,
          "holdout_fraction": "0.3"
        },
        "candidate_method": "gradient_boosting",
        "candidate_parameters": {
          "max_iter": 300
        },
        "candidate_model_sha256": "d26b917bd0273ba00c06cd2d7784ab2b234ccab176af712dbcb17c0455731acd",
        "current_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "current_model_role": "primary",
        "primary_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "libraries": {
          "python": "3.11.14",
          "numpy": "2.4.6",
          "scikit-learn": "1.9.1"
        },
        "feedback_set_sha256": "a54f05cb761394eb638ff23e85041f2ab7888ab479d9f8fd8ab4dc0e622685ac",
        "split_seed": 2773419467,
        "labelled_anomalies": 13,
        "labelled_normals": 12,
        "holdout_anomalies": 4,
        "holdout_normals": 4,
        "holdout_indexes_sha256": "f17c9478f115c89a8ed351b80e6e679f545bc8573fd663058564da8437ada192",
        "training_rows": 37,
        "reference_rows_used": 20,
        "auroc_current": "1.0",
        "auroc_candidate": "0.5",
        "detection_current": "1.0",
        "detection_candidate": "1.0",
        "false_alerts_current": 0,
        "false_alerts_candidate": 0,
        "false_positive_rate": "0.05",
        "rate_split": {
          "requested": "0.05",
          "primary": "0.025",
          "supervised": "0.025"
        },
        "calibration_rows": 20,
        "calibration_rows_needed_for_split": 39,
        "split_calibration_rank": 20,
        "candidate_threshold": "0.25806451612903225",
        "primary_threshold_alongside": "2.6104302896612586",
        "primary_threshold_alone": "2.6104302896612586",
        "expected_alert_rate_each": "0.047619047619047616",
        "calibration_alerts_combined": 0
      },
      "receipt_hash": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25"
    }
  },
  "supervised": null,
  "receipt": {
    "sequence": 31,
    "timestamp_utc": "2026-11-15T07:46:51.076Z",
    "operation": "inject",
    "previous_hash": "08517dbea876a2d12c056842e33dcf1c48587073c66bc9689dbf43726e364ad4",
    "payload": {
      "kind": "evaluation",
      "fact_id": "ev_3133ff1ae596f58a",
      "trigger": "manual",
      "outcome": "refused",
      "reasons": [
        "calibration_too_small_for_split",
        "auroc_gain_below_rule"
      ],
      "rule": {
        "min_auroc_gain": "0.01",
        "detection_must_not_drop": true,
        "holdout_fraction": "0.3"
      },
      "candidate_method": "gradient_boosting",
      "candidate_parameters": {
        "max_iter": 300
      },
      "candidate_model_sha256": "d26b917bd0273ba00c06cd2d7784ab2b234ccab176af712dbcb17c0455731acd",
      "current_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "current_model_role": "primary",
      "primary_model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
      "libraries": {
        "python": "3.11.14",
        "numpy": "2.4.6",
        "scikit-learn": "1.9.1"
      },
      "feedback_set_sha256": "a54f05cb761394eb638ff23e85041f2ab7888ab479d9f8fd8ab4dc0e622685ac",
      "split_seed": 2773419467,
      "labelled_anomalies": 13,
      "labelled_normals": 12,
      "holdout_anomalies": 4,
      "holdout_normals": 4,
      "holdout_indexes_sha256": "f17c9478f115c89a8ed351b80e6e679f545bc8573fd663058564da8437ada192",
      "training_rows": 37,
      "reference_rows_used": 20,
      "auroc_current": "1.0",
      "auroc_candidate": "0.5",
      "detection_current": "1.0",
      "detection_candidate": "1.0",
      "false_alerts_current": 0,
      "false_alerts_candidate": 0,
      "false_positive_rate": "0.05",
      "rate_split": {
        "requested": "0.05",
        "primary": "0.025",
        "supervised": "0.025"
      },
      "calibration_rows": 20,
      "calibration_rows_needed_for_split": 39,
      "split_calibration_rank": 20,
      "candidate_threshold": "0.25806451612903225",
      "primary_threshold_alongside": "2.6104302896612586",
      "primary_threshold_alone": "2.6104302896612586",
      "expected_alert_rate_each": "0.047619047619047616",
      "calibration_alerts_combined": 0
    },
    "receipt_hash": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25"
  },
  "receipts": 32,
  "receipt_head": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25"
}

GET /v1/anomaly/detectors/{detector_id}/receipts

Read the receipt chain

Returns receipts in order with the current head. The chain of a deleted detector stays readable.

Parameters

NameInTypeDescription
detector_id requiredpathstring
limitqueryinteger
offsetqueryinteger

Responses

200Success.
400invalid_request: The request does not have the documented shape.
401Missing or invalid API key.
404detector_not_found: No detector with this id exists for this account.
500internal_error: The service failed to handle the request.

Example request

curl -X GET "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/receipts" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

{
  "detector_id": "det_d3b2ed7804c6104d",
  "status": "active",
  "receipts": [
    {
      "operation": "inject",
      "payload": {
        "calibration_fraction": "0.5",
        "fact_id": "det_d3b2ed7804c6104d",
        "false_positive_rate": "0.05",
        "features": [
          "temperature_c",
          "vibration_mm_s",
          "pressure_bar"
        ],
        "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
        "kind": "detector",
        "method": "knn",
        "parameters": {
          "n_neighbors": 5
        },
        "requested_method": "knn"
      },
      "previous_hash": null,
      "receipt_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
      "sequence": 0,
      "timestamp_utc": "2026-11-15T07:46:50.490Z"
    },
    {
      "operation": "edit",
      "payload": {
        "calibration_alerts": 0,
        "calibration_indexes_sha256": "c9c011b81c5248de7fd56854e3dcbdd419bc9a320bb8df0b38a71000d4591415",
        "calibration_rank": 20,
        "calibration_rows": 20,
        "calibration_scores_sha256": "219bdf2a603b05c586c6e038b22cd9f186f4c198b176f1a3d17bb1f1f348b369",
        "expected_alert_rate": "0.047619047619047616",
        "fact_id": "det_d3b2ed7804c6104d",
        "false_positive_rate": "0.05",
        "feature_count": 3,
        "features_sha256": "b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9",
        "kind": "model",
        "labelled_anomalies": 0,
        "labelled_anomalies_evaluated": 0,
        "labelled_anomalies_flagged": null,
        "labels_sha256": null,
        "libraries": {
          "numpy": "2.4.6",
          "python": "3.11.14",
          "scikit-learn": "1.9.1"
        },
        "method": "knn",
        "model_sha256": "3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74",
        "parameters": {
          "n_neighbors": 5
        },
        "previous_model_sha256": null,
        "reference_rows": 40,
        "reference_sha256": "f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5",
        "requested_method": "knn",
        "split_seed": 4127530309,
        "supervised_model_dropped": null,
        "threshold": "2.6104302896612586",
        "threshold_rule": "split_conformal",
        "training_rows": 20
      },
      "previous_hash": "8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3",
      "receipt_hash": "fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05",
      "sequence": 1,
      "timestamp_utc": "2026-11-15T07:46:50.962Z"
    }
  ],
  "count": 32,
  "offset": 0,
  "limit": 2,
  "head": "2c0eaaa3bc8ec6a8dc7c19e2ee51114ebc65c3e867add593db18d6b5fb163d25"
}

GET /v1/anomaly/detectors/{detector_id}/receipts/export

Export the receipt chain

Returns the whole chain as JSON Lines, one receipt per line, which the published verifiers of the receipt-chain format check unchanged. The X-Receipt-Head header carries the head.

Parameters

NameInTypeDescription
detector_id requiredpathstring

Responses

200Success.
400Missing or invalid API key.
401Missing or invalid API key.
404detector_not_found: No detector with this id exists for this account.
500internal_error: The service failed to handle the request.

Example request

curl -X GET "https://api.qriton.com/v1/anomaly/detectors/{detector_id}/receipts/export" \
  -H "Authorization: Bearer $QRITON_API_KEY"

Example response

"{\"operation\":\"inject\",\"payload\":{\"calibration_fraction\":\"0.5\",\"fact_id\":\"det_d3b2ed7804c6104d\",\"false_positive_rate\":\"0.05\",\"features\":[\"temperature_c\",\"vibration_mm_s\",\"pressure_bar\"],\"features_sha256\":\"b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9\",\"kind\":\"detector\",\"method\":\"knn\",\"parameters\":{\"n_neighbors\":5},\"requested_method\":\"knn\"},\"previous_hash\":null,\"receipt_hash\":\"8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3\",\"sequence\":0,\"timestamp_utc\":\"2026-11-15T07:46:50.490Z\"}\n{\"operation\":\"edit\",\"payload\":{\"calibration_alerts\":0,\"calibration_indexes_sha256\":\"c9c011b81c5248de7fd56854e3dcbdd419bc9a320bb8df0b38a71000d4591415\",\"calibration_rank\":20,\"calibration_rows\":20,\"calibration_scores_sha256\":\"219bdf2a603b05c586c6e038b22cd9f186f4c198b176f1a3d17bb1f1f348b369\",\"expected_alert_rate\":\"0.047619047619047616\",\"fact_id\":\"det_d3b2ed7804c6104d\",\"false_positive_rate\":\"0.05\",\"feature_count\":3,\"features_sha256\":\"b0933837e6234f73272a86a3e94a86a578351b557b61bffd17eea1fc5a7b1ae9\",\"kind\":\"model\",\"labelled_anomalies\":0,\"labelled_anomalies_evaluated\":0,\"labelled_anomalies_flagged\":null,\"labels_sha256\":null,\"libraries\":{\"numpy\":\"2.4.6\",\"python\":\"3.11.14\",\"scikit-learn\":\"1.9.1\"},\"method\":\"knn\",\"model_sha256\":\"3ce2abb7c2213abc5e3f753c5de9df61a97abb23b02dd6491fa1bbcea9300b74\",\"parameters\":{\"n_neighbors\":5},\"previous_model_sha256\":null,\"reference_rows\":40,\"reference_sha256\":\"f6051d45d037a35957730a17f84463c4d442eb87acabd0b07e924e2f6eddd7d5\",\"requested_method\":\"knn\",\"split_seed\":4127530309,\"supervised_model_dropped\":null,\"threshold\":\"2.6104302896612586\",\"threshold_rule\":\"split_conformal\",\"training_rows\":20},\"previous_hash\":\"8836dde97e885a73dda2b8bf13a04bf1b7d7a3a510f4bd353f944b913b258cb3\",\"receipt_hash\":\"fdd96262387b150bb294059bfc5cc75a81b30b3aba7b6cea6fac104b5b78be05\",\"sequence\":1,\"timestamp_utc\":\"2026-11-15T07:46:50.962Z\"}\n"

Scope and limits

  • What the threshold means. When a detector is fitted, a share of the normal reference rows (the calibration fraction, 20 percent by default) is set aside and not used to fit the model. The threshold is the calibration score of rank ceil((n + 1) x (1 - r)) among the n calibration rows, where r is the requested false-positive rate, and a record raises an alert when its score is above the threshold. If new normal records come from the same distribution as the reference, the expected share of them that raise an alert is at most r, and the model card states the exact expected share. This is a statement about data like the reference, not a guarantee for any particular batch: the share in a batch varies around the expected value, and it changes when the data change.
  • The reference must be normal data. The unsupervised methods learn what normal data look like from the reference. Anomalies left in the reference make similar records look normal and raise the threshold. For these methods, rows labelled as anomalies are kept out of fitting and calibration and are used only to report how many of them the detector flags. The reference must cover every operating condition that counts as normal; conditions it does not cover raise alerts.
  • Scores are not probabilities. A score orders records from usual to unusual for one detector. It is not a probability, its scale depends on the method and the data, and scores of different detectors cannot be compared. The output of the supervised method lies between 0 and 1 but is not calibrated as a probability either.
  • Explanations are feature deviations, not causes. Each result lists the features with the largest share in an explanation, with the value, the reference mean and the deviation in standard deviations of the normal training rows. For the nearest-neighbour method the share is the feature's part of the squared distance from the record to the training row whose distance is the score. For the other methods it is the feature's part of the record's total deviation from the reference, which describes the record but not how the method weighed the features. An explanation does not identify the cause of an anomaly, and features that are unusual only in combination can have small deviations.
  • Drift changes the error rates. The false-positive rate and the share of real anomalies that are flagged hold only while new data resemble the reference. When the process, the sensors or the population change, both rates change, often without a visible signal. Compare the alert rate with the expected rate on the model card regularly, and refit the detector on recent normal data when they diverge or the conditions change.
  • The share of anomalies found is not known in advance. The threshold controls false alarms on normal data only. How many real anomalies are flagged depends on how different they are from normal data and is not estimated by the service unless labelled anomalies are supplied at fitting; even then the count applies to those anomalies only. Validate each detector on known cases from your own data before relying on it.
  • Methods. The methods offered at present are knn, isolation_forest, gradient_boosting. For data without labels, auto selects knn, the default. When the labels given at fitting include at least two labelled anomalies in the training part, auto selects gradient_boosting, which is available only when labelled anomalies are provided. The model card and the model receipt state which method was used. Nearest neighbours (knn): the score is the distance from the record to its k-th nearest training row in standardised units, with k = 5 by default. Isolation forest: the score is the negated mean path length that random splits need to isolate the record. Gradient boosting: a classifier trained on labelled normal and anomalous rows; the score is its output for the anomalous class. Each method runs with fixed standard settings unless a parameter is given. No method suits all data; validate the detector on known cases from your own data. A supervised method finds mainly anomalies of the kinds it was trained on.
  • Records. Each record is a fixed list of finite numbers, one per feature, in the order given when the detector was created. Missing values, text and categories are not accepted; encode them as numbers first. Records are scored independently, so patterns that appear only across consecutive records are not detected.
  • Size limits. A request may hold up to 100,000 rows, or fewer if the plan sets a lower limit, and its body may not exceed 10 MB. A detector has at most 200 features and an explain request at most 100 rows. An account may hold up to 100 detectors, or fewer if the plan sets a lower limit. Fitting needs enough normal rows that the calibration part has at least about 1 / r rows: about 100 for a rate of 0.01 and 1,000 for 0.001. A detector holds up to 100,000 feedback labels. The requests of one account are handled one at a time.
  • What the receipts prove. Creating, fitting, scoring, explaining, labelling, evaluating and deleting each append one SHA-256 receipt to the detector's chain in the published receipt-chain format. A model receipt records hashes of the reference data and labels, the method, its parameters, the library versions, how the reference was split, the threshold and how it was set, and the hash of the stored model; a decision receipt records hashes of the input, the model and the scores, and the indexes of the records that raised an alert; a feedback receipt records the record hash, the decision it refers to and the label; an evaluation receipt records the measured numbers, the rule, the outcome and the hashes of both models. Receipts hold hashes, counts and settings, not record values. The receipts prove the integrity and the order of what was recorded. They do not prove that a decision was correct, and the chain is not signed.
  • The receipt head must be held by a second party. Anyone who holds a chain can rewrite it and recompute every hash, and the result still checks. Only a head (the hash of the last receipt) kept by someone else, for example an auditor or your own system, detects that. Every response that appends a receipt returns the new head; store it outside this service.
  • Models, data and deletion. Each detector's data are kept for its account only and are never used for another account. The service keeps the settings, the reference rows given at fitting (needed to train a supervised model from feedback), the fitted models, the hashes of the records of the most recent 1,000 scoring and explain requests (not their values), and the records sent with feedback labels. Deleting a detector deletes all of these; its receipt chain is kept with a deletion receipt and can still be read and exported. Score records in batches: each request adds one receipt.
  • What feedback labels do and do not do. A label refers to one scored record, identified by its decision and position or hash, and the record's values must be sent with it; the service checks them against the hash it recorded when the record was scored. Labels improve detection only for anomalies that resemble labelled ones. Mislabelled feedback degrades a model trained on it. A later label for the same record replaces the earlier one.
  • Training and promoting a supervised model. Retraining trains a gradient boosting model on the reference rows and part of the labelled records and evaluates it on the other 30 percent of the labelled records, held out per class, against the current model. It is promoted only if the area under the ROC curve on the held-out records improves by at least 0.01 and the share of held-out labelled anomalies that raise an alert does not drop; otherwise the current models stay unchanged. The measured result applies to your held-out labels only, which are few and may not represent future anomalies. The current supervised model may have been trained on some of the held-out records, which favours keeping it. An evaluation needs at least 10 labelled anomalies and 10 labelled normals. It runs on request and, when the labels reach 50 anomalies and 200 normals, automatically, and again after every further 50 labelled records.
  • Two models side by side. After a promotion the primary model keeps running, so anomalies of kinds that were never labelled can still raise an alert. A record raises an alert when either model is above its own threshold, and the result shows which. While the two models run side by side, each threshold is set for half the requested false-positive rate on the same calibration rows, so the expected share of normal records that raise an alert from either model stays at most the requested rate. The primary model therefore raises somewhat fewer alerts on its own than before the promotion. When the calibration part is too small for half the rate, the candidate is not promoted. Refitting the detector removes the supervised model and returns the primary threshold to the full rate.
  • Reproducibility. The split of the reference into training and calibration rows is drawn with a seed taken from the hash of the reference, so fitting the same reference with the same settings and service version gives the same threshold and the same model hash. The hashes in the receipts are SHA-256 over the values as IEEE 754 double-precision numbers in little-endian byte order, row after row, so you can recompute them from your own copy of the data.