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

# Predict (TabPFN JSON API)

> **Recommended:** Use [tabpfn-client](https://github.com/PriorLabs/tabpfn-client) (`TabPFNClassifier` / `TabPFNRegressor`). It calls these routes for you.

JSON body after `POST /tabpfn/prepare_test_set_upload` and file upload. Fields: `test_set_upload_id`, `fitted_train_set_id` (from `/tabpfn/fit`), `task_config` (task + tabpfn config), optional `force_refit`.



## OpenAPI

````yaml /api-reference/openapi.json post /tabpfn/predict
openapi: 3.1.0
info:
  title: TabPFN API
  description: >-
    Prior Labs TabPFN API. **Prefer
    [tabpfn-client](https://github.com/PriorLabs/tabpfn-client)**. Current
    integration surface: **`/tabpfn/*` JSON routes** (prepare uploads, fit,
    predict, limits). **`/v1/*` multipart routes are deprecated.** See the
    [Changelog](/changelog).
  version: 2.0.0
  contact:
    name: Prior Labs
    email: hello@priorlabs.ai
servers:
  - url: https://api.priorlabs.ai
    description: Production TabPFN API (`/tabpfn/*` current; `/v1/*` deprecated)
security:
  - BearerAuth: []
paths:
  /tabpfn/predict:
    post:
      tags:
        - Prediction
      summary: Predict (TabPFN JSON API)
      description: >-
        **Recommended:** Use
        [tabpfn-client](https://github.com/PriorLabs/tabpfn-client)
        (`TabPFNClassifier` / `TabPFNRegressor`). It calls these routes for you.


        JSON body after `POST /tabpfn/prepare_test_set_upload` and file upload.
        Fields: `test_set_upload_id`, `fitted_train_set_id` (from
        `/tabpfn/fit`), `task_config` (task + tabpfn config), optional
        `force_refit`.
      operationId: tabpfn_predict
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictRequest'
            example:
              test_set_upload_id: 223e4567-e89b-12d3-a456-426614174000
              fitted_train_set_id: 323e4567-e89b-12d3-a456-426614174000
              task_config:
                task: classification
                tabpfn_config:
                  model_path: auto
      responses:
        '200':
          description: Prediction payload + metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictResponse'
        '401':
          description: >-
            Unauthorized — authentication required or credentials invalid.


            **Possible causes:**

            - Missing or malformed `Authorization` header

            - Invalid or expired JWT token

            - User not found (token references a deleted account)

            - JWT decode errors (JWEDecodeError, JWTDecodeError, JWTClaimsError)


            **Examples:**

            - Missing token: `{"detail": "Not authenticated"}`

            - Invalid credentials: `{"detail": "Could not validate
            credentials"}`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_token:
                  value:
                    code: auth.unauthorized
                    detail: Not authenticated
                    retryable: false
                    support: https://discord.com/invite/VJRuU3bSxt
                invalid_credentials:
                  value:
                    code: auth.unauthorized
                    detail: Could not validate credentials
                    retryable: false
                    support: https://discord.com/invite/VJRuU3bSxt
                expired_token:
                  value:
                    code: auth.unauthorized
                    detail: Invalid or expired JWT token
                    retryable: false
                    support: https://discord.com/invite/VJRuU3bSxt
        '404':
          description: >-
            Model not found — the provided model ID does not exist or has
            expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: error.not_found
                detail: >-
                  Fitted model with ID 123e4567-e89b-12d3-a456-426614174000 not
                  found
                retryable: false
                support: https://discord.com/invite/VJRuU3bSxt
        '422':
          description: Validation error — one or more fields are incorrectly formatted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Quota exceeded.
      security:
        - BearerAuth: []
components:
  schemas:
    PredictRequest:
      properties:
        test_set_upload_id:
          type: string
          format: uuid
          title: Test Set Upload Id
        fitted_train_set_id:
          type: string
          format: uuid
          title: Fitted Train Set Id
        task_config:
          oneOf:
            - $ref: '#/components/schemas/ClassifierConfig'
            - $ref: '#/components/schemas/RegressorConfig'
          title: Task Config
          discriminator:
            propertyName: task
            mapping:
              classification:
                $ref: '#/components/schemas/ClassifierConfig'
              regression:
                $ref: '#/components/schemas/RegressorConfig'
        force_refit:
          type: boolean
          title: Force Refit
          description: >-
            Whether to force the fitting of the test set even if a fittedtest
            set and transform states already exist.
          default: false
      additionalProperties: false
      type: object
      required:
        - test_set_upload_id
        - fitted_train_set_id
        - task_config
      title: PredictRequest
    PredictResponse:
      properties:
        prediction:
          anyOf:
            - items: {}
              type: array
            - items:
                items: {}
                type: array
              type: array
            - additionalProperties:
                anyOf:
                  - items: {}
                    type: array
                  - items:
                      items: {}
                      type: array
                    type: array
              type: object
          title: Prediction
        metadata:
          oneOf:
            - $ref: '#/components/schemas/ClassifierMetadata'
            - $ref: '#/components/schemas/RegressorMetadata'
          title: Metadata
          discriminator:
            propertyName: task
            mapping:
              classification:
                $ref: '#/components/schemas/ClassifierMetadata'
              regression:
                $ref: '#/components/schemas/RegressorMetadata'
      additionalProperties: false
      type: object
      required:
        - prediction
        - metadata
      title: PredictResponse
    ErrorResponse:
      type: object
      required:
        - code
        - detail
        - retryable
        - support
      properties:
        code:
          type: string
          description: Error category code (e.g., auth.unauthorized, rate.limit.exceeded)
          example: auth.unauthorized
        detail:
          type: string
          description: Human-readable error message describing what went wrong.
          example: Invalid authentication credentials
        retryable:
          type: boolean
          description: Indicates whether the request can be retried.
          example: false
        support:
          type: string
          description: URL to get support for this error.
          example: https://discord.com/invite/VJRuU3bSxt
      example:
        code: auth.unauthorized
        detail: Invalid authentication credentials
        retryable: false
        support: https://discord.com/invite/VJRuU3bSxt
    ValidationError:
      type: object
      required:
        - code
        - detail
        - errors
        - retryable
        - support
      properties:
        code:
          type: string
          description: Error category code for validation errors
          example: validation.failed
        detail:
          type: string
          description: Human-readable validation error message
          example: Validation error for FitRequest
        errors:
          type: array
          description: Array of field-level validation errors
          items:
            type: object
            properties:
              field:
                type: string
                description: Field name where the error occurred
                example: task
              message:
                type: string
                description: Error message for this field
                example: field required
        retryable:
          type: boolean
          description: Indicates whether the request can be retried
          example: false
        support:
          type: string
          description: URL to get support for this error
          example: https://discord.com/invite/VJRuU3bSxt
      example:
        code: validation.failed
        detail: Validation error for FitRequest
        errors:
          - field: task
            message: field required
          - field: systems
            message: >-
              Invalid system: invalid_system. Must be one of: ['preprocessing',
              'text']
        retryable: false
        support: https://discord.com/invite/VJRuU3bSxt
    ClassifierConfig:
      properties:
        task:
          type: string
          const: classification
          title: Task
          default: classification
        tabpfn_config:
          $ref: '#/components/schemas/ClassifierTabPFNConfig'
        predict_params:
          $ref: '#/components/schemas/ClassifierPredictParams'
      additionalProperties: false
      type: object
      title: ClassifierConfig
    RegressorConfig:
      properties:
        task:
          type: string
          const: regression
          title: Task
          default: regression
        tabpfn_config:
          $ref: '#/components/schemas/RegressorTabPFNConfig'
        predict_params:
          $ref: '#/components/schemas/RegressorPredictParams'
      additionalProperties: false
      type: object
      title: RegressorConfig
    ClassifierMetadata:
      properties:
        test_set_num_rows:
          type: integer
          title: Test Set Num Rows
        test_set_num_cols:
          type: integer
          title: Test Set Num Cols
        task:
          type: string
          const: classification
          title: Task
          default: classification
        package_version:
          type: string
          title: Package Version
        tabpfn_config:
          $ref: '#/components/schemas/ClassifierTabPFNConfig'
      additionalProperties: false
      type: object
      required:
        - test_set_num_rows
        - test_set_num_cols
        - package_version
        - tabpfn_config
      title: ClassifierMetadata
    RegressorMetadata:
      properties:
        test_set_num_rows:
          type: integer
          title: Test Set Num Rows
        test_set_num_cols:
          type: integer
          title: Test Set Num Cols
        task:
          type: string
          const: regression
          title: Task
          default: regression
        package_version:
          type: string
          title: Package Version
        tabpfn_config:
          $ref: '#/components/schemas/RegressorTabPFNConfig'
      additionalProperties: false
      type: object
      required:
        - test_set_num_rows
        - test_set_num_cols
        - package_version
        - tabpfn_config
      title: RegressorMetadata
    ClassifierTabPFNConfig:
      properties:
        n_estimators:
          anyOf:
            - type: integer
              maximum: 8
              minimum: 1
            - type: 'null'
          title: N Estimators
        categorical_features_indices:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Categorical Features Indices
        softmax_temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Softmax Temperature
        average_before_softmax:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Average Before Softmax
        random_state:
          anyOf:
            - type: integer
            - type: 'null'
          title: Random State
        inference_config:
          anyOf:
            - additionalProperties: true
              type: object
            - $ref: '#/components/schemas/InferenceConfig'
            - type: 'null'
          title: Inference Config
        ignore_pretraining_limits:
          type: boolean
          title: Ignore Pretraining Limits
          default: true
        n_preprocessing_jobs:
          type: integer
          title: N Preprocessing Jobs
          default: 4
        inference_precision:
          type: string
          title: Inference Precision
          default: auto
        fit_mode:
          $ref: '#/components/schemas/FitMode'
          default: fit_preprocessors
        device:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Device
        memory_saving_mode:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Memory Saving Mode
        model_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Path
        balance_probabilities:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Balance Probabilities
      additionalProperties: false
      type: object
      title: ClassifierTabPFNConfig
    ClassifierPredictParams:
      properties:
        output_type:
          $ref: '#/components/schemas/ClassifierOutputType'
          default: probas
      additionalProperties: false
      type: object
      title: ClassifierPredictParams
    RegressorTabPFNConfig:
      properties:
        n_estimators:
          anyOf:
            - type: integer
              maximum: 8
              minimum: 1
            - type: 'null'
          title: N Estimators
        categorical_features_indices:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Categorical Features Indices
        softmax_temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Softmax Temperature
        average_before_softmax:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Average Before Softmax
        random_state:
          anyOf:
            - type: integer
            - type: 'null'
          title: Random State
        inference_config:
          anyOf:
            - additionalProperties: true
              type: object
            - $ref: '#/components/schemas/InferenceConfig'
            - type: 'null'
          title: Inference Config
        ignore_pretraining_limits:
          type: boolean
          title: Ignore Pretraining Limits
          default: true
        n_preprocessing_jobs:
          type: integer
          title: N Preprocessing Jobs
          default: 4
        inference_precision:
          type: string
          title: Inference Precision
          default: auto
        fit_mode:
          $ref: '#/components/schemas/FitMode'
          default: fit_preprocessors
        device:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Device
        memory_saving_mode:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Memory Saving Mode
        model_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Path
      additionalProperties: false
      type: object
      title: RegressorTabPFNConfig
    RegressorPredictParams:
      properties:
        output_type:
          $ref: '#/components/schemas/RegressorOutputType'
          default: mean
        quantiles:
          anyOf:
            - items:
                type: number
                maximum: 1
                minimum: 0
              type: array
            - type: 'null'
          title: Quantiles
      additionalProperties: false
      type: object
      title: RegressorPredictParams
    InferenceConfig:
      properties:
        PREPROCESS_TRANSFORMS:
          items:
            $ref: '#/components/schemas/PreprocessorConfig'
          type: array
          title: Preprocess Transforms
        MAX_UNIQUE_FOR_CATEGORICAL_FEATURES:
          type: integer
          title: Max Unique For Categorical Features
          default: 30
        MIN_UNIQUE_FOR_NUMERICAL_FEATURES:
          type: integer
          title: Min Unique For Numerical Features
          default: 4
        MIN_NUMBER_SAMPLES_FOR_CATEGORICAL_INFERENCE:
          type: integer
          title: Min Number Samples For Categorical Inference
          default: 100
        OUTLIER_REMOVAL_STD:
          anyOf:
            - type: number
            - type: string
              const: auto
            - type: 'null'
          title: Outlier Removal Std
          default: auto
        FEATURE_SHIFT_METHOD:
          anyOf:
            - type: string
              enum:
                - shuffle
                - rotate
            - type: 'null'
          title: Feature Shift Method
          default: shuffle
        CLASS_SHIFT_METHOD:
          anyOf:
            - type: string
              enum:
                - shuffle
                - rotate
            - type: 'null'
          title: Class Shift Method
          default: shuffle
        FINGERPRINT_FEATURE:
          type: boolean
          title: Fingerprint Feature
          default: true
        POLYNOMIAL_FEATURES:
          anyOf:
            - type: string
              enum:
                - 'no'
                - all
            - type: integer
          title: Polynomial Features
          default: 'no'
        SUBSAMPLE_SAMPLES:
          anyOf:
            - type: integer
            - type: number
            - items: {}
              type: array
            - type: 'null'
          title: Subsample Samples
        ENABLE_GPU_PREPROCESSING:
          type: boolean
          title: Enable Gpu Preprocessing
          default: false
        FEATURE_SUBSAMPLING_METHOD:
          type: string
          enum:
            - balanced
            - random
            - constant_and_balanced
            - gini_feature_importance
            - auto
          title: Feature Subsampling Method
          default: balanced
        FEATURE_SUBSAMPLING_CONSTANT_FEATURE_COUNT:
          type: integer
          title: Feature Subsampling Constant Feature Count
          default: 50
        FEATURE_SUBSAMPLING_IMPORTANCE_TOP_K_COUNT:
          anyOf:
            - type: integer
            - type: number
            - type: string
              const: auto
          title: Feature Subsampling Importance Top K Count
          default: auto
        REGRESSION_Y_PREPROCESS_TRANSFORMS:
          items:
            anyOf:
              - type: string
              - type: 'null'
          type: array
          title: Regression Y Preprocess Transforms
          default:
            - null
            - safepower
        USE_SKLEARN_16_DECIMAL_PRECISION:
          type: boolean
          title: Use Sklearn 16 Decimal Precision
          default: false
        MAX_NUMBER_OF_CLASSES:
          type: integer
          title: Max Number Of Classes
          default: 10
        MAX_NUMBER_OF_FEATURES:
          type: integer
          title: Max Number Of Features
          default: 500
        MAX_NUMBER_OF_SAMPLES:
          type: integer
          title: Max Number Of Samples
          default: 10000
        FIX_NAN_BORDERS_AFTER_TARGET_TRANSFORM:
          type: boolean
          title: Fix Nan Borders After Target Transform
          default: true
        _REGRESSION_DEFAULT_OUTLIER_REMOVAL_STD:
          anyOf:
            - type: number
            - type: 'null'
          title: Regression Default Outlier Removal Std
        _CLASSIFICATION_DEFAULT_OUTLIER_REMOVAL_STD:
          type: number
          title: Classification Default Outlier Removal Std
          default: 12
      additionalProperties: false
      type: object
      required:
        - PREPROCESS_TRANSFORMS
      title: InferenceConfig
      description: >-
        Additional configuration options for inference.


        Several configuration options for inference are exposed in the
        `TabPFNClassifier`

        and `TabPFNRegressor` interfaces. The options in this class are more
        advanced and

        not expected to be changed by the (standard) user.


        Several of the preprocessing options are supported by our code for
        efficiency

        reasons (to avoid loading TabPFN multiple times). However, these can
        also be

        applied outside of the model interface.


        This class must be serializable as it is peristed in the model
        checkpoints.


        Do not edit the default values in this class, as this can affect the
        backwards

        compatibility of the model checkpoints. Instead, edit `get_default()`.
    FitMode:
      type: string
      enum:
        - low_memory
        - fit_preprocessors
        - fit_with_cache
        - batched
      title: FitMode
    ClassifierOutputType:
      type: string
      enum:
        - probas
        - preds
      title: ClassifierOutputType
    RegressorOutputType:
      type: string
      enum:
        - mean
        - median
        - mode
        - quantiles
        - full
        - main
      title: RegressorOutputType
    PreprocessorConfig:
      properties:
        name:
          type: string
          enum:
            - per_feature
            - power
            - safepower
            - power_box
            - safepower_box
            - quantile_uni_coarse
            - quantile_norm_coarse
            - quantile_uni
            - quantile_norm
            - quantile_uni_fine
            - quantile_norm_fine
            - squashing_scaler_default
            - squashing_scaler_max10
            - robust
            - kdi
            - none
            - kdi_random_alpha
            - kdi_uni
            - kdi_random_alpha_uni
            - adaptive
            - norm_and_kdi
            - kdi_alpha_0.3_uni
            - kdi_alpha_0.5_uni
            - kdi_alpha_0.8_uni
            - kdi_alpha_1.0_uni
            - kdi_alpha_1.2_uni
            - kdi_alpha_1.5_uni
            - kdi_alpha_2.0_uni
            - kdi_alpha_3.0_uni
            - kdi_alpha_5.0_uni
            - kdi_alpha_0.3
            - kdi_alpha_0.5
            - kdi_alpha_0.8
            - kdi_alpha_1.0
            - kdi_alpha_1.2
            - kdi_alpha_1.5
            - kdi_alpha_2.0
            - kdi_alpha_3.0
            - kdi_alpha_5.0
          title: Name
        categorical_name:
          type: string
          enum:
            - none
            - numeric
            - onehot
            - ordinal
            - ordinal_shuffled
            - ordinal_very_common_categories_shuffled
          title: Categorical Name
          default: none
        append_original:
          anyOf:
            - type: boolean
            - type: string
              const: auto
          title: Append Original
          default: false
        max_features_per_estimator:
          type: integer
          title: Max Features Per Estimator
          default: 500
        global_transformer_name:
          anyOf:
            - type: string
              enum:
                - svd
                - svd_quarter_components
            - type: 'null'
          title: Global Transformer Name
        max_onehot_cardinality:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Onehot Cardinality
        differentiable:
          type: boolean
          title: Differentiable
          default: false
      type: object
      required:
        - name
      title: PreprocessorConfig
      description: |-
        Configuration for data preprocessing.

        Attributes:
            name: Name of the preprocessor.
            categorical_name:
                Name of the categorical encoding method.
                Options: "none", "numeric", "onehot", "ordinal", "ordinal_shuffled", "none".
            append_to_original: If set to "auto", this is dynamically set to
                True if the number of features is less than 500, and False otherwise.
                Note that if set to "auto" and `max_features_per_estimator` is set as well,
                this flag will become False if the number of features is larger than
                `max_features_per_estimator / 2`. If True, the transformed features are
                appended to the original features, however both are capped at the
                max_features_per_estimator threshold, this should be used with caution as a
                given model might not be configured for it.
            max_features_per_estimator: Maximum number of features per estimator. In case
                the dataset has more features than this, the features are subsampled for
                each estimator independently. If append to original is set to True we can
                still have more features.
            global_transformer_name: Name of the global transformer to use.
            max_onehot_cardinality: Maximum number of unique values a categorical feature
                can have to be one-hot encoded. Features with higher cardinality are passed
                through unchanged to ordinal encoding. If None, all categorical features
                are one-hot encoded.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token for authentication, obtained after signing up and
        generating an API key.

````