Create Dataset
Create a dataset in your Fireworks account from a dataset object and datasetId, or derive one from an existing dataset with sourceDatasetId and a filter.
curl --request POST \
--url https://api.fireworks.ai/v1/accounts/{account_id}/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset": {
"displayName": "<string>",
"exampleCount": "<string>",
"userUploaded": {},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"sourceJobName": "<string>"
},
"datasetId": "<string>",
"sourceDatasetId": "<string>",
"filter": "<string>"
}
'import requests
url = "https://api.fireworks.ai/v1/accounts/{account_id}/datasets"
payload = {
"dataset": {
"displayName": "<string>",
"exampleCount": "<string>",
"userUploaded": {},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"sourceJobName": "<string>"
},
"datasetId": "<string>",
"sourceDatasetId": "<string>",
"filter": "<string>"
}
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({
dataset: {
displayName: '<string>',
exampleCount: '<string>',
userUploaded: {},
evalProtocol: {},
externalUrl: '<string>',
format: 'FORMAT_UNSPECIFIED',
sourceJobName: '<string>'
},
datasetId: '<string>',
sourceDatasetId: '<string>',
filter: '<string>'
})
};
fetch('https://api.fireworks.ai/v1/accounts/{account_id}/datasets', 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.fireworks.ai/v1/accounts/{account_id}/datasets",
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([
'dataset' => [
'displayName' => '<string>',
'exampleCount' => '<string>',
'userUploaded' => [
],
'evalProtocol' => [
],
'externalUrl' => '<string>',
'format' => 'FORMAT_UNSPECIFIED',
'sourceJobName' => '<string>'
],
'datasetId' => '<string>',
'sourceDatasetId' => '<string>',
'filter' => '<string>'
]),
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.fireworks.ai/v1/accounts/{account_id}/datasets"
payload := strings.NewReader("{\n \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\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.fireworks.ai/v1/accounts/{account_id}/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireworks.ai/v1/accounts/{account_id}/datasets")
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 \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"displayName": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"state": "STATE_UNSPECIFIED",
"status": {
"code": "OK",
"message": "<string>"
},
"exampleCount": "<string>",
"userUploaded": {},
"evaluationResult": {
"evaluationJobId": "<string>"
},
"transformed": {
"sourceDatasetId": "<string>",
"filter": "<string>",
"originalFormat": "FORMAT_UNSPECIFIED"
},
"splitted": {
"sourceDatasetId": "<string>"
},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"createdBy": "<string>",
"updateTime": "2023-11-07T05:31:56Z",
"sourceJobName": "<string>",
"estimatedTokenCount": "<string>",
"averageTurnCount": 123,
"encryptionState": "ENCRYPTION_STATE_UNSPECIFIED"
}Authorizations
Bearer authentication using your Fireworks API key. Format: Bearer <API_KEY>
Path Parameters
The Account Id
Body
Response
A successful response.
STATE_UNSPECIFIED, UPLOADING, READY Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
FORMAT_UNSPECIFIED, CHAT, COMPLETION, RL The email address of the user who initiated this fine-tuning job.
The update time for the dataset.
The resource name of the job that created this dataset (e.g., batch inference job). Used for lineage tracking to understand dataset provenance.
The estimated number of tokens in the dataset.
An estimate of the average number of turns per sample in the dataset.
CMEK encryption state (authoritative, immutable, stamped at creation).
ENCRYPTION_STATE_UNSPECIFIED, ENCRYPTION_STATE_PLAINTEXT, ENCRYPTION_STATE_CMEK Was this page helpful?
curl --request POST \
--url https://api.fireworks.ai/v1/accounts/{account_id}/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset": {
"displayName": "<string>",
"exampleCount": "<string>",
"userUploaded": {},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"sourceJobName": "<string>"
},
"datasetId": "<string>",
"sourceDatasetId": "<string>",
"filter": "<string>"
}
'import requests
url = "https://api.fireworks.ai/v1/accounts/{account_id}/datasets"
payload = {
"dataset": {
"displayName": "<string>",
"exampleCount": "<string>",
"userUploaded": {},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"sourceJobName": "<string>"
},
"datasetId": "<string>",
"sourceDatasetId": "<string>",
"filter": "<string>"
}
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({
dataset: {
displayName: '<string>',
exampleCount: '<string>',
userUploaded: {},
evalProtocol: {},
externalUrl: '<string>',
format: 'FORMAT_UNSPECIFIED',
sourceJobName: '<string>'
},
datasetId: '<string>',
sourceDatasetId: '<string>',
filter: '<string>'
})
};
fetch('https://api.fireworks.ai/v1/accounts/{account_id}/datasets', 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.fireworks.ai/v1/accounts/{account_id}/datasets",
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([
'dataset' => [
'displayName' => '<string>',
'exampleCount' => '<string>',
'userUploaded' => [
],
'evalProtocol' => [
],
'externalUrl' => '<string>',
'format' => 'FORMAT_UNSPECIFIED',
'sourceJobName' => '<string>'
],
'datasetId' => '<string>',
'sourceDatasetId' => '<string>',
'filter' => '<string>'
]),
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.fireworks.ai/v1/accounts/{account_id}/datasets"
payload := strings.NewReader("{\n \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\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.fireworks.ai/v1/accounts/{account_id}/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireworks.ai/v1/accounts/{account_id}/datasets")
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 \"dataset\": {\n \"displayName\": \"<string>\",\n \"exampleCount\": \"<string>\",\n \"userUploaded\": {},\n \"evalProtocol\": {},\n \"externalUrl\": \"<string>\",\n \"format\": \"FORMAT_UNSPECIFIED\",\n \"sourceJobName\": \"<string>\"\n },\n \"datasetId\": \"<string>\",\n \"sourceDatasetId\": \"<string>\",\n \"filter\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"displayName": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"state": "STATE_UNSPECIFIED",
"status": {
"code": "OK",
"message": "<string>"
},
"exampleCount": "<string>",
"userUploaded": {},
"evaluationResult": {
"evaluationJobId": "<string>"
},
"transformed": {
"sourceDatasetId": "<string>",
"filter": "<string>",
"originalFormat": "FORMAT_UNSPECIFIED"
},
"splitted": {
"sourceDatasetId": "<string>"
},
"evalProtocol": {},
"externalUrl": "<string>",
"format": "FORMAT_UNSPECIFIED",
"createdBy": "<string>",
"updateTime": "2023-11-07T05:31:56Z",
"sourceJobName": "<string>",
"estimatedTokenCount": "<string>",
"averageTurnCount": 123,
"encryptionState": "ENCRYPTION_STATE_UNSPECIFIED"
}