> ## 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.

# Read the context rows once



## OpenAPI

````yaml /api-reference/openapi.json post /v1/fit
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/fit:
    post:
      summary: Read the context rows once
      operationId: fit_v1_fit_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FitRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FitResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FitRequest:
      properties:
        target:
          type: string
          title: Target
          description: >-
            The column to predict. Rows where it is empty are left out of the
            context.
          examples:
            - churned
        task:
          type: string
          enum:
            - classification
            - regression
          title: Task
          description: >-
            'classification' to predict a category (yes/no, a grade, a segment);
            'regression' to predict a number.
        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
        id_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Column
          description: >-
            A column that names each row. It is never read as a feature;
            predictions are keyed by it.
        max_context:
          type: integer
          minimum: 0
          title: Max Context
          description: >-
            Use at most this many rows as the context; the same rows always give
            the same choice. 0 = all rows.
          default: 0
        embed_dims:
          type: integer
          maximum: 64
          minimum: 1
          title: Embed Dims
          description: >-
            Numeric columns made from each text, image, audio, document or
            embedding column.
          default: 8
        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.
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
          description: >-
            When each row happened (a date, or a number of days). A row is then
            predicted from what was known before it: the answers known before
            its time, and the earlier rows of its group. The column is also read
            as a feature, and every other date column is read as its age at the
            row's time.
          examples:
            - month
        group_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Column
          description: >-
            Which rows belong together: the months of one account, the stops of
            one delivery route. A row reads the other rows of its group. Send
            every row of a group that has no known answer yet in the same call.
          examples:
            - account_id
        known_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Known Column
          description: >-
            When the row's values were known, if before its time (a stop planned
            when the route set off). Default: the row's time.
        target_delay_days:
          type: number
          minimum: 0
          title: Target Delay Days
          description: >-
            How long after the row's time its target is known. A target about
            the month after the row: 30. Default 0.
          default: 0
        group_target:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Target
          description: >-
            A column with the group's own answer (an account's total recovery, a
            route's total hours), on any of the group's rows and empty while the
            group is open. It counts as known target_delay_days after the
            group's last row. Every prediction then also carries the group
            answer, as of that row.
          examples:
            - total_recovered
        group_task:
          anyOf:
            - type: string
              enum:
                - classification
                - regression
            - type: 'null'
          title: Group Task
          description: >-
            'classification' or 'regression' for the group answer. Default: the
            task.
        group_target_range:
          anyOf:
            - prefixItems:
                - anyOf:
                    - type: number
                    - type: 'null'
                - anyOf:
                    - type: number
                    - type: 'null'
              type: array
              maxItems: 2
              minItems: 2
            - type: 'null'
          title: Group Target Range
          description: 'Regression group answer: clipped to [low, high].'
        as_of:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: As Of
          description: >-
            Stand at this date (or number, as the time column): use only what
            was known then. Rows known later and answers known later are left
            out.
          examples:
            - '2026-10-31'
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
          description: The context rows, one object per row.
      type: object
      required:
        - target
        - task
        - rows
      title: FitRequest
    FitResponse:
      properties:
        context_id:
          type: string
          title: Context Id
          description: >-
            Pass it to /v1/predict. The same rows and settings always give the
            same id.
        report:
          additionalProperties: true
          type: object
          title: Report
          description: Column types and why, rows used and left out, text columns, timings.
      type: object
      required:
        - context_id
        - report
      title: FitResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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.