Create Sandbox Gang Endpoint
curl --request POST \
--url https://api.primeintellect.ai/api/v1/sandbox/gang \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sandboxes": [
{
"name": "<string>",
"docker_image": "<string>",
"checkpoint_id": "<string>",
"restore_memory": true,
"arch": "amd64",
"start_command": {
"executable": "<string>",
"args": [
"<string>"
]
},
"cpu_cores": 1,
"memory_gb": 1,
"disk_size_gb": 500.05,
"gpu_count": 0,
"vm": true,
"network_allowlist": [
"<string>"
],
"network_denylist": [
"<string>"
],
"network_rules": {},
"timeout_minutes": 60,
"idle_timeout_minutes": 123,
"environment_vars": {},
"secrets": {},
"labels": [
"<string>"
],
"volumes": [
{
"name": "<string>",
"mount_path": "<string>",
"read_only": false
}
],
"team_id": "<string>",
"advanced_configs": {},
"registry_credentials_id": "<string>",
"guaranteed": false,
"idempotency_key": "<string>"
}
],
"idempotency_key": "<string>"
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/gang"
payload = {
"sandboxes": [
{
"name": "<string>",
"docker_image": "<string>",
"checkpoint_id": "<string>",
"restore_memory": True,
"arch": "amd64",
"start_command": {
"executable": "<string>",
"args": ["<string>"]
},
"cpu_cores": 1,
"memory_gb": 1,
"disk_size_gb": 500.05,
"gpu_count": 0,
"vm": True,
"network_allowlist": ["<string>"],
"network_denylist": ["<string>"],
"network_rules": {},
"timeout_minutes": 60,
"idle_timeout_minutes": 123,
"environment_vars": {},
"secrets": {},
"labels": ["<string>"],
"volumes": [
{
"name": "<string>",
"mount_path": "<string>",
"read_only": False
}
],
"team_id": "<string>",
"advanced_configs": {},
"registry_credentials_id": "<string>",
"guaranteed": False,
"idempotency_key": "<string>"
}
],
"idempotency_key": "<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({
sandboxes: [
{
name: '<string>',
docker_image: '<string>',
checkpoint_id: '<string>',
restore_memory: true,
arch: 'amd64',
start_command: {executable: '<string>', args: ['<string>']},
cpu_cores: 1,
memory_gb: 1,
disk_size_gb: 500.05,
gpu_count: 0,
vm: true,
network_allowlist: ['<string>'],
network_denylist: ['<string>'],
network_rules: {},
timeout_minutes: 60,
idle_timeout_minutes: 123,
environment_vars: {},
secrets: {},
labels: ['<string>'],
volumes: [{name: '<string>', mount_path: '<string>', read_only: false}],
team_id: '<string>',
advanced_configs: {},
registry_credentials_id: '<string>',
guaranteed: false,
idempotency_key: '<string>'
}
],
idempotency_key: '<string>'
})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/gang', 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.primeintellect.ai/api/v1/sandbox/gang",
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([
'sandboxes' => [
[
'name' => '<string>',
'docker_image' => '<string>',
'checkpoint_id' => '<string>',
'restore_memory' => true,
'arch' => 'amd64',
'start_command' => [
'executable' => '<string>',
'args' => [
'<string>'
]
],
'cpu_cores' => 1,
'memory_gb' => 1,
'disk_size_gb' => 500.05,
'gpu_count' => 0,
'vm' => true,
'network_allowlist' => [
'<string>'
],
'network_denylist' => [
'<string>'
],
'network_rules' => [
],
'timeout_minutes' => 60,
'idle_timeout_minutes' => 123,
'environment_vars' => [
],
'secrets' => [
],
'labels' => [
'<string>'
],
'volumes' => [
[
'name' => '<string>',
'mount_path' => '<string>',
'read_only' => false
]
],
'team_id' => '<string>',
'advanced_configs' => [
],
'registry_credentials_id' => '<string>',
'guaranteed' => false,
'idempotency_key' => '<string>'
]
],
'idempotency_key' => '<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://api.primeintellect.ai/api/v1/sandbox/gang"
payload := strings.NewReader("{\n \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<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://api.primeintellect.ai/api/v1/sandbox/gang")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/gang")
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 \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"gang_id": "<string>",
"sandboxes": [
{
"id": "<string>",
"name": "<string>",
"dockerImage": "<string>",
"startCommand": {
"executable": "<string>",
"args": [
"<string>"
]
},
"cpuCores": 123,
"memoryGB": 123,
"diskSizeGB": 123,
"diskMountPath": "<string>",
"gpuCount": 123,
"status": "PENDING",
"timeoutMinutes": 123,
"environmentVars": {},
"advancedConfigs": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"terminatedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"teamId": "<string>",
"kubernetesJobId": "<string>",
"gpuType": "CPU_NODE",
"vm": false,
"network_allowlist": [
"<string>"
],
"network_denylist": [
"<string>"
],
"idleTimeoutMinutes": 123,
"terminationReason": "<string>",
"labels": [
"<string>"
],
"exitCode": 123,
"errorType": "<string>",
"errorMessage": "<string>",
"registryCredentialsId": "<string>",
"pendingImageBuildId": "<string>",
"gatewayAuth": {
"token": "<string>",
"gateway_url": "<string>",
"user_ns": "<string>",
"job_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sandbox
Create Sandbox Gang Endpoint
Create a gang of sandboxes scheduled together on one node.
All or nothing: if any member is rejected, members already created are terminated. Members boot independently; poll each one for RUNNING.
POST
/
api
/
v1
/
sandbox
/
gang
Create Sandbox Gang Endpoint
curl --request POST \
--url https://api.primeintellect.ai/api/v1/sandbox/gang \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sandboxes": [
{
"name": "<string>",
"docker_image": "<string>",
"checkpoint_id": "<string>",
"restore_memory": true,
"arch": "amd64",
"start_command": {
"executable": "<string>",
"args": [
"<string>"
]
},
"cpu_cores": 1,
"memory_gb": 1,
"disk_size_gb": 500.05,
"gpu_count": 0,
"vm": true,
"network_allowlist": [
"<string>"
],
"network_denylist": [
"<string>"
],
"network_rules": {},
"timeout_minutes": 60,
"idle_timeout_minutes": 123,
"environment_vars": {},
"secrets": {},
"labels": [
"<string>"
],
"volumes": [
{
"name": "<string>",
"mount_path": "<string>",
"read_only": false
}
],
"team_id": "<string>",
"advanced_configs": {},
"registry_credentials_id": "<string>",
"guaranteed": false,
"idempotency_key": "<string>"
}
],
"idempotency_key": "<string>"
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/gang"
payload = {
"sandboxes": [
{
"name": "<string>",
"docker_image": "<string>",
"checkpoint_id": "<string>",
"restore_memory": True,
"arch": "amd64",
"start_command": {
"executable": "<string>",
"args": ["<string>"]
},
"cpu_cores": 1,
"memory_gb": 1,
"disk_size_gb": 500.05,
"gpu_count": 0,
"vm": True,
"network_allowlist": ["<string>"],
"network_denylist": ["<string>"],
"network_rules": {},
"timeout_minutes": 60,
"idle_timeout_minutes": 123,
"environment_vars": {},
"secrets": {},
"labels": ["<string>"],
"volumes": [
{
"name": "<string>",
"mount_path": "<string>",
"read_only": False
}
],
"team_id": "<string>",
"advanced_configs": {},
"registry_credentials_id": "<string>",
"guaranteed": False,
"idempotency_key": "<string>"
}
],
"idempotency_key": "<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({
sandboxes: [
{
name: '<string>',
docker_image: '<string>',
checkpoint_id: '<string>',
restore_memory: true,
arch: 'amd64',
start_command: {executable: '<string>', args: ['<string>']},
cpu_cores: 1,
memory_gb: 1,
disk_size_gb: 500.05,
gpu_count: 0,
vm: true,
network_allowlist: ['<string>'],
network_denylist: ['<string>'],
network_rules: {},
timeout_minutes: 60,
idle_timeout_minutes: 123,
environment_vars: {},
secrets: {},
labels: ['<string>'],
volumes: [{name: '<string>', mount_path: '<string>', read_only: false}],
team_id: '<string>',
advanced_configs: {},
registry_credentials_id: '<string>',
guaranteed: false,
idempotency_key: '<string>'
}
],
idempotency_key: '<string>'
})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/gang', 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.primeintellect.ai/api/v1/sandbox/gang",
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([
'sandboxes' => [
[
'name' => '<string>',
'docker_image' => '<string>',
'checkpoint_id' => '<string>',
'restore_memory' => true,
'arch' => 'amd64',
'start_command' => [
'executable' => '<string>',
'args' => [
'<string>'
]
],
'cpu_cores' => 1,
'memory_gb' => 1,
'disk_size_gb' => 500.05,
'gpu_count' => 0,
'vm' => true,
'network_allowlist' => [
'<string>'
],
'network_denylist' => [
'<string>'
],
'network_rules' => [
],
'timeout_minutes' => 60,
'idle_timeout_minutes' => 123,
'environment_vars' => [
],
'secrets' => [
],
'labels' => [
'<string>'
],
'volumes' => [
[
'name' => '<string>',
'mount_path' => '<string>',
'read_only' => false
]
],
'team_id' => '<string>',
'advanced_configs' => [
],
'registry_credentials_id' => '<string>',
'guaranteed' => false,
'idempotency_key' => '<string>'
]
],
'idempotency_key' => '<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://api.primeintellect.ai/api/v1/sandbox/gang"
payload := strings.NewReader("{\n \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<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://api.primeintellect.ai/api/v1/sandbox/gang")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/gang")
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 \"sandboxes\": [\n {\n \"name\": \"<string>\",\n \"docker_image\": \"<string>\",\n \"checkpoint_id\": \"<string>\",\n \"restore_memory\": true,\n \"arch\": \"amd64\",\n \"start_command\": {\n \"executable\": \"<string>\",\n \"args\": [\n \"<string>\"\n ]\n },\n \"cpu_cores\": 1,\n \"memory_gb\": 1,\n \"disk_size_gb\": 500.05,\n \"gpu_count\": 0,\n \"vm\": true,\n \"network_allowlist\": [\n \"<string>\"\n ],\n \"network_denylist\": [\n \"<string>\"\n ],\n \"network_rules\": {},\n \"timeout_minutes\": 60,\n \"idle_timeout_minutes\": 123,\n \"environment_vars\": {},\n \"secrets\": {},\n \"labels\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"name\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false\n }\n ],\n \"team_id\": \"<string>\",\n \"advanced_configs\": {},\n \"registry_credentials_id\": \"<string>\",\n \"guaranteed\": false,\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"gang_id": "<string>",
"sandboxes": [
{
"id": "<string>",
"name": "<string>",
"dockerImage": "<string>",
"startCommand": {
"executable": "<string>",
"args": [
"<string>"
]
},
"cpuCores": 123,
"memoryGB": 123,
"diskSizeGB": 123,
"diskMountPath": "<string>",
"gpuCount": 123,
"status": "PENDING",
"timeoutMinutes": 123,
"environmentVars": {},
"advancedConfigs": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"terminatedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"teamId": "<string>",
"kubernetesJobId": "<string>",
"gpuType": "CPU_NODE",
"vm": false,
"network_allowlist": [
"<string>"
],
"network_denylist": [
"<string>"
],
"idleTimeoutMinutes": 123,
"terminationReason": "<string>",
"labels": [
"<string>"
],
"exitCode": 123,
"errorType": "<string>",
"errorMessage": "<string>",
"registryCredentialsId": "<string>",
"pendingImageBuildId": "<string>",
"gatewayAuth": {
"token": "<string>",
"gateway_url": "<string>",
"user_ns": "<string>",
"job_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Was this page helpful?