curl --request POST \
--url https://api.heybee.app/v1/experiments/{experiment_id}/samples \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/samples"
payload = {
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
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({
anchor_value: 'Hello, how are you?',
file_path: 'experiments/exp123/sample456.mp3',
parameters: {model: 'v2', temperature: 0.7},
suggestion_id: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/samples', 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.heybee.app/v1/experiments/{experiment_id}/samples",
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([
'anchor_value' => 'Hello, how are you?',
'file_path' => 'experiments/exp123/sample456.mp3',
'parameters' => [
'model' => 'v2',
'temperature' => 0.7
],
'suggestion_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
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.heybee.app/v1/experiments/{experiment_id}/samples"
payload := strings.NewReader("{\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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.heybee.app/v1/experiments/{experiment_id}/samples")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/samples")
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 \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"anchor_value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output_type": "text",
"parameters": {},
"anchor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anchor_text": "<string>",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"availability_status": "active",
"candidate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"candidate_key": "<string>",
"candidate_label": "<string>",
"candidate_metadata": {},
"comparisons": 123,
"content": {},
"content_hash": "<string>",
"content_origin": "local_storage",
"elo_rating": 123,
"file_url": "<string>",
"ingestion_batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"losses": 123,
"mean_score": 123,
"remote": {},
"score_count": 0,
"source_kind": "local",
"source_manifest_row": 123,
"source_sample_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thumbnail_url": "<string>",
"wins": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Sample
Create a sample after uploading the file.
The file must already be uploaded to the path returned by GET /upload-url.
curl --request POST \
--url https://api.heybee.app/v1/experiments/{experiment_id}/samples \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/samples"
payload = {
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
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({
anchor_value: 'Hello, how are you?',
file_path: 'experiments/exp123/sample456.mp3',
parameters: {model: 'v2', temperature: 0.7},
suggestion_id: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/samples', 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.heybee.app/v1/experiments/{experiment_id}/samples",
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([
'anchor_value' => 'Hello, how are you?',
'file_path' => 'experiments/exp123/sample456.mp3',
'parameters' => [
'model' => 'v2',
'temperature' => 0.7
],
'suggestion_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
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.heybee.app/v1/experiments/{experiment_id}/samples"
payload := strings.NewReader("{\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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.heybee.app/v1/experiments/{experiment_id}/samples")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/samples")
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 \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"anchor_value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output_type": "text",
"parameters": {},
"anchor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anchor_text": "<string>",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"availability_status": "active",
"candidate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"candidate_key": "<string>",
"candidate_label": "<string>",
"candidate_metadata": {},
"comparisons": 123,
"content": {},
"content_hash": "<string>",
"content_origin": "local_storage",
"elo_rating": 123,
"file_url": "<string>",
"ingestion_batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"losses": 123,
"mean_score": 123,
"remote": {},
"score_count": 0,
"source_kind": "local",
"source_manifest_row": 123,
"source_sample_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thumbnail_url": "<string>",
"wins": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request to create a sample after upload.
Path to the uploaded file in storage (bucket-relative)
Inline anchor reference used by ingestion-compatible sample creation.
Show child attributes
Show child attributes
Value of the anchor field for this sample (required if experiment has anchor_field)
Inline candidate metadata used by ingestion-compatible sample creation.
Show child attributes
Show child attributes
1 - 128Parameter values for this sample
Optional lineage reference when this sample is cloned from another sample
Optional generation suggestion ID used to produce this sample
Response
Successful Response
Sample response.
text, image, audio, video Signed download URL (short-lived)
local, huggingface Signed thumbnail URL (short-lived)

