Forecasts and Stress Tests API
Compute forecasts, save stress-test scenarios, and read runway through the public metrics and reports contract.
Forecast and stress-test operations are public under /metrics. Runway is public under /reports. Legacy /forecast and /stress-tests paths are not part of v1.
Endpoints
| Method | Endpoint | Scope | Purpose |
|---|---|---|---|
| POST | /metrics/stress-test | metrics.write | Run and save a stress-test scenario |
| GET | /metrics/stress-test/{id} | metrics.read | Retrieve a saved stress test |
| POST | /metrics/forecast/cash-flow | metrics.write | Compute a cash-flow forecast |
| GET | /metrics/forecast/cash-flow | metrics.read | Read a cash-flow forecast |
| POST | /metrics/forecast/revenue | metrics.write | Compute a revenue forecast |
| GET | /metrics/forecast/revenue | metrics.read | Read a revenue forecast |
| GET | /reports/runway | reports.read | Estimate runway from cash and burn |
Forecast Inputs
Forecast requests need:
- from training start date
- to training end date
- horizonMonths from 1 to 60
currency is optional.
GET forecast operations use the same values as query parameters.
Stress-Test Inputs
A stress test needs:
- from
- to
- horizonMonths from 1 to 24
Optional inputs include name, currency, startingCash, and drivers.
Supported drivers:
| Driver | Required fields | Optional fields |
|---|---|---|
RevenueShock | pct, months | startOffset |
CollectionDelay | days, from 0 to 180 | — |
ExpenseSurge | pct | months, startMonthOffset |
OneTimeExpense | amount, date | — |
HiringPlan | headcountDelta, monthlyCostPerHead | startMonthOffset, rampMonths |
FxShock | pairs | mode |
pct is a percentage. Use a negative value for a revenue drop. months and rampMonths are at least 1. startOffset, startMonthOffset, amount, and monthlyCostPerHead are at least 0.
Send drivers as an array of these objects. Do not send a generic assumptions object.
Idempotent Computation
POST forecast and stress-test operations accept an optional Idempotency-Key. Use a stable key for the same date window, horizon, currency, and assumptions when you retry an unknown outcome.
Use a new key after you change any input.
Runway
GET /reports/runway needs from and to. It also accepts an optional ISO 4217 currency. It estimates the months of operation that remain from current cash and average burn over the selected period.
Runway is a modeled output. Preserve the input window and the currency with the result. Do not combine currencies without an explicit conversion policy.
Legacy Endpoint Boundary
Replace:
- POST /forecast with the correct /metrics/forecast operation
- POST /stress-tests with POST /metrics/stress-test
- GET /v1/reports/runway remains valid
There is no general scenarios collection in public v1.