> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tabsutra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Forecast one or many series

> Forecasts the next `horizon` steps of every series in `rows`. Inputs known in advance go in `future_rows`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/forecast
openapi: 3.1.0
info:
  title: tabSutra API
  version: '1.0'
  description: >-
    One pretrained model for forecasting, classification, regression and
    recommendation on tables and databases.
servers:
  - url: https://api.tabsutra.com
security:
  - bearerAuth: []
paths:
  /v1/forecast:
    post:
      summary: Forecast one or many series
      description: >-
        Forecasts the next `horizon` steps of every series in `rows`. Inputs
        known in advance go in `future_rows`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForecastRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForecastResponse'
        '400':
          description: An error
          content:
            application/json:
              schema:
                type: object
        '422':
          description: An error
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    ForecastRequest:
      type: object
      title: ForecastRequest
      required:
        - rows
        - time_column
        - target
        - horizon
      properties:
        rows:
          type: array
          items:
            additionalProperties: true
            type: object
          title: Rows
          description: >-
            The history: one row per series and step, with the target and any
            other inputs.
        series_column:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Series Column
          description: >-
            The column, or the columns, that identify a series (store and item).
            Leave out for one series.
          examples:
            - - store
              - sku
        time_column:
          type: string
          title: Time Column
          description: The date or time of each step.
          examples:
            - date
        target:
          type: string
          title: Target
          description: The column to forecast.
          examples:
            - units
        horizon:
          type: integer
          minimum: 1
          title: Horizon
          description: The number of steps to forecast.
          examples:
            - 28
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Frequency
          description: >-
            The step: H, D, W, M, Q, Y, or a multiple such as 15min. Default:
            inferred from the history.
        column_types:
          additionalProperties:
            type: string
            enum:
              - number
              - category
              - date
              - text
              - image
              - audio
              - document
              - embedding
              - id
              - ignore
          type: object
          title: Column Types
          description: >-
            Override the inferred type of a column: number, category, date,
            text, image, audio or document (a link to a file), embedding (a list
            of numbers), id (never read) or ignore.
          examples:
            - postcode: category
              remarks: text
              photo_url: image
        future_rows:
          type: array
          items:
            additionalProperties: true
            type: object
          title: Future Rows
          description: >-
            Inputs known in advance (price, promotion, holiday): one row per
            series and future step, without the target. A column here is read as
            known in advance.
        target_range:
          anyOf:
            - prefixItems:
                - anyOf:
                    - type: number
                    - type: 'null'
                - anyOf:
                    - type: number
                    - type: 'null'
              type: array
              maxItems: 2
              minItems: 2
            - type: 'null'
          title: Target Range
          description: >-
            Regression: outputs are clipped to [low, high] (a share between 0
            and 1, a price that cannot be negative: [0, null]). null = no bound
            on that side.
        as_of:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: As Of
          description: >-
            Forecast from this date: the history after it is not read. Default:
            the last step of each series.
        outputs:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Outputs
          description: >-
            classification: label, probabilities. regression: mean, median,
            quantiles, interval. Default: all of them.
        quantiles:
          items:
            type: number
          type: array
          title: Quantiles
          description: 'Regression: the levels (between 0 and 1) of the quantiles returned.'
          default:
            - 0.1
            - 0.5
            - 0.9
        coverage:
          type: number
          exclusiveMaximum: 1
          exclusiveMinimum: 0
          title: Coverage
          description: >-
            Regression: the share of the predicted distribution the interval
            holds.
          default: 0.8
        explain:
          type: boolean
          default: false
          title: Explain
          description: >-
            Add to each prediction the contribution of each input to it. See
            Explanations.
        explain_top:
          type: integer
          default: 10
          minimum: 1
          maximum: 100
          title: Explain Top
          description: The number of largest contributions returned per prediction.
        explain_class:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Explain Class
          description: >-
            Classification: the class whose probability is explained. Default:
            the predicted label.
    ForecastResponse:
      type: object
      title: ForecastResponse
      required:
        - predictions
        - report
      properties:
        predictions:
          type: array
          items:
            additionalProperties: true
            type: object
          title: Predictions
          description: >-
            One object per series and future step: series, time, step, and the
            outputs asked for.
        report:
          additionalProperties: true
          type: object
          title: Report
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as ''Authorization: Bearer <key>''.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.