Prepare train set upload
curl --request POST \
--url https://api.priorlabs.ai/tabpfn/prepare_train_set_upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"x_train_info": {
"filename": "X_train.csv",
"size_bytes": 1024,
"content_hash": "abc"
},
"y_train_info": {
"filename": "y_train.csv",
"size_bytes": 64,
"content_hash": "def"
}
}
'import requests
url = "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload"
payload = {
"x_train_info": {
"filename": "X_train.csv",
"size_bytes": 1024,
"content_hash": "abc"
},
"y_train_info": {
"filename": "y_train.csv",
"size_bytes": 64,
"content_hash": "def"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
x_train_info: {filename: 'X_train.csv', size_bytes: 1024, content_hash: 'abc'},
y_train_info: {filename: 'y_train.csv', size_bytes: 64, content_hash: 'def'}
})
};
fetch('https://api.priorlabs.ai/tabpfn/prepare_train_set_upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'x_train_info' => [
'filename' => 'X_train.csv',
'size_bytes' => 1024,
'content_hash' => 'abc'
],
'y_train_info' => [
'filename' => 'y_train.csv',
'size_bytes' => 64,
'content_hash' => 'def'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload"
payload := strings.NewReader("{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.priorlabs.ai/tabpfn/prepare_train_set_upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.priorlabs.ai/tabpfn/prepare_train_set_upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}"
response = http.request(request)
puts response.read_body{
"train_set_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"x_train_info": {
"signed_urls": [
"<string>"
],
"expires_at": 123,
"required_headers": {}
},
"y_train_info": {
"signed_urls": [
"<string>"
],
"expires_at": 123,
"required_headers": {}
}
}{
"message": "<string>",
"train_set_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_code": "DUPLICATE_TRAIN_SET_UPLOAD",
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detail": "<string>"
}{
"code": "auth.unauthorized",
"detail": "Invalid authentication credentials",
"retryable": false,
"support": "https://discord.com/invite/VJRuU3bSxt"
}Endpoints
Prepare train set upload
Recommended: Use 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.
POST
/
tabpfn
/
prepare_train_set_upload
Prepare train set upload
curl --request POST \
--url https://api.priorlabs.ai/tabpfn/prepare_train_set_upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"x_train_info": {
"filename": "X_train.csv",
"size_bytes": 1024,
"content_hash": "abc"
},
"y_train_info": {
"filename": "y_train.csv",
"size_bytes": 64,
"content_hash": "def"
}
}
'import requests
url = "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload"
payload = {
"x_train_info": {
"filename": "X_train.csv",
"size_bytes": 1024,
"content_hash": "abc"
},
"y_train_info": {
"filename": "y_train.csv",
"size_bytes": 64,
"content_hash": "def"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
x_train_info: {filename: 'X_train.csv', size_bytes: 1024, content_hash: 'abc'},
y_train_info: {filename: 'y_train.csv', size_bytes: 64, content_hash: 'def'}
})
};
fetch('https://api.priorlabs.ai/tabpfn/prepare_train_set_upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'x_train_info' => [
'filename' => 'X_train.csv',
'size_bytes' => 1024,
'content_hash' => 'abc'
],
'y_train_info' => [
'filename' => 'y_train.csv',
'size_bytes' => 64,
'content_hash' => 'def'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.priorlabs.ai/tabpfn/prepare_train_set_upload"
payload := strings.NewReader("{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.priorlabs.ai/tabpfn/prepare_train_set_upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.priorlabs.ai/tabpfn/prepare_train_set_upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"x_train_info\": {\n \"filename\": \"X_train.csv\",\n \"size_bytes\": 1024,\n \"content_hash\": \"abc\"\n },\n \"y_train_info\": {\n \"filename\": \"y_train.csv\",\n \"size_bytes\": 64,\n \"content_hash\": \"def\"\n }\n}"
response = http.request(request)
puts response.read_body{
"train_set_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"x_train_info": {
"signed_urls": [
"<string>"
],
"expires_at": 123,
"required_headers": {}
},
"y_train_info": {
"signed_urls": [
"<string>"
],
"expires_at": 123,
"required_headers": {}
}
}{
"message": "<string>",
"train_set_upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_code": "DUPLICATE_TRAIN_SET_UPLOAD",
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detail": "<string>"
}{
"code": "auth.unauthorized",
"detail": "Invalid authentication credentials",
"retryable": false,
"support": "https://discord.com/invite/VJRuU3bSxt"
}Authorizations
Bearer token for authentication, obtained after signing up and generating an API key.
Body
application/json
Was this page helpful?
⌘I