# agent402.tools Forecast Evaluation (Backtest)

> agent402.tools Forecast Evaluation (Backtest) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Backtests a time-series forecasting method by holding out the last N observations, generating forecasts, and returning MAPE and RMSE accuracy metrics.

## Facts

- Endpoint: POST https://agent402.tools/api/forecast-eval
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-forecast-evaluation-backtest-262eadc7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_B5n3hkc-pFNqExD1C1Sxu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-forecast-evaluation-backtest-262eadc7 -d '<json body>'
```

Example prompt: Backtest the Holt-Winters method on my sales data — here are the 120 monthly values: [23, 45, 67, ...] — hold out the last 12 observations as the test set, use an additive seasonality with period 12, and tell me the MAPE and RMSE.

## When to prefer this

Use this endpoint when you need to objectively measure how well a specific statistical forecasting method (mean, naive, drift, SES, Holt, Holt-Winters) fits a given numeric time series, using held-out test data, without building a full ML pipeline. Ideal for lightweight model selection or benchmarking before committing to a forecasting strategy.

## Known failure modes

- testSize less than 1 or greater than values.length - 2 returns a validation error
- series too short for the chosen method or seasonal period
- invalid method string returns an error
- holt-winters without sufficient seasonal cycles may fail or warn
- values array exceeding 10000 elements rejected

## How this service works

Backtest a forecasting method on the input series by holding out the last `testSize` observations, forecasting them, and computing MAPE (mean absolute percentage error) + RMSE (root mean squared error). Lets an agent pick which method (mean / naive / drift / ses / holt / holt-winters) actually fits its data before committing to a forward forecast.

## Output

Returns MAPE (mean absolute percentage error) and RMSE (root mean squared error) computed over the held-out test observations, along with possibly a warning if testSize exceeds half the series length.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "beta": {
   "type": "number",
   "description": "Trend smoothing for holt/holt-winters"
  },
  "alpha": {
   "type": "number",
   "description": "Smoothing for ses/holt/holt-winters"
  },
  "gamma": {
   "type": "number",
   "description": "Seasonal smoothing for holt-winters"
  },
  "method": {
   "type": "string",
   "description": "\"mean\", \"naive\", \"drift\", \"ses\", \"holt\", \"holt-winters\""
  },
  "period": {
   "type": "number",
   "description": "Seasonal period for holt-winters (auto-detected if omitted)"
  },
  "values": {
   "type": "array",
   "description": "Numeric series (max 10000)"
  },
  "testSize": {
   "type": "number",
   "description": "Trailing observations to hold out (1 to values.length - 2). Values above n/2 trigger a warning, not an error."
  },
  "seasonality": {
   "type": "string",
   "description": "\"additive\" or \"multiplicative\" for holt-winters"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 10,
  "mape": 1.1139,
  "rmse": 0.2722,
  "method": "drift",
  "forecast": [
   {
    "step": 1,
    "actual": 19,
    "predicted": 19.3333
   },
   {
    "step": 2,
    "actual": 21,
    "predicted": 20.6667
   },
   {
    "step": 3,
    "actual": 22,
    "predicted": 22
   }
  ],
  "testSize": 3,
  "warnings": [],
  "trainSize": 7
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-forecast-evaluation-backtest-262eadc7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
