---
title: "Prepare train set upload"
method: POST
path: "/tabpfn/prepare_train_set_upload"
tags: ["Training"]
---

# Prepare train set upload

`POST /tabpfn/prepare_train_set_upload`

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

First step for TabPFN v2 flow: pass `x_train_info` / `y_train_info` metadata (name, size, hash); receive `train_set_upload_id` and signed upload URLs.

## Request body

- PrepareTrainSetUploadRequest
  - `x_train_info` FileInfo, required
    - `format` 'csv' | 'parquet', required
    - `hash` string, nullable — The crc32c hash of the file, used to deduplicate the file.
    - `size_bytes` integer, nullable — The size of the file in bytes, used to compute the optimal number of chunks when chunking is enabled.
    - `use_chunks` boolean — Whether to split the the file into chunks and upload them in parallel.
  - `y_train_info` FileInfo, required
    - `format` 'csv' | 'parquet', required
    - `hash` string, nullable — The crc32c hash of the file, used to deduplicate the file.
    - `size_bytes` integer, nullable — The size of the file in bytes, used to compute the optimal number of chunks when chunking is enabled.
    - `use_chunks` boolean — Whether to split the the file into chunks and upload them in parallel.
  - `description` string, nullable
  - `force_reupload` boolean — Whether to force the upload of the file even if a file with the same hash already exists.

## Response `200`

Successful Response

- PrepareTrainSetUploadResponse
  - `train_set_upload_id` string, uuid, required
  - `x_train_info` FileUploadInfo, required
    - `signed_urls` string[], required
    - `expires_at` number, required
    - `required_headers` object, required
  - `y_train_info` FileUploadInfo, required
    - `signed_urls` string[], required
    - `expires_at` number, required
    - `required_headers` object, required

## Other responses

- `409` — Conflict
- `default` — Default Response

---

[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)
