---
title: "Backtest the baseline forecast against historical actuals"
method: POST
path: "/api/forecast-sandbox/consumption/backtest"
tags: ["Forecast Sandbox"]
---

# Backtest the baseline forecast against historical actuals

`POST /api/forecast-sandbox/consumption/backtest`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/forecast-sandbox/consumption/backtest`
- Auth: none declared

Trains the weekday-profile baseline on [trainFrom, trainTo] and evaluates it against actualValues in [testFrom, testTo]. Returns MAE/RMSE/MAPE/bias (via the same calculateForecastQuality helper used by /api/forecast/quality), an absolute-error-only aeRiskProxy, and a readiness verdict. No cost/€ guarantee.

## Query parameters

- `token` string

## Request body

- object
  - `seriesId` string
  - `granularity` string
  - `timezone` string
  - `unit` string
  - `trainFrom` string
  - `trainTo` string
  - `testFrom` string
  - `testTo` string
  - `historicalValues` string
  - `actualValues` string
  - `options` string
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Backtest computed (see `metrics` and `readiness`).

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
