Diff Benchmark Tasks
curl --request POST \
--url https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"manifest": {
"name": "<string>",
"tasks": [
{
"name": "<string>",
"run_command": "<string>",
"id": "<string>",
"input_messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"id": "<string>",
"raw_string": "<string>",
"argument_encoding": "json",
"is_parsed_successfully": true,
"parser_error_msg": "<string>"
}
],
"tool_response": {
"id": "<string>",
"name": "<string>",
"arguments": {},
"response": "<unknown>",
"error": "<string>",
"raw_name_args": "<string>",
"metadata": {
"generated_tool_info": {
"provider": "<string>",
"model": "<string>",
"messages": "<array>"
}
},
"duration_seconds": 123,
"is_env_done": false
},
"tool_definitions": [
{
"name": "<string>",
"description": "<string>",
"parameters": {}
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"finish_reason": "<string>",
"metadata": {},
"reasoning": "<string>",
"reasoning_details": "<unknown>",
"tokens": [
123
],
"token_masks": [
123
],
"logprobs": [
123
],
"trainable_status": "not_trainable"
}
],
"reference_trajectory_id": "<string>",
"image": null,
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
},
"env_vars": {},
"env_resources": {
"cpus": 123,
"memory_mb": 123,
"gpus": 0,
"network_mode": "no-network",
"allowed_hosts": [
"<string>"
],
"agent_user": "<string>",
"env": {},
"setup_commands": [
[
"<string>"
]
],
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
]
}
],
"allow_internet": true
},
"spec": {},
"task_spec_uri": "<string>",
"filemount": {
"path": "<string>",
"dest": ""
},
"tags": [
"<string>"
]
}
],
"description": "",
"source_format": "sdk",
"visibility": "private",
"family": "<string>",
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
}
},
"artifacts": {}
}
'import requests
url = "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff"
payload = {
"manifest": {
"name": "<string>",
"tasks": [
{
"name": "<string>",
"run_command": "<string>",
"id": "<string>",
"input_messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"id": "<string>",
"raw_string": "<string>",
"argument_encoding": "json",
"is_parsed_successfully": True,
"parser_error_msg": "<string>"
}
],
"tool_response": {
"id": "<string>",
"name": "<string>",
"arguments": {},
"response": "<unknown>",
"error": "<string>",
"raw_name_args": "<string>",
"metadata": { "generated_tool_info": {
"provider": "<string>",
"model": "<string>",
"messages": "<array>"
} },
"duration_seconds": 123,
"is_env_done": False
},
"tool_definitions": [
{
"name": "<string>",
"description": "<string>",
"parameters": {}
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"finish_reason": "<string>",
"metadata": {},
"reasoning": "<string>",
"reasoning_details": "<unknown>",
"tokens": [123],
"token_masks": [123],
"logprobs": [123],
"trainable_status": "not_trainable"
}
],
"reference_trajectory_id": "<string>",
"image": None,
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
},
"env_vars": {},
"env_resources": {
"cpus": 123,
"memory_mb": 123,
"gpus": 0,
"network_mode": "no-network",
"allowed_hosts": ["<string>"],
"agent_user": "<string>",
"env": {},
"setup_commands": [["<string>"]],
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": ["<string>"]
}
],
"allow_internet": True
},
"spec": {},
"task_spec_uri": "<string>",
"filemount": {
"path": "<string>",
"dest": ""
},
"tags": ["<string>"]
}
],
"description": "",
"source_format": "sdk",
"visibility": "private",
"family": "<string>",
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
}
},
"artifacts": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
tasks: [
{
name: '<string>',
run_command: '<string>',
id: '<string>',
input_messages: [
{
role: '<string>',
content: '<string>',
tool_calls: [
{
name: '<string>',
arguments: {},
id: '<string>',
raw_string: '<string>',
argument_encoding: 'json',
is_parsed_successfully: true,
parser_error_msg: '<string>'
}
],
tool_response: {
id: '<string>',
name: '<string>',
arguments: {},
response: '<unknown>',
error: '<string>',
raw_name_args: '<string>',
metadata: {
generated_tool_info: {provider: '<string>', model: '<string>', messages: '<array>'}
},
duration_seconds: 123,
is_env_done: false
},
tool_definitions: [{name: '<string>', description: '<string>', parameters: {}}],
usage: {prompt_tokens: 0, completion_tokens: 0, total_tokens: 0},
finish_reason: '<string>',
metadata: {},
reasoning: '<string>',
reasoning_details: '<unknown>',
tokens: [123],
token_masks: [123],
logprobs: [123],
trainable_status: 'not_trainable'
}
],
reference_trajectory_id: '<string>',
image: null,
runtime: {
runtime_id: '<string>',
source: {dockerfile_path: '<string>', image_ref: '<string>'}
},
env_vars: {},
env_resources: {
cpus: 123,
memory_mb: 123,
gpus: 0,
network_mode: 'no-network',
allowed_hosts: ['<string>'],
agent_user: '<string>',
env: {},
setup_commands: [['<string>']],
mcp_servers: [
{
name: '<string>',
transport: 'sse',
url: '<string>',
command: '<string>',
args: ['<string>']
}
],
allow_internet: true
},
spec: {},
task_spec_uri: '<string>',
filemount: {path: '<string>', dest: ''},
tags: ['<string>']
}
],
description: '',
source_format: 'sdk',
visibility: 'private',
family: '<string>',
runtime: {
runtime_id: '<string>',
source: {dockerfile_path: '<string>', image_ref: '<string>'}
}
},
artifacts: {}
})
};
fetch('https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff', 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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff",
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([
'manifest' => [
'name' => '<string>',
'tasks' => [
[
'name' => '<string>',
'run_command' => '<string>',
'id' => '<string>',
'input_messages' => [
[
'role' => '<string>',
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'arguments' => [
],
'id' => '<string>',
'raw_string' => '<string>',
'argument_encoding' => 'json',
'is_parsed_successfully' => true,
'parser_error_msg' => '<string>'
]
],
'tool_response' => [
'id' => '<string>',
'name' => '<string>',
'arguments' => [
],
'response' => '<unknown>',
'error' => '<string>',
'raw_name_args' => '<string>',
'metadata' => [
'generated_tool_info' => [
'provider' => '<string>',
'model' => '<string>',
'messages' => '<array>'
]
],
'duration_seconds' => 123,
'is_env_done' => false
],
'tool_definitions' => [
[
'name' => '<string>',
'description' => '<string>',
'parameters' => [
]
]
],
'usage' => [
'prompt_tokens' => 0,
'completion_tokens' => 0,
'total_tokens' => 0
],
'finish_reason' => '<string>',
'metadata' => [
],
'reasoning' => '<string>',
'reasoning_details' => '<unknown>',
'tokens' => [
123
],
'token_masks' => [
123
],
'logprobs' => [
123
],
'trainable_status' => 'not_trainable'
]
],
'reference_trajectory_id' => '<string>',
'image' => null,
'runtime' => [
'runtime_id' => '<string>',
'source' => [
'dockerfile_path' => '<string>',
'image_ref' => '<string>'
]
],
'env_vars' => [
],
'env_resources' => [
'cpus' => 123,
'memory_mb' => 123,
'gpus' => 0,
'network_mode' => 'no-network',
'allowed_hosts' => [
'<string>'
],
'agent_user' => '<string>',
'env' => [
],
'setup_commands' => [
[
'<string>'
]
],
'mcp_servers' => [
[
'name' => '<string>',
'transport' => 'sse',
'url' => '<string>',
'command' => '<string>',
'args' => [
'<string>'
]
]
],
'allow_internet' => true
],
'spec' => [
],
'task_spec_uri' => '<string>',
'filemount' => [
'path' => '<string>',
'dest' => ''
],
'tags' => [
'<string>'
]
]
],
'description' => '',
'source_format' => 'sdk',
'visibility' => 'private',
'family' => '<string>',
'runtime' => [
'runtime_id' => '<string>',
'source' => [
'dockerfile_path' => '<string>',
'image_ref' => '<string>'
]
]
],
'artifacts' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}"
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"new": [
"<string>"
],
"present": [
"<string>"
],
"updated": [
"<string>"
],
"task_count": 123
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}benchmarks
Diff Benchmark Tasks
Split submitted tasks into new tasks, tasks already stored with identical content, and updates whose names are stored with different content. Lets a client upload only what is missing or changed.
POST
/
api
/
v1
/
benchmarks
/
{bench_id}
/
tasks:diff
Diff Benchmark Tasks
curl --request POST \
--url https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"manifest": {
"name": "<string>",
"tasks": [
{
"name": "<string>",
"run_command": "<string>",
"id": "<string>",
"input_messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"id": "<string>",
"raw_string": "<string>",
"argument_encoding": "json",
"is_parsed_successfully": true,
"parser_error_msg": "<string>"
}
],
"tool_response": {
"id": "<string>",
"name": "<string>",
"arguments": {},
"response": "<unknown>",
"error": "<string>",
"raw_name_args": "<string>",
"metadata": {
"generated_tool_info": {
"provider": "<string>",
"model": "<string>",
"messages": "<array>"
}
},
"duration_seconds": 123,
"is_env_done": false
},
"tool_definitions": [
{
"name": "<string>",
"description": "<string>",
"parameters": {}
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"finish_reason": "<string>",
"metadata": {},
"reasoning": "<string>",
"reasoning_details": "<unknown>",
"tokens": [
123
],
"token_masks": [
123
],
"logprobs": [
123
],
"trainable_status": "not_trainable"
}
],
"reference_trajectory_id": "<string>",
"image": null,
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
},
"env_vars": {},
"env_resources": {
"cpus": 123,
"memory_mb": 123,
"gpus": 0,
"network_mode": "no-network",
"allowed_hosts": [
"<string>"
],
"agent_user": "<string>",
"env": {},
"setup_commands": [
[
"<string>"
]
],
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
]
}
],
"allow_internet": true
},
"spec": {},
"task_spec_uri": "<string>",
"filemount": {
"path": "<string>",
"dest": ""
},
"tags": [
"<string>"
]
}
],
"description": "",
"source_format": "sdk",
"visibility": "private",
"family": "<string>",
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
}
},
"artifacts": {}
}
'import requests
url = "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff"
payload = {
"manifest": {
"name": "<string>",
"tasks": [
{
"name": "<string>",
"run_command": "<string>",
"id": "<string>",
"input_messages": [
{
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"id": "<string>",
"raw_string": "<string>",
"argument_encoding": "json",
"is_parsed_successfully": True,
"parser_error_msg": "<string>"
}
],
"tool_response": {
"id": "<string>",
"name": "<string>",
"arguments": {},
"response": "<unknown>",
"error": "<string>",
"raw_name_args": "<string>",
"metadata": { "generated_tool_info": {
"provider": "<string>",
"model": "<string>",
"messages": "<array>"
} },
"duration_seconds": 123,
"is_env_done": False
},
"tool_definitions": [
{
"name": "<string>",
"description": "<string>",
"parameters": {}
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"finish_reason": "<string>",
"metadata": {},
"reasoning": "<string>",
"reasoning_details": "<unknown>",
"tokens": [123],
"token_masks": [123],
"logprobs": [123],
"trainable_status": "not_trainable"
}
],
"reference_trajectory_id": "<string>",
"image": None,
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
},
"env_vars": {},
"env_resources": {
"cpus": 123,
"memory_mb": 123,
"gpus": 0,
"network_mode": "no-network",
"allowed_hosts": ["<string>"],
"agent_user": "<string>",
"env": {},
"setup_commands": [["<string>"]],
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": ["<string>"]
}
],
"allow_internet": True
},
"spec": {},
"task_spec_uri": "<string>",
"filemount": {
"path": "<string>",
"dest": ""
},
"tags": ["<string>"]
}
],
"description": "",
"source_format": "sdk",
"visibility": "private",
"family": "<string>",
"runtime": {
"runtime_id": "<string>",
"source": {
"dockerfile_path": "<string>",
"image_ref": "<string>"
}
}
},
"artifacts": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
tasks: [
{
name: '<string>',
run_command: '<string>',
id: '<string>',
input_messages: [
{
role: '<string>',
content: '<string>',
tool_calls: [
{
name: '<string>',
arguments: {},
id: '<string>',
raw_string: '<string>',
argument_encoding: 'json',
is_parsed_successfully: true,
parser_error_msg: '<string>'
}
],
tool_response: {
id: '<string>',
name: '<string>',
arguments: {},
response: '<unknown>',
error: '<string>',
raw_name_args: '<string>',
metadata: {
generated_tool_info: {provider: '<string>', model: '<string>', messages: '<array>'}
},
duration_seconds: 123,
is_env_done: false
},
tool_definitions: [{name: '<string>', description: '<string>', parameters: {}}],
usage: {prompt_tokens: 0, completion_tokens: 0, total_tokens: 0},
finish_reason: '<string>',
metadata: {},
reasoning: '<string>',
reasoning_details: '<unknown>',
tokens: [123],
token_masks: [123],
logprobs: [123],
trainable_status: 'not_trainable'
}
],
reference_trajectory_id: '<string>',
image: null,
runtime: {
runtime_id: '<string>',
source: {dockerfile_path: '<string>', image_ref: '<string>'}
},
env_vars: {},
env_resources: {
cpus: 123,
memory_mb: 123,
gpus: 0,
network_mode: 'no-network',
allowed_hosts: ['<string>'],
agent_user: '<string>',
env: {},
setup_commands: [['<string>']],
mcp_servers: [
{
name: '<string>',
transport: 'sse',
url: '<string>',
command: '<string>',
args: ['<string>']
}
],
allow_internet: true
},
spec: {},
task_spec_uri: '<string>',
filemount: {path: '<string>', dest: ''},
tags: ['<string>']
}
],
description: '',
source_format: 'sdk',
visibility: 'private',
family: '<string>',
runtime: {
runtime_id: '<string>',
source: {dockerfile_path: '<string>', image_ref: '<string>'}
}
},
artifacts: {}
})
};
fetch('https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff', 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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff",
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([
'manifest' => [
'name' => '<string>',
'tasks' => [
[
'name' => '<string>',
'run_command' => '<string>',
'id' => '<string>',
'input_messages' => [
[
'role' => '<string>',
'content' => '<string>',
'tool_calls' => [
[
'name' => '<string>',
'arguments' => [
],
'id' => '<string>',
'raw_string' => '<string>',
'argument_encoding' => 'json',
'is_parsed_successfully' => true,
'parser_error_msg' => '<string>'
]
],
'tool_response' => [
'id' => '<string>',
'name' => '<string>',
'arguments' => [
],
'response' => '<unknown>',
'error' => '<string>',
'raw_name_args' => '<string>',
'metadata' => [
'generated_tool_info' => [
'provider' => '<string>',
'model' => '<string>',
'messages' => '<array>'
]
],
'duration_seconds' => 123,
'is_env_done' => false
],
'tool_definitions' => [
[
'name' => '<string>',
'description' => '<string>',
'parameters' => [
]
]
],
'usage' => [
'prompt_tokens' => 0,
'completion_tokens' => 0,
'total_tokens' => 0
],
'finish_reason' => '<string>',
'metadata' => [
],
'reasoning' => '<string>',
'reasoning_details' => '<unknown>',
'tokens' => [
123
],
'token_masks' => [
123
],
'logprobs' => [
123
],
'trainable_status' => 'not_trainable'
]
],
'reference_trajectory_id' => '<string>',
'image' => null,
'runtime' => [
'runtime_id' => '<string>',
'source' => [
'dockerfile_path' => '<string>',
'image_ref' => '<string>'
]
],
'env_vars' => [
],
'env_resources' => [
'cpus' => 123,
'memory_mb' => 123,
'gpus' => 0,
'network_mode' => 'no-network',
'allowed_hosts' => [
'<string>'
],
'agent_user' => '<string>',
'env' => [
],
'setup_commands' => [
[
'<string>'
]
],
'mcp_servers' => [
[
'name' => '<string>',
'transport' => 'sse',
'url' => '<string>',
'command' => '<string>',
'args' => [
'<string>'
]
]
],
'allow_internet' => true
],
'spec' => [
],
'task_spec_uri' => '<string>',
'filemount' => [
'path' => '<string>',
'dest' => ''
],
'tags' => [
'<string>'
]
]
],
'description' => '',
'source_format' => 'sdk',
'visibility' => 'private',
'family' => '<string>',
'runtime' => [
'runtime_id' => '<string>',
'source' => [
'dockerfile_path' => '<string>',
'image_ref' => '<string>'
]
]
],
'artifacts' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"run_command\": \"<string>\",\n \"id\": \"<string>\",\n \"input_messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"tool_calls\": [\n {\n \"name\": \"<string>\",\n \"arguments\": {},\n \"id\": \"<string>\",\n \"raw_string\": \"<string>\",\n \"argument_encoding\": \"json\",\n \"is_parsed_successfully\": true,\n \"parser_error_msg\": \"<string>\"\n }\n ],\n \"tool_response\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {},\n \"response\": \"<unknown>\",\n \"error\": \"<string>\",\n \"raw_name_args\": \"<string>\",\n \"metadata\": {\n \"generated_tool_info\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"messages\": \"<array>\"\n }\n },\n \"duration_seconds\": 123,\n \"is_env_done\": false\n },\n \"tool_definitions\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 0,\n \"completion_tokens\": 0,\n \"total_tokens\": 0\n },\n \"finish_reason\": \"<string>\",\n \"metadata\": {},\n \"reasoning\": \"<string>\",\n \"reasoning_details\": \"<unknown>\",\n \"tokens\": [\n 123\n ],\n \"token_masks\": [\n 123\n ],\n \"logprobs\": [\n 123\n ],\n \"trainable_status\": \"not_trainable\"\n }\n ],\n \"reference_trajectory_id\": \"<string>\",\n \"image\": null,\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n },\n \"env_vars\": {},\n \"env_resources\": {\n \"cpus\": 123,\n \"memory_mb\": 123,\n \"gpus\": 0,\n \"network_mode\": \"no-network\",\n \"allowed_hosts\": [\n \"<string>\"\n ],\n \"agent_user\": \"<string>\",\n \"env\": {},\n \"setup_commands\": [\n [\n \"<string>\"\n ]\n ],\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"transport\": \"sse\",\n \"url\": \"<string>\",\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"allow_internet\": true\n },\n \"spec\": {},\n \"task_spec_uri\": \"<string>\",\n \"filemount\": {\n \"path\": \"<string>\",\n \"dest\": \"\"\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"description\": \"\",\n \"source_format\": \"sdk\",\n \"visibility\": \"private\",\n \"family\": \"<string>\",\n \"runtime\": {\n \"runtime_id\": \"<string>\",\n \"source\": {\n \"dockerfile_path\": \"<string>\",\n \"image_ref\": \"<string>\"\n }\n }\n },\n \"artifacts\": {}\n}"
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"new": [
"<string>"
],
"present": [
"<string>"
],
"updated": [
"<string>"
],
"task_count": 123
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}Authorizations
Organization API key
Path Parameters
Body
application/json