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

# Predict rows against a context



## OpenAPI

````yaml /api-reference/openapi.json post /v1/predict
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/predict:
    post:
      summary: Predict rows against a context
      operationId: predict_v1_predict_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PredictRequest:
      properties:
        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
        context_id:
          type: string
          title: Context Id
          description: From /v1/fit.
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
          description: >-
            The rows to predict, with the context's columns (the target is not
            needed).
        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.
      type: object
      required:
        - context_id
        - rows
      title: PredictRequest
    PredictResponse:
      properties:
        predictions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Predictions
          description: >-
            One object per row, keyed by 'id' (the id column, or the row's
            position).
        report:
          additionalProperties: true
          type: object
          title: Report
      type: object
      required:
        - predictions
        - report
      title: PredictResponse
    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.