Foundational Time Series Model Online Multi Series Anomaly Detector

This endpoint performs online anomaly detection based on the provided data. It uses cross-validation for more robust detection of anomalies and it supports detection for univariate and multivariate scenarios. It takes a JSON as an input containing information like the series frequency and historical data. (See below for a full description of the parameters.) The response contains a flag indicating if the date has an anomaly, it provides the prediction interval used to define if an observation is an anomaly, and it reports the associated z-score for each point. Get your token at https://nixtla.io/free-trial?utm_source=nixtla.io&utm_campaign=/docs/api-reference.

post/v2/online_anomaly_detection

Request body

freqstring required

The frequency of the data represented as a string. 'D' for daily, 'M' for monthly, 'H' for hourly, and 'W' for weekly frequencies are available.

detection_sizeinteger required

Window over which to detect anomalies starting from the end of the series. This window is not considered when calculating the anomaly threshold to avoid bias from abnormal samples, unless there are fewer than 6 * detection_size forecasted samples.

threshold_method'univariate' | 'multivariate'

The thresholding method to detect anomalies

hinteger required

The forecasting horizon. This represents the number of time steps into the future that the forecast should predict.

modelstring

Model to use as a string. Common options are (but not restricted to) timegpt-1 and timegpt-1-long-horizon. Full options vary by different users. Contact support@nixtla.io for more information. We recommend using timegpt-1-long-horizon for forecasting if you want to predict more than one seasonal period given the frequency of your data.

clean_ex_firstboolean

A boolean flag that indicates whether the API should preprocess (clean) the exogenous signal before applying the large time model. If True, the exogenous signal is cleaned; if False, the exogenous variables are applied after the large time model.

finetune_stepsinteger

The number of tuning steps used to train the large time model on the data. Set this value to 0 for zero-shot inference, i.e., to make predictions without any further model tuning.

finetune_loss'default' | 'mae' | 'mse' | 'rmse' | 'mape' | 'smape' | 'poisson'

The loss used to train the large time model on the data. Select from ['default', 'mae', 'mse', 'rmse', 'mape', 'smape', 'poisson']. It will only be used if finetune_steps is larger than 0. Default is a robust loss function that is less sensitive to outliers.

finetune_depth1 | 2 | 3 | 4 | 5

The depth of the finetuning. Uses a scale from 1 to 5, where 1 means little finetuning, and 5 means that the entire model is finetuned. Note that this parameter is only effective for timegpt-1 and timegpt-1-long-horizon models; it has no effect on the other models. By default, the value is set to 1.

finetuned_model_idstring nullable

ID of previously finetuned model

step_sizeinteger nullable

Step size between each cross validation window. If None it will be equal to the forecasting horizon.

hist_exoginteger[] nullable

Zero-based indices of the exogenous features to treat as historical.

refitboolean

Fine-tune the model in each window. If False, only fine-tunes on the first window. Only used if finetune_steps > 0.

multivariateboolean

Compute multivariate predictions across a batch of multiple time series. Requires all time series with overlapping dates. Note that this is only effective for timegpt-2.1 model and it has no effect on the other models. By default, the value is set to False.

model_parametersobject nullable

Optional dictionary of parameters to customize the behavior of the large time model.

Response

Successful Response

input_tokensinteger required
output_tokensinteger required
finetune_tokensinteger required
meannumber[] required
sizesinteger[] required
idxsinteger[] required
anomalyboolean[] required
anomaly_scorenumber[] required
accumulated_anomaly_scorenumber[] nullable
intervalsobject nullable

Changes

Changed in 3 of the 11 revisions of this API.1111

    • added the new optional request property series/start_datetime

      new-optional-request-property

    • removed the request property feature_contributions

      request-property-removed

  • 9da3f4939623110See the full diff
    • the model request property type/format changed from / to string/

      request-property-type-changed

    • added the new optional request property feature_contributions

      new-optional-request-property

    • added the new optional request property hist_exog

      new-optional-request-property

    • added the new optional request property model_parameters

      new-optional-request-property

    • added the new optional request property multivariate

      new-optional-request-property

    • added the new optional request property refit

      new-optional-request-property

    • added the new optional request property series/X_future

      new-optional-request-property

    • added the new optional request property series/categorical_exog

      new-optional-request-property

    • request property series/X/anyOf[subschema #1]/items/items/ list-of-types was widened by adding types string to media type application/json

      request-property-list-of-types-widened

    • added the optional property detail/items/ctx to the response with the 422 status

      response-optional-property-added

    • added the optional property detail/items/input to the response with the 422 status

      response-optional-property-added

    This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog