cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/create-synthetic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form project_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form pairs_to_generate=2 \
--form files.items='@example-file'import requests
url = "http://studio.premai.io/api/v1/public/datasets/create-synthetic"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"pairs_to_generate": "2"
}
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('pairs_to_generate', '2');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('http://studio.premai.io/api/v1/public/datasets/create-synthetic', 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>"
}{
"error": "<string>"
}Datasets API
Create Synthetic Dataset
Start a synthetic data generation job for a project dataset.
POST
/
api
/
v1
/
public
/
datasets
/
create-synthetic
cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/create-synthetic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form project_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'name=<string>' \
--form pairs_to_generate=2 \
--form files.items='@example-file'import requests
url = "http://studio.premai.io/api/v1/public/datasets/create-synthetic"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"pairs_to_generate": "2"
}
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('pairs_to_generate', '2');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('http://studio.premai.io/api/v1/public/datasets/create-synthetic', 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>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Minimum string length:
1Required range:
x >= 1Optional: PDF, DOCX, etc.
Array of YouTube URLs
Array of website URLs
0.0-1.0, controls randomness
Required range:
0 <= x <= 1Array of rules and constraints
Question format template
Answer format template
Example questions
Example answers
Response
Dataset creation started
Was this page helpful?