Generate multi-step time-series forecasts with SAP-RPT-TS. Unlike /api/predict, which fills [PREDICT] cells in tabular data, the forecast endpoint takes one or more numeric series and projects them forward over a fixed horizon.
Availability: This endpoint is gated behind a server feature flag. When it is disabled, the endpoint responds with
404as though it did not exist. See API Overview for authentication details and all available endpoints.
Base URL: https://rpt.cloud.sap
Authentication is the same across all endpoints — pass your personal API token in the Authorization header:
Authorization: Bearer YOUR_TOKEN
Obtain and manage tokens in Settings.
{
"horizon": 3,
"data": [
{
"timestamp": ["2024-01-01", "2024-02-01", "2024-03-01", "2024-04-01"],
"target": [120, 135, 128, 142],
"past_covariates": { "temperature": [15, 18, 17, 21] },
"future_covariates": { "temperature": [22, 24, 23] }
}
],
"options": {
"confidence_interval": 0.9,
"cross_learning": true
}
}
horizon (required, integer > 0): Number of future steps to forecast. Capped at 90 — larger values are silently truncated.data (required): Non-empty array of series objects. Each series is forecast independently (unless cross_learning is enabled).
target (required): The historical values to forecast from. Either a flat array for a single target ([120, 135, 128]), or an array of arrays for multiple targets sharing the same timeline ([[120, 135], [40, 44]]). null marks a missing observation. When multiple target arrays are given, all must have the same length. Series longer than 8,192 points are silently truncated to the most recent 8,192.timestamp (optional): Array of timestamps (strings or numbers), one per historical step. If present, its length must equal the target history length. Regularly-spaced timestamps are expected — a limited number of missing timestamps are filled internally, but filled timestamps may not exceed 20% of the supplied timestamps (rounded up); beyond that the request is rejected.past_covariates (optional): Map of covariate name → array of historical values (numbers, strings, or null). Each array's length must match the target history length.future_covariates (optional): Map of covariate name → array of values covering the forecast window. Each key must also appear in past_covariates, and each array's length must equal horizon.options (optional): Forecast tuning. See Options below.Note: Unknown fields are rejected. The request schema is strict — any property not listed here causes a
400validation error.
All fields are optional.
| Field | Type | Constraint / Values | Description |
|---|---|---|---|
confidence_interval | number | null | > 0 and < 1 | Confidence level for interval output (e.g. 0.9). |
quantile_levels | number[] | null | each > 0 and < 1 | Specific quantiles to return. |
output_quantile | boolean | — | Include quantile output in the response. |
point_forecast | string | median | mean | hierarchical_forecast | How the point forecast is derived. hierarchical_forecast requires hierarchical_labels and hierarchical_levels; reconciled forecasts are returned in hierarchical_result and result is []. |
clip_min | number | null | — | Clamp forecasts to a lower bound. |
clip_max | number | null | — | Clamp forecasts to an upper bound. |
enhanced_forecast | boolean | — | Enable enhanced forecasting. |
cross_learning | boolean | — | Learn across all series in data jointly instead of independently. |
rules | object[] | null | see below | Post-processing rules applied to forecast values. |
hierarchical_labels | object[] | null | map of string → string | Labels describing the hierarchy of each series. |
hierarchical_levels | (string | null)[] | null | — | Ordered hierarchy level names. |
rules[] — each rule overrides forecast values based on a covariate condition:
| Field | Type | Values |
|---|---|---|
covariate | string | non-empty |
operator | string | == | != | >= | <= | > | < |
threshold | number | — |
forecast_value | number | — |
A successful request returns 200 with the raw forecast result and the upstream latency in milliseconds:
{
"forecast": {
"all_null_targets": [],
"confidence_interval_output": [
[
[
[
122.7403564453125,
126.0583724975586,
124.12074279785156
],
[
178.7145233154297,
204.69876098632812,
210.86856079101562
]
]
]
],
"detected_interval": [
{
"unit": "month",
"value": 1
}
],
"group_results": null,
"hierarchical_result": null,
"quantile_result": null,
"result": [
[
[
147.21084594726562,
155.68292236328125,
154.62445068359375
]
]
],
"result_timestamp": [
[
"2024-05-01",
"2024-06-01",
"2024-07-01"
]
],
"selected_quantile_result": null
},
"delay": 1800
}
forecast: The forecast payload from the time-series model.
result: Nested arrays of forecast values, shaped [series][target][horizon].result_timestamp: Projected timestamps per series (null when timestamps were not supplied).detected_interval: The sampling interval inferred for each series (unit and value), or null.all_null_targets: Series/target positions whose history was entirely null, reported as { series_index, target_indices }.confidence_interval_output: Populated by default at 80% width (q=0.10 lower, q=0.90 upper). Set confidence_interval: null to suppress it; also null when point_forecast: "hierarchical_forecast" is used.quantile_result, selected_quantile_result: null unless output_quantile: true is set.hierarchical_result: Populated when point_forecast: "hierarchical_forecast" is used; contains reconciled forecasts keyed by label. result is [] in that case.group_results: Always null (grouped forecast support is not implemented).delay: Upstream model response time in milliseconds.Error responses use the same structured format as the rest of the API — see Error Codes.
| Code | HTTP | Description |
|---|---|---|
ERR_FORECAST_PAYLOAD_INVALID | 400 | The request body is missing required fields or contains invalid values. The failing field path and reason are included in the message. |
ERR_FORECAST_FAILED | upstream status | The time-series service rejected the request — the HTTP status mirrors the upstream response. Check your data format and try again. |
ERR_SERVICE_UNAVAILABLE | 503 | The upstream time-series service returned 503. Includes a Retry-After header. |
ERR_APP_SESSION_EXPIRED | 400 | The authenticated session has no email on record. |
ERR_NETWORK | 503 | The forecast destination could not be resolved or the upstream call failed. |
ERR_RATE_LIMIT / ERR_RATE_LIMIT_BURST | 429 | Request budget or burst limit exceeded (includes Retry-After). |
ERR_APP_UNKNOWN | 500 | Unexpected server error. |
When the feature flag is disabled the endpoint returns 404 with no forecast-specific body.
The forecast endpoint has its own rate and burst limits, separate from /api/predict. For exact values see Limits & Quotas.
| Constraint | Value |
|---|---|
Min series (data) | 1 |
Min horizon | 1 |
Exceeding the rate or burst limit returns 429 with a Retry-After header. See Errors for the rate-limit headers.