cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/create-from-jsonl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form project_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form file='@example-file'import requests
url = "http://studio.premai.io/api/v1/public/datasets/create-from-jsonl"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('project_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('name', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('http://studio.premai.io/api/v1/public/datasets/create-from-jsonl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Datasets API
Create Dataset From JSONL
Upload a ready-made chat dataset (JSONL) and link it to an existing project.
POST
/
api
/
v1
/
public
/
datasets
/
create-from-jsonl
cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/create-from-jsonl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form project_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form file='@example-file'import requests
url = "http://studio.premai.io/api/v1/public/datasets/create-from-jsonl"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('project_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('name', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('http://studio.premai.io/api/v1/public/datasets/create-from-jsonl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Project ID that will own the dataset. Must match a project you created.
Human-readable name shown in the dashboard once the dataset is created.
Minimum string length:
1Required JSONL upload. Each line should be a JSON object containing a "messages" array (system/user/assistant) used to seed the dataset.
Response
Dataset created successfully
Was this page helpful?