Cookbook
Worked examples of common requests. Each one is a complete request body for
the beta endpoint,
POST https://api.retrocast.com/v1-beta/forecast?model=t0-alpha, using the
same request body as the Introduction — only the
fields each example needs change. The model query parameter is required on
every call. Every page ends with a "What comes back" section showing the
response.
Lengths of time — prediction_length, context, lead_time, the every of
a backtest — take either a number of steps of your data's time grid (14) or
a duration string: "28d", "2w", "1mo", "1d 12h". The units are y,
q, mo, w, d, h, m (minutes), s and us; ISO 8601 ("P2W") works
too. A duration must be a whole number of steps, so "1mo" doesn't fit daily
data. Responses always write durations in ISO 8601: P1D for a day, PT0S
for none.
- Forecast several columns at once — predict sales and returns in the same request.
- Group rows before forecasting — your data is per store, you want a forecast per city.
- Forecast weekly or monthly totals — your data is daily, you want a forecast per week.
- Backtest on past dates — re-run the forecast from several points in the past and score it.
- Send a parquet file — upload the data instead of putting rows in the request body.
- Add extra data like weather or prices — attach a second table and match it to yours by key.
Every field used here — and the ones these examples leave out, like hierarchies of covariates — is described in the API Reference. If something doesn't work the way these examples suggest, email [email protected].

