Create Training Run Route
curl --request POST \
--url https://api.trajectory.ai/api/v1/train \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"bench_id": "<string>",
"training_options": {
"max_output_tokens_per_step": 2,
"max_total_tokens_per_trajectory": 2,
"max_turns_per_trajectory": 2,
"max_tool_calls_per_step": 1,
"max_response_chars_per_tool_call": 2
}
}
'import requests
url = "https://api.trajectory.ai/api/v1/train"
payload = {
"bench_id": "<string>",
"training_options": {
"max_output_tokens_per_step": 2,
"max_total_tokens_per_trajectory": 2,
"max_turns_per_trajectory": 2,
"max_tool_calls_per_step": 1,
"max_response_chars_per_tool_call": 2
}
}
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({
bench_id: '<string>',
training_options: {
max_output_tokens_per_step: 2,
max_total_tokens_per_trajectory: 2,
max_turns_per_trajectory: 2,
max_tool_calls_per_step: 1,
max_response_chars_per_tool_call: 2
}
})
};
fetch('https://api.trajectory.ai/api/v1/train', 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/train",
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([
'bench_id' => '<string>',
'training_options' => [
'max_output_tokens_per_step' => 2,
'max_total_tokens_per_trajectory' => 2,
'max_turns_per_trajectory' => 2,
'max_tool_calls_per_step' => 1,
'max_response_chars_per_tool_call' => 2
]
]),
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/train"
payload := strings.NewReader("{\n \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\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/train")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/train")
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 \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"training_run_id": "<string>",
"pipeline_run_id": "<string>",
"execution_id": "<string>",
"pipeline_name": "<string>",
"display_name": "<string>",
"experiment_name": "<string>",
"resolved_trajectory_options": {
"max_output_tokens_per_step": 123,
"max_total_tokens_per_trajectory": 123,
"max_turns_per_trajectory": 123,
"max_tool_calls_per_step": 123,
"max_response_chars_per_tool_call": 123,
"timeout_seconds": 123
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}training
Create Training Run Route
Create and launch an eval, train, and post-training eval workflow.
POST
/
api
/
v1
/
train
Create Training Run Route
curl --request POST \
--url https://api.trajectory.ai/api/v1/train \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"bench_id": "<string>",
"training_options": {
"max_output_tokens_per_step": 2,
"max_total_tokens_per_trajectory": 2,
"max_turns_per_trajectory": 2,
"max_tool_calls_per_step": 1,
"max_response_chars_per_tool_call": 2
}
}
'import requests
url = "https://api.trajectory.ai/api/v1/train"
payload = {
"bench_id": "<string>",
"training_options": {
"max_output_tokens_per_step": 2,
"max_total_tokens_per_trajectory": 2,
"max_turns_per_trajectory": 2,
"max_tool_calls_per_step": 1,
"max_response_chars_per_tool_call": 2
}
}
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({
bench_id: '<string>',
training_options: {
max_output_tokens_per_step: 2,
max_total_tokens_per_trajectory: 2,
max_turns_per_trajectory: 2,
max_tool_calls_per_step: 1,
max_response_chars_per_tool_call: 2
}
})
};
fetch('https://api.trajectory.ai/api/v1/train', 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/train",
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([
'bench_id' => '<string>',
'training_options' => [
'max_output_tokens_per_step' => 2,
'max_total_tokens_per_trajectory' => 2,
'max_turns_per_trajectory' => 2,
'max_tool_calls_per_step' => 1,
'max_response_chars_per_tool_call' => 2
]
]),
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/train"
payload := strings.NewReader("{\n \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\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/train")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/train")
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 \"bench_id\": \"<string>\",\n \"training_options\": {\n \"max_output_tokens_per_step\": 2,\n \"max_total_tokens_per_trajectory\": 2,\n \"max_turns_per_trajectory\": 2,\n \"max_tool_calls_per_step\": 1,\n \"max_response_chars_per_tool_call\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"training_run_id": "<string>",
"pipeline_run_id": "<string>",
"execution_id": "<string>",
"pipeline_name": "<string>",
"display_name": "<string>",
"experiment_name": "<string>",
"resolved_trajectory_options": {
"max_output_tokens_per_step": 123,
"max_total_tokens_per_trajectory": 123,
"max_turns_per_trajectory": 123,
"max_tool_calls_per_step": 123,
"max_response_chars_per_tool_call": 123,
"timeout_seconds": 123
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}Authorizations
Organization API key
Body
application/json
Base model to evaluate, train, and evaluate again.
Available options:
Qwen/Qwen3.5-4B, Qwen/Qwen3.5-397B-A17B, Qwen/Qwen3.6-35B-A3B, nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16, nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16, nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16, openai/gpt-5-mini, openai/gpt-5.4-mini, openai/gpt-5.5, anthropic/claude-sonnet-4.6, google/gemini-3.1-pro-preview Optional settings applied to every stage of the training pipeline.
Show child attributes
Show child attributes
Response
Successful Response
User-facing name for the training run.
Show child attributes
Show child attributes
⌘I