Forecasting
Forecasting APIby Birla AI Labs
POSToab-forecasting.com/forecast

Run a Forecast

Perform synchronous model inference. Send one or more time-series inline and receive forecasts directly in the response.

Request Schema

seriesarray[object]required
[item]object
targetarray[number]required
indexarray[string]required
hist_variablesobjectoptional
future_variablesobjectoptional
future_variables_indexarray[string]optional
static_variablesobjectoptional
horizonintegerrequired
freqstring (enum)required
contextintegeroptional
quantilesarray[number]optional
model_sizestringoptional

Response Schema

statusstring (enum)
modelstring
seriesarray[array[object]]
[i][j]object
predictionobject
meanarray[number]
"0.1"array[number]
"0.5"array[number]
"0.9"array[number]
indexarray[string]
metricsobject | null

Response Example

{
  "status": "completed",
  "model": "chronos-2",
  "series": [
    [
      {
        "prediction": {
          "0.1": [
            124.2,
            125,
            123.8,
            126.5,
            128,
            129.3
          ],
          "0.5": [
            127.4,
            128.9,
            127.2,
            130.1,
            131.8,
            133.2
          ],
          "0.9": [
            130.6,
            132.8,
            130.6,
            133.7,
            135.6,
            137.1
          ],
          "mean": [
            127.4,
            128.9,
            127.2,
            130.1,
            131.8,
            133.2
          ]
        },
        "index": [
          "2023-06-01",
          "2023-07-01",
          "2023-08-01",
          "2023-09-01",
          "2023-10-01",
          "2023-11-01"
        ]
      }
    ]
  ]
}

Possible Errors

401UnauthorizedMissing or invalid Authorization header
422UnprocessableUnknown model ID · index/target length mismatch · invalid freq
429Too Many RequestsRate limit exceeded. Check X-RateLimit-Reset header.
500Server ErrorModel inference failure. See the detail field.
POST
import requests

resp = requests.post(
    "https://oab-forecasting.com/forecast",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "series": [
            {"index": ["2023-01-01","2023-02-01","2023-03-01","2023-04-01","2023-05-01"],
             "target": [120.5, 122.3, 119.8, 124.1, 126.7]}
        ],
        "model": "chronos-2",
        "model_size": "base",
        "horizon": 6,
        "freq": "MS",
        "quantiles": [0.1, 0.5, 0.9],
    },
)
print(resp.json())
POSToab-forecasting.com/forecast

Run a Forecast

Perform synchronous model inference. Send one or more time-series inline and receive forecasts directly in the response.

Request Schema

seriesarray[object]required
[item]object
targetarray[number]required
indexarray[string]required
hist_variablesobjectoptional
future_variablesobjectoptional
future_variables_indexarray[string]optional
static_variablesobjectoptional
horizonintegerrequired
freqstring (enum)required
contextintegeroptional
quantilesarray[number]optional
model_sizestringoptional

Response Schema

statusstring (enum)
modelstring
seriesarray[array[object]]
[i][j]object
predictionobject
meanarray[number]
"0.1"array[number]
"0.5"array[number]
"0.9"array[number]
indexarray[string]
metricsobject | null

Response Example

{
  "status": "completed",
  "model": "chronos-2",
  "series": [
    [
      {
        "prediction": {
          "0.1": [
            124.2,
            125,
            123.8,
            126.5,
            128,
            129.3
          ],
          "0.5": [
            127.4,
            128.9,
            127.2,
            130.1,
            131.8,
            133.2
          ],
          "0.9": [
            130.6,
            132.8,
            130.6,
            133.7,
            135.6,
            137.1
          ],
          "mean": [
            127.4,
            128.9,
            127.2,
            130.1,
            131.8,
            133.2
          ]
        },
        "index": [
          "2023-06-01",
          "2023-07-01",
          "2023-08-01",
          "2023-09-01",
          "2023-10-01",
          "2023-11-01"
        ]
      }
    ]
  ]
}

Possible Errors

401UnauthorizedMissing or invalid Authorization header
422UnprocessableUnknown model ID · index/target length mismatch · invalid freq
429Too Many RequestsRate limit exceeded. Check X-RateLimit-Reset header.
500Server ErrorModel inference failure. See the detail field.