curl --request POST \
--url 'https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt": "<string>",
"target_column": "<string>",
"auto_commit": false,
"batch_size": 10,
"commit_message": "<string>",
"is_sample": false,
"name": "<string>",
"sample_count": 10,
"target_branch": "<string>",
"target_path": "<string>"
}
'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path"
payload = {
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt": "<string>",
"target_column": "<string>",
"auto_commit": False,
"batch_size": 10,
"commit_message": "<string>",
"is_sample": False,
"name": "<string>",
"sample_count": 10,
"target_branch": "<string>",
"target_path": "<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({
model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
prompt: '<string>',
target_column: '<string>',
auto_commit: false,
batch_size: 10,
commit_message: '<string>',
is_sample: false,
name: '<string>',
sample_count: 10,
target_branch: '<string>',
target_path: '<string>'
})
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path",
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([
'model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'prompt' => '<string>',
'target_column' => '<string>',
'auto_commit' => false,
'batch_size' => 10,
'commit_message' => '<string>',
'is_sample' => false,
'name' => '<string>',
'sample_count' => 10,
'target_branch' => '<string>',
'target_path' => '<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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path"
payload := strings.NewReader("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path")
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 \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"evaluation": {
"cancelled_at": "<string>",
"completed_at": "<string>",
"completion_tokens_used": 123,
"created_by": {
"id": "<string>",
"image": "<string>",
"name": "<string>",
"username": "<string>"
},
"credits_used": 123,
"error_message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_type": "text",
"inserted_at": "<string>",
"is_sample": true,
"model": {},
"name": "<string>",
"output_type": "text",
"progress": {
"processed": 123,
"total": 123
},
"prompt": "<string>",
"prompt_tokens_used": 123,
"repository_id": "<string>",
"resource": {
"path": "<string>",
"version": "<string>"
},
"sample_count": 123,
"started_at": "<string>",
"status": "queued",
"target_branch": "<string>",
"target_column": "<string>",
"target_path": "<string>",
"tokens_used": 123
},
"status": "<string>",
"status_message": "<string>"
}{}Create an evaluation
Run model inference over a dataset in the repository. The resource path (branch and file) is encoded in the URL, e.g. POST /api/repos/{ns}/{repo}/evaluations/main/datasets/training.parquet.
curl --request POST \
--url 'https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt": "<string>",
"target_column": "<string>",
"auto_commit": false,
"batch_size": 10,
"commit_message": "<string>",
"is_sample": false,
"name": "<string>",
"sample_count": 10,
"target_branch": "<string>",
"target_path": "<string>"
}
'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path"
payload = {
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt": "<string>",
"target_column": "<string>",
"auto_commit": False,
"batch_size": 10,
"commit_message": "<string>",
"is_sample": False,
"name": "<string>",
"sample_count": 10,
"target_branch": "<string>",
"target_path": "<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({
model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
prompt: '<string>',
target_column: '<string>',
auto_commit: false,
batch_size: 10,
commit_message: '<string>',
is_sample: false,
name: '<string>',
sample_count: 10,
target_branch: '<string>',
target_path: '<string>'
})
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path",
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([
'model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'prompt' => '<string>',
'target_column' => '<string>',
'auto_commit' => false,
'batch_size' => 10,
'commit_message' => '<string>',
'is_sample' => false,
'name' => '<string>',
'sample_count' => 10,
'target_branch' => '<string>',
'target_path' => '<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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path"
payload := strings.NewReader("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/evaluations/*resource_path")
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 \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"prompt\": \"<string>\",\n \"target_column\": \"<string>\",\n \"auto_commit\": false,\n \"batch_size\": 10,\n \"commit_message\": \"<string>\",\n \"is_sample\": false,\n \"name\": \"<string>\",\n \"sample_count\": 10,\n \"target_branch\": \"<string>\",\n \"target_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"evaluation": {
"cancelled_at": "<string>",
"completed_at": "<string>",
"completion_tokens_used": 123,
"created_by": {
"id": "<string>",
"image": "<string>",
"name": "<string>",
"username": "<string>"
},
"credits_used": 123,
"error_message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_type": "text",
"inserted_at": "<string>",
"is_sample": true,
"model": {},
"name": "<string>",
"output_type": "text",
"progress": {
"processed": 123,
"total": 123
},
"prompt": "<string>",
"prompt_tokens_used": 123,
"repository_id": "<string>",
"resource": {
"path": "<string>",
"version": "<string>"
},
"sample_count": 123,
"started_at": "<string>",
"status": "queued",
"target_branch": "<string>",
"target_column": "<string>",
"target_path": "<string>",
"tokens_used": 123
},
"status": "<string>",
"status_message": "<string>"
}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Create evaluation request
Request payload to create an evaluation.
The resource path (branch + file path) is specified in the URL after /evaluations/,
for example: POST /api/repos/{namespace}/{repo}/evaluations/main/datasets/training.parquet.
Type of input data
text, image, video ID of the model to run inference with
Type of output produced by the model
text, image, video, embeddings Prompt template sent to the model. Use {column_name} placeholders to inject values from each row.
Column where the model output will be written
If true, automatically commit the results when the evaluation completes
Number of rows to process per inference batch
Commit message used when auto_commit is true
If true, only evaluate a subset of rows. If false, evaluate all rows.
Human-readable name for the evaluation
Number of rows to sample when is_sample is true
Branch where evaluation results are committed
File path for the output data frame