Attach Project Training Run
curl --request POST \
--url https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"training_run_id": "<string>"
}
'import requests
url = "https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs"
payload = { "training_run_id": "<string>" }
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({training_run_id: '<string>'})
};
fetch('https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs', 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/projects/{project_id}/training-runs",
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([
'training_run_id' => '<string>'
]),
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/projects/{project_id}/training-runs"
payload := strings.NewReader("{\n \"training_run_id\": \"<string>\"\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/projects/{project_id}/training-runs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"training_run_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs")
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 \"training_run_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"training_run_id": "<string>",
"pipeline_run_id": "<string>",
"display_name": "<string>",
"status": "pending",
"bench_id": "<string>",
"base_model_slug": "<string>",
"options": {
"load_weights_only": true,
"load_optimizer": true,
"load_scheduler": true,
"load_dataset": true,
"full_parameter": true,
"density_aware_training": true,
"algorithm": "<string>",
"train_on_truncation": true,
"train_on_error": true,
"train_on_timeout": true,
"val_enabled": true,
"val_interval_steps": 123,
"val_num_tasks": 123,
"val_trajectories_per_task": 123,
"val_max_concurrent_trajectories": 123,
"val_final_wait_timeout_seconds": 123,
"learning_rate": 123,
"lr_warmup_steps": 123,
"lr_hold_steps": 123,
"lr_min_ratio": 123,
"reasoning_effort": "off",
"temperature": 123,
"top_p": 123,
"top_k": 123,
"val_reasoning_effort": "off",
"val_temperature": 123,
"val_top_p": 123,
"val_top_k": 123,
"val_max_output_tokens_per_turn": 123,
"val_max_output_tokens_per_trajectory": 123,
"val_max_turns_per_trajectory": 123,
"val_trajectory_timeout_seconds": 123,
"num_steps": 123,
"batch_size": 123,
"group_size": 123,
"shuffle_tasks": true,
"priority_trait": "iid",
"priority_aggregation": "avg",
"min_trajectories_per_group": 123,
"max_concurrent_trajectories": 123,
"max_staleness": 123,
"train_on_all_fail": true,
"train_on_all_pass": true,
"train_on_zero_advantage": true,
"trajectory_timeout_seconds": 123,
"batch_timeout_seconds": 123,
"max_output_tokens_per_turn": 123,
"max_output_tokens_per_trajectory": 123,
"max_turns_per_trajectory": 123,
"image_max_pixels": 123
},
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"has_training_execution": true,
"parent_checkpoint_id": "<string>",
"failure": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"context": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}{
"error": {
"type": "conflict_error",
"code": "conflict",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}Projects
Attach Project Training Run
Claim an unassigned training run without changing existing ownership.
POST
/
api
/
v1
/
projects
/
{project_id}
/
training-runs
Attach Project Training Run
curl --request POST \
--url https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"training_run_id": "<string>"
}
'import requests
url = "https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs"
payload = { "training_run_id": "<string>" }
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({training_run_id: '<string>'})
};
fetch('https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs', 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/projects/{project_id}/training-runs",
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([
'training_run_id' => '<string>'
]),
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/projects/{project_id}/training-runs"
payload := strings.NewReader("{\n \"training_run_id\": \"<string>\"\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/projects/{project_id}/training-runs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"training_run_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/projects/{project_id}/training-runs")
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 \"training_run_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"training_run_id": "<string>",
"pipeline_run_id": "<string>",
"display_name": "<string>",
"status": "pending",
"bench_id": "<string>",
"base_model_slug": "<string>",
"options": {
"load_weights_only": true,
"load_optimizer": true,
"load_scheduler": true,
"load_dataset": true,
"full_parameter": true,
"density_aware_training": true,
"algorithm": "<string>",
"train_on_truncation": true,
"train_on_error": true,
"train_on_timeout": true,
"val_enabled": true,
"val_interval_steps": 123,
"val_num_tasks": 123,
"val_trajectories_per_task": 123,
"val_max_concurrent_trajectories": 123,
"val_final_wait_timeout_seconds": 123,
"learning_rate": 123,
"lr_warmup_steps": 123,
"lr_hold_steps": 123,
"lr_min_ratio": 123,
"reasoning_effort": "off",
"temperature": 123,
"top_p": 123,
"top_k": 123,
"val_reasoning_effort": "off",
"val_temperature": 123,
"val_top_p": 123,
"val_top_k": 123,
"val_max_output_tokens_per_turn": 123,
"val_max_output_tokens_per_trajectory": 123,
"val_max_turns_per_trajectory": 123,
"val_trajectory_timeout_seconds": 123,
"num_steps": 123,
"batch_size": 123,
"group_size": 123,
"shuffle_tasks": true,
"priority_trait": "iid",
"priority_aggregation": "avg",
"min_trajectories_per_group": 123,
"max_concurrent_trajectories": 123,
"max_staleness": 123,
"train_on_all_fail": true,
"train_on_all_pass": true,
"train_on_zero_advantage": true,
"trajectory_timeout_seconds": 123,
"batch_timeout_seconds": 123,
"max_output_tokens_per_turn": 123,
"max_output_tokens_per_trajectory": 123,
"max_turns_per_trajectory": 123,
"image_max_pixels": 123
},
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"has_training_execution": true,
"parent_checkpoint_id": "<string>",
"failure": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"context": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}{
"error": {
"type": "conflict_error",
"code": "conflict",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}Response
Successful Response