---
title: "Predict (TabPFN JSON API)"
method: POST
path: "/tabpfn/predict"
tags: ["Prediction"]
---

# Predict (TabPFN JSON API)

`POST /tabpfn/predict`

**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`.

## Request body

- PredictRequest
  - `test_set_upload_id` string, uuid, required
  - `fitted_train_set_id` string, uuid, required
  - `task_config` union, required
    - ClassifierConfig
      - `task` 'classification'
      - `tabpfn_config` ClassifierTabPFNConfig
        - `n_estimators` integer, nullable
        - `categorical_features_indices` integer[], nullable
        - `softmax_temperature` number, nullable
        - `average_before_softmax` boolean, nullable
        - `random_state` integer, nullable
        - `inference_config` union
          - object
          - InferenceConfig — 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()`.
            - `PREPROCESS_TRANSFORMS` PreprocessorConfig[], required
              - …
            - `MAX_UNIQUE_FOR_CATEGORICAL_FEATURES` integer
            - `MIN_UNIQUE_FOR_NUMERICAL_FEATURES` integer
            - `MIN_NUMBER_SAMPLES_FOR_CATEGORICAL_INFERENCE` integer
            - `OUTLIER_REMOVAL_STD` union
              - …
            - `FEATURE_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `CLASS_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `FINGERPRINT_FEATURE` boolean
            - `POLYNOMIAL_FEATURES` union
              - …
            - `SUBSAMPLE_SAMPLES` union
              - …
            - `ENABLE_GPU_PREPROCESSING` boolean
            - `FEATURE_SUBSAMPLING_METHOD` 'balanced' | 'random' | 'constant_and_balanced' | 'gini_feature_importance' | 'auto'
            - `FEATURE_SUBSAMPLING_CONSTANT_FEATURE_COUNT` integer
            - `FEATURE_SUBSAMPLING_IMPORTANCE_TOP_K_COUNT` union
              - …
            - `REGRESSION_Y_PREPROCESS_TRANSFORMS` string[]
            - `USE_SKLEARN_16_DECIMAL_PRECISION` boolean
            - `MAX_NUMBER_OF_CLASSES` integer
            - `MAX_NUMBER_OF_FEATURES` integer
            - `MAX_NUMBER_OF_SAMPLES` integer
            - `FIX_NAN_BORDERS_AFTER_TARGET_TRANSFORM` boolean
            - `_REGRESSION_DEFAULT_OUTLIER_REMOVAL_STD` number, nullable
            - `_CLASSIFICATION_DEFAULT_OUTLIER_REMOVAL_STD` number
        - `ignore_pretraining_limits` boolean
        - `n_preprocessing_jobs` integer
        - `inference_precision` string
        - `fit_mode` 'low_memory' | 'fit_preprocessors' | 'fit_with_cache' | 'batched'
        - `device` string[], nullable
        - `memory_saving_mode` boolean, nullable
        - `model_path` string, nullable
        - `balance_probabilities` boolean, nullable
      - `predict_params` ClassifierPredictParams
        - `output_type` 'probas' | 'preds'
    - RegressorConfig
      - `task` 'regression'
      - `tabpfn_config` RegressorTabPFNConfig
        - `n_estimators` integer, nullable
        - `categorical_features_indices` integer[], nullable
        - `softmax_temperature` number, nullable
        - `average_before_softmax` boolean, nullable
        - `random_state` integer, nullable
        - `inference_config` union
          - object
          - InferenceConfig — 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()`.
            - `PREPROCESS_TRANSFORMS` PreprocessorConfig[], required
              - …
            - `MAX_UNIQUE_FOR_CATEGORICAL_FEATURES` integer
            - `MIN_UNIQUE_FOR_NUMERICAL_FEATURES` integer
            - `MIN_NUMBER_SAMPLES_FOR_CATEGORICAL_INFERENCE` integer
            - `OUTLIER_REMOVAL_STD` union
              - …
            - `FEATURE_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `CLASS_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `FINGERPRINT_FEATURE` boolean
            - `POLYNOMIAL_FEATURES` union
              - …
            - `SUBSAMPLE_SAMPLES` union
              - …
            - `ENABLE_GPU_PREPROCESSING` boolean
            - `FEATURE_SUBSAMPLING_METHOD` 'balanced' | 'random' | 'constant_and_balanced' | 'gini_feature_importance' | 'auto'
            - `FEATURE_SUBSAMPLING_CONSTANT_FEATURE_COUNT` integer
            - `FEATURE_SUBSAMPLING_IMPORTANCE_TOP_K_COUNT` union
              - …
            - `REGRESSION_Y_PREPROCESS_TRANSFORMS` string[]
            - `USE_SKLEARN_16_DECIMAL_PRECISION` boolean
            - `MAX_NUMBER_OF_CLASSES` integer
            - `MAX_NUMBER_OF_FEATURES` integer
            - `MAX_NUMBER_OF_SAMPLES` integer
            - `FIX_NAN_BORDERS_AFTER_TARGET_TRANSFORM` boolean
            - `_REGRESSION_DEFAULT_OUTLIER_REMOVAL_STD` number, nullable
            - `_CLASSIFICATION_DEFAULT_OUTLIER_REMOVAL_STD` number
        - `ignore_pretraining_limits` boolean
        - `n_preprocessing_jobs` integer
        - `inference_precision` string
        - `fit_mode` 'low_memory' | 'fit_preprocessors' | 'fit_with_cache' | 'batched'
        - `device` string[], nullable
        - `memory_saving_mode` boolean, nullable
        - `model_path` string, nullable
      - `predict_params` RegressorPredictParams
        - `output_type` 'mean' | 'median' | 'mode' | 'quantiles' | 'full' | 'main'
        - `quantiles` number[], nullable
  - `force_refit` boolean — Whether to force the fitting of the test set even if a fittedtest set and transform states already exist.

## Response `200`

Prediction payload + metadata.

- PredictResponse
  - `prediction` union, required
    - unknown[]
      - unknown
    - array[]
      - unknown[]
        - unknown
    - object
  - `metadata` union, required
    - ClassifierMetadata
      - `test_set_num_rows` integer, required
      - `test_set_num_cols` integer, required
      - `task` 'classification'
      - `package_version` string, required
      - `tabpfn_config` ClassifierTabPFNConfig, required
        - `n_estimators` integer, nullable
        - `categorical_features_indices` integer[], nullable
        - `softmax_temperature` number, nullable
        - `average_before_softmax` boolean, nullable
        - `random_state` integer, nullable
        - `inference_config` union
          - object
          - InferenceConfig — 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()`.
            - `PREPROCESS_TRANSFORMS` PreprocessorConfig[], required
              - …
            - `MAX_UNIQUE_FOR_CATEGORICAL_FEATURES` integer
            - `MIN_UNIQUE_FOR_NUMERICAL_FEATURES` integer
            - `MIN_NUMBER_SAMPLES_FOR_CATEGORICAL_INFERENCE` integer
            - `OUTLIER_REMOVAL_STD` union
              - …
            - `FEATURE_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `CLASS_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `FINGERPRINT_FEATURE` boolean
            - `POLYNOMIAL_FEATURES` union
              - …
            - `SUBSAMPLE_SAMPLES` union
              - …
            - `ENABLE_GPU_PREPROCESSING` boolean
            - `FEATURE_SUBSAMPLING_METHOD` 'balanced' | 'random' | 'constant_and_balanced' | 'gini_feature_importance' | 'auto'
            - `FEATURE_SUBSAMPLING_CONSTANT_FEATURE_COUNT` integer
            - `FEATURE_SUBSAMPLING_IMPORTANCE_TOP_K_COUNT` union
              - …
            - `REGRESSION_Y_PREPROCESS_TRANSFORMS` string[]
            - `USE_SKLEARN_16_DECIMAL_PRECISION` boolean
            - `MAX_NUMBER_OF_CLASSES` integer
            - `MAX_NUMBER_OF_FEATURES` integer
            - `MAX_NUMBER_OF_SAMPLES` integer
            - `FIX_NAN_BORDERS_AFTER_TARGET_TRANSFORM` boolean
            - `_REGRESSION_DEFAULT_OUTLIER_REMOVAL_STD` number, nullable
            - `_CLASSIFICATION_DEFAULT_OUTLIER_REMOVAL_STD` number
        - `ignore_pretraining_limits` boolean
        - `n_preprocessing_jobs` integer
        - `inference_precision` string
        - `fit_mode` 'low_memory' | 'fit_preprocessors' | 'fit_with_cache' | 'batched'
        - `device` string[], nullable
        - `memory_saving_mode` boolean, nullable
        - `model_path` string, nullable
        - `balance_probabilities` boolean, nullable
    - RegressorMetadata
      - `test_set_num_rows` integer, required
      - `test_set_num_cols` integer, required
      - `task` 'regression'
      - `package_version` string, required
      - `tabpfn_config` RegressorTabPFNConfig, required
        - `n_estimators` integer, nullable
        - `categorical_features_indices` integer[], nullable
        - `softmax_temperature` number, nullable
        - `average_before_softmax` boolean, nullable
        - `random_state` integer, nullable
        - `inference_config` union
          - object
          - InferenceConfig — 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()`.
            - `PREPROCESS_TRANSFORMS` PreprocessorConfig[], required
              - …
            - `MAX_UNIQUE_FOR_CATEGORICAL_FEATURES` integer
            - `MIN_UNIQUE_FOR_NUMERICAL_FEATURES` integer
            - `MIN_NUMBER_SAMPLES_FOR_CATEGORICAL_INFERENCE` integer
            - `OUTLIER_REMOVAL_STD` union
              - …
            - `FEATURE_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `CLASS_SHIFT_METHOD` 'shuffle' | 'rotate', nullable
            - `FINGERPRINT_FEATURE` boolean
            - `POLYNOMIAL_FEATURES` union
              - …
            - `SUBSAMPLE_SAMPLES` union
              - …
            - `ENABLE_GPU_PREPROCESSING` boolean
            - `FEATURE_SUBSAMPLING_METHOD` 'balanced' | 'random' | 'constant_and_balanced' | 'gini_feature_importance' | 'auto'
            - `FEATURE_SUBSAMPLING_CONSTANT_FEATURE_COUNT` integer
            - `FEATURE_SUBSAMPLING_IMPORTANCE_TOP_K_COUNT` union
              - …
            - `REGRESSION_Y_PREPROCESS_TRANSFORMS` string[]
            - `USE_SKLEARN_16_DECIMAL_PRECISION` boolean
            - `MAX_NUMBER_OF_CLASSES` integer
            - `MAX_NUMBER_OF_FEATURES` integer
            - `MAX_NUMBER_OF_SAMPLES` integer
            - `FIX_NAN_BORDERS_AFTER_TARGET_TRANSFORM` boolean
            - `_REGRESSION_DEFAULT_OUTLIER_REMOVAL_STD` number, nullable
            - `_CLASSIFICATION_DEFAULT_OUTLIER_REMOVAL_STD` number
        - `ignore_pretraining_limits` boolean
        - `n_preprocessing_jobs` integer
        - `inference_precision` string
        - `fit_mode` 'low_memory' | 'fit_preprocessors' | 'fit_with_cache' | 'batched'
        - `device` string[], nullable
        - `memory_saving_mode` boolean, nullable
        - `model_path` string, nullable

## Other responses

- `401` — 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"}`
- `404` — Model not found — the provided model ID does not exist or has expired.
- `422` — Validation error — one or more fields are incorrectly formatted.
- `429` — Quota exceeded.

---

[API](https://skmtc.dev/priorlabs/apis/tabpfn-api.md) · [All operations](https://skmtc.dev/priorlabs/apis/tabpfn-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/priorlabs/tabpfn-api/revisions/c893364bdb13/schema)
