---
title: "Fit a Model"
method: POST
path: "/v1/fit"
tags: ["Training"]
deprecated: true
---

# Fit a Model

`POST /v1/fit`

> **Deprecated.**

**Deprecated:** Prefer the TabPFN client (`tabpfn-client`) or `POST /tabpfn/fit` after preparing uploads. This multipart `/v1/fit` surface is legacy. See the [TabPFN-3 changelog](/changelog/tabpfn-3).

Uploads and fits a TabPFN model on your training data. The API automatically handles preprocessing and stores a reference to your trained context (not the model weights). You can use either a single dataset file (with the target column included) or separate feature and label files.

## Response `200`

Model fitted successfully — returns a model ID for later prediction calls.

- FitResponse
  - `model_id` string, uuid, required — Unique identifier for the fitted model (used for prediction calls).
  - `task` 'classification' | 'regression', required — Specifies the type of task to perform — either classification or regression.

## Other responses

- `400` — Invalid request — missing data or malformed input.
- `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"}`
- `403` — Forbidden — user account not verified or insufficient permissions. **Possible causes:** - Valid token for an unverified user - Account not yet verified via email **Example response:** `{"code": "auth.forbidden", "detail": "User account not verified", "retryable": false, "support": "https://discord.com/invite/VJRuU3bSxt"}`
- `422` — Validation error — one or more fields are incorrectly formatted.

---

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