Skip to main content
POST
/
api
/
repos
/
{namespace}
/
{repo_name}
/
evaluations
/
*resource_path
Create an evaluation
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",
    "inserted_at": "<string>",
    "is_sample": true,
    "model": {},
    "name": "<string>",
    "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>",
    "target_branch": "<string>",
    "target_column": "<string>",
    "target_path": "<string>",
    "tokens_used": 123
  },
  "status": "<string>",
  "status_message": "<string>"
}
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

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.

input_type
enum<string>
required

Type of input data

Available options:
text,
image,
video
model_id
string<uuid>
required

ID of the model to run inference with

output_type
enum<string>
required

Type of output produced by the model

Available options:
text,
image,
video,
embeddings
prompt
string
required

Prompt template sent to the model. Use {column_name} placeholders to inject values from each row.

target_column
string
required

Column where the model output will be written

auto_commit
boolean
default:false

If true, automatically commit the results when the evaluation completes

batch_size
integer
default:10

Number of rows to process per inference batch

commit_message
string | null

Commit message used when auto_commit is true

is_sample
boolean
default:false

If true, only evaluate a subset of rows. If false, evaluate all rows.

name
string

Human-readable name for the evaluation

sample_count
integer
default:10

Number of rows to sample when is_sample is true

target_branch
string

Branch where evaluation results are committed

target_path
string

File path for the output data frame

Response

Evaluation created

Standard response wrapper for a single evaluation.

evaluation
Evaluation · object

Evaluation resource

status
string

High-level status string (for example, 'success').

status_message
string

Human-readable status message (for example, 'resource_found').