---
title: "Compute model-agnostic feature importance weights"
method: POST
path: "/v2/explain"
---

# Compute model-agnostic feature importance weights

`POST /v2/explain`

Compute model-agnostic feature importance weights for the provided exogenous features. It takes a JSON as an input containing the historical data with exogenous features and the attribution method to use. No foundation model is involved. The response contains one normalized weight per feature.

## Request body

- ExplainInput
  - `series` SeriesWithExogenous, required
    - `X` array[], nullable — Historic values of the exogenous features. Each feature must be a list of the same size as the target (y).
      - union[]
        - union
          - number
          - string
    - `categorical_exog` integer[], nullable — Zero-based indices of the columns in X that are categorical features.
    - `y` number[], required — Historic values of the target.
    - `sizes` integer[], required — Sizes of the individual series.
    - `start_datetime` string[], nullable — Starting timestamp of each individual series, as ISO 8601 strings (for example '2021-01-01' or '2021-01-01T09:30:00'). One entry per series, so it must have the same length as `sizes`. Together with `sizes` and `freq` this recovers the timestamps of every series.
  - `method` 'granger' | 'transfer_entropy' — Model-agnostic causal analysis method used by the /v2/explain endpoint. Options are: 'granger' (default) and 'transfer_entropy'.

## Response `200`

Successful Response

- ExplainOutput
  - `weights` number[], required
  - `feature_names` string[], nullable
  - `method` string, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-01** `015ac23a238a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/nixtla/apis/nixtla-forecast-api/changes/v2/explain/post.md)

---

[API](https://skmtc.dev/nixtla/apis/nixtla-forecast-api.md) · [All operations](https://skmtc.dev/nixtla/apis/nixtla-forecast-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nixtla/nixtla-forecast-api/revisions/015ac23a238a/schema)
