import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const benchmarkRunView = await client.benchmarks.startRun({ benchmark_id: 'benchmark_id' });
console.log(benchmarkRunView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
benchmark_run_view = client.benchmarks.start_run(
benchmark_id="benchmark_id",
)
print(benchmark_run_view.id)curl --request POST \
--url https://api.runloop.ai/v1/benchmarks/start_run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"benchmark_id": "<string>",
"run_name": "<string>",
"metadata": {},
"runProfile": {
"purpose": "<string>",
"envVars": {},
"secrets": {},
"launchParameters": {
"launch_commands": [
"<string>"
],
"available_ports": [
123
],
"keep_alive_time_seconds": 123,
"after_idle": {
"idle_time_seconds": 123
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>",
"lifecycle": {
"after_idle": {
"idle_time_seconds": 123
},
"resume_triggers": {
"http": true,
"axon_event": true
},
"lifecycle_hooks": {
"suspend_commands": [
"<string>"
],
"suspend_deadline_ms": 123
}
}
},
"mounts": [
{
"object_id": "<string>",
"object_path": "<string>",
"type": "object_mount"
}
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/benchmarks/start_run",
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([
'benchmark_id' => '<string>',
'run_name' => '<string>',
'metadata' => [
],
'runProfile' => [
'purpose' => '<string>',
'envVars' => [
],
'secrets' => [
],
'launchParameters' => [
'launch_commands' => [
'<string>'
],
'available_ports' => [
123
],
'keep_alive_time_seconds' => 123,
'after_idle' => [
'idle_time_seconds' => 123
],
'custom_cpu_cores' => 123,
'custom_gb_memory' => 123,
'custom_disk_size' => 123,
'user_parameters' => [
'username' => '<string>',
'uid' => 123
],
'required_services' => [
'<string>'
],
'network_policy_id' => '<string>',
'lifecycle' => [
'after_idle' => [
'idle_time_seconds' => 123
],
'resume_triggers' => [
'http' => true,
'axon_event' => true
],
'lifecycle_hooks' => [
'suspend_commands' => [
'<string>'
],
'suspend_deadline_ms' => 123
]
]
],
'mounts' => [
[
'object_id' => '<string>',
'object_path' => '<string>',
'type' => 'object_mount'
]
]
]
]),
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://api.runloop.ai/v1/benchmarks/start_run"
payload := strings.NewReader("{\n \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\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://api.runloop.ai/v1/benchmarks/start_run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/benchmarks/start_run")
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 \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"start_time_ms": 123,
"metadata": {},
"benchmark_id": "<string>",
"name": "<string>",
"duration_ms": 123,
"score": 123,
"purpose": "<string>",
"environment_variables": {},
"secrets_provided": {}
}Start a new BenchmarkRun.
Start a new BenchmarkRun based on the provided Benchmark.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const benchmarkRunView = await client.benchmarks.startRun({ benchmark_id: 'benchmark_id' });
console.log(benchmarkRunView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
benchmark_run_view = client.benchmarks.start_run(
benchmark_id="benchmark_id",
)
print(benchmark_run_view.id)curl --request POST \
--url https://api.runloop.ai/v1/benchmarks/start_run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"benchmark_id": "<string>",
"run_name": "<string>",
"metadata": {},
"runProfile": {
"purpose": "<string>",
"envVars": {},
"secrets": {},
"launchParameters": {
"launch_commands": [
"<string>"
],
"available_ports": [
123
],
"keep_alive_time_seconds": 123,
"after_idle": {
"idle_time_seconds": 123
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>",
"lifecycle": {
"after_idle": {
"idle_time_seconds": 123
},
"resume_triggers": {
"http": true,
"axon_event": true
},
"lifecycle_hooks": {
"suspend_commands": [
"<string>"
],
"suspend_deadline_ms": 123
}
}
},
"mounts": [
{
"object_id": "<string>",
"object_path": "<string>",
"type": "object_mount"
}
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/benchmarks/start_run",
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([
'benchmark_id' => '<string>',
'run_name' => '<string>',
'metadata' => [
],
'runProfile' => [
'purpose' => '<string>',
'envVars' => [
],
'secrets' => [
],
'launchParameters' => [
'launch_commands' => [
'<string>'
],
'available_ports' => [
123
],
'keep_alive_time_seconds' => 123,
'after_idle' => [
'idle_time_seconds' => 123
],
'custom_cpu_cores' => 123,
'custom_gb_memory' => 123,
'custom_disk_size' => 123,
'user_parameters' => [
'username' => '<string>',
'uid' => 123
],
'required_services' => [
'<string>'
],
'network_policy_id' => '<string>',
'lifecycle' => [
'after_idle' => [
'idle_time_seconds' => 123
],
'resume_triggers' => [
'http' => true,
'axon_event' => true
],
'lifecycle_hooks' => [
'suspend_commands' => [
'<string>'
],
'suspend_deadline_ms' => 123
]
]
],
'mounts' => [
[
'object_id' => '<string>',
'object_path' => '<string>',
'type' => 'object_mount'
]
]
]
]),
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://api.runloop.ai/v1/benchmarks/start_run"
payload := strings.NewReader("{\n \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\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://api.runloop.ai/v1/benchmarks/start_run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/benchmarks/start_run")
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 \"benchmark_id\": \"<string>\",\n \"run_name\": \"<string>\",\n \"metadata\": {},\n \"runProfile\": {\n \"purpose\": \"<string>\",\n \"envVars\": {},\n \"secrets\": {},\n \"launchParameters\": {\n \"launch_commands\": [\n \"<string>\"\n ],\n \"available_ports\": [\n 123\n ],\n \"keep_alive_time_seconds\": 123,\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"custom_cpu_cores\": 123,\n \"custom_gb_memory\": 123,\n \"custom_disk_size\": 123,\n \"user_parameters\": {\n \"username\": \"<string>\",\n \"uid\": 123\n },\n \"required_services\": [\n \"<string>\"\n ],\n \"network_policy_id\": \"<string>\",\n \"lifecycle\": {\n \"after_idle\": {\n \"idle_time_seconds\": 123\n },\n \"resume_triggers\": {\n \"http\": true,\n \"axon_event\": true\n },\n \"lifecycle_hooks\": {\n \"suspend_commands\": [\n \"<string>\"\n ],\n \"suspend_deadline_ms\": 123\n }\n }\n },\n \"mounts\": [\n {\n \"object_id\": \"<string>\",\n \"object_path\": \"<string>\",\n \"type\": \"object_mount\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"start_time_ms": 123,
"metadata": {},
"benchmark_id": "<string>",
"name": "<string>",
"duration_ms": 123,
"score": 123,
"purpose": "<string>",
"environment_variables": {},
"secrets_provided": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
ID of the Benchmark to run.
Display name of the run.
User defined metadata to attach to the benchmark run for organization.
Show child attributes
Show child attributes
Runtime configuration to use for this benchmark run
Show child attributes
Show child attributes
Response
OK
A BenchmarkRunView represents a run of a complete set of Scenarios, organized under a Benchmark or created by a BenchmarkJob.
The ID of the BenchmarkRun.
The time the benchmark run execution started (Unix timestamp milliseconds).
The state of the BenchmarkRun.
running, canceled, completed, failed User defined metadata to attach to the benchmark run for organization.
Show child attributes
Show child attributes
The ID of the Benchmark definition. Present if run was created from a benchmark definition.
The name of the BenchmarkRun.
The duration for the BenchmarkRun to complete.
The final score across the BenchmarkRun, present once completed. Calculated as sum of scenario scores / number of scenario runs.
Purpose of the run.
Environment variables used to run the benchmark.
Show child attributes
Show child attributes
User secrets used to run the benchmark. Example: {"DB_PASS": "DATABASE_PASSWORD"} would set the environment variable 'DB_PASS' on all scenario devboxes to the value of the secret 'DATABASE_PASSWORD'.
Show child attributes
Show child attributes
Was this page helpful?
