Sandboxes
Create Sandbox
Provisions a sandbox VM with the requested shape and a dedicated,
persistent Archil disk. By default the response reports pending after
the runtime accepts the start. Set wait=true to hold for running; if
the wait budget expires, the response remains pending and startup
continues.
POST
/
api
/
sandboxes
Create a sandbox
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"vcpu_count": 1,
"mem_size_mib": 2048,
"base_image": "ubuntu:26.04",
"env": {},
"max_ttl_seconds": 28800,
"max_concurrent_execs": 32
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes"
payload = {
"name": "<string>",
"vcpu_count": 1,
"mem_size_mib": 2048,
"base_image": "ubuntu:26.04",
"env": {},
"max_ttl_seconds": 28800,
"max_concurrent_execs": 32
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
vcpu_count: 1,
mem_size_mib: 2048,
base_image: 'ubuntu:26.04',
env: {},
max_ttl_seconds: 28800,
max_concurrent_execs: 32
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes', 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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes",
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([
'name' => '<string>',
'vcpu_count' => 1,
'mem_size_mib' => 2048,
'base_image' => 'ubuntu:26.04',
'env' => [
],
'max_ttl_seconds' => 28800,
'max_concurrent_execs' => 32
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sandbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"vcpu_count": 123,
"mem_size_mib": 123,
"max_ttl_seconds": 123,
"max_concurrent_execs": 123,
"base_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"endpoints": [
{
"port": 32768,
"hostname": "<string>"
}
],
"running_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"exit_reason": "<string>"
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}Authorizations
API key
Query Parameters
Hold the request for a completed start or exec result
Body
application/json
Sandbox name, unique within the account. A random word-list name is generated when omitted.
Required string length:
1 - 63Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Required range:
1 <= x <= 32Required range:
256 <= x <= 65536Public Linux OCI image reference. Docker shorthand and tags are accepted.
Environment variables applied to every exec
Show child attributes
Show child attributes
Lifetime budget for each powered-on session. Activity does not extend the deadline; starting or resuming the sandbox begins a fresh session.
Required range:
60 <= x <= 28800Required range:
1 <= x <= 256Was this page helpful?
⌘I
Create a sandbox
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"vcpu_count": 1,
"mem_size_mib": 2048,
"base_image": "ubuntu:26.04",
"env": {},
"max_ttl_seconds": 28800,
"max_concurrent_execs": 32
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes"
payload = {
"name": "<string>",
"vcpu_count": 1,
"mem_size_mib": 2048,
"base_image": "ubuntu:26.04",
"env": {},
"max_ttl_seconds": 28800,
"max_concurrent_execs": 32
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
vcpu_count: 1,
mem_size_mib: 2048,
base_image: 'ubuntu:26.04',
env: {},
max_ttl_seconds: 28800,
max_concurrent_execs: 32
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes', 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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes",
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([
'name' => '<string>',
'vcpu_count' => 1,
'mem_size_mib' => 2048,
'base_image' => 'ubuntu:26.04',
'env' => [
],
'max_ttl_seconds' => 28800,
'max_concurrent_execs' => 32
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"vcpu_count\": 1,\n \"mem_size_mib\": 2048,\n \"base_image\": \"ubuntu:26.04\",\n \"env\": {},\n \"max_ttl_seconds\": 28800,\n \"max_concurrent_execs\": 32\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sandbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"vcpu_count": 123,
"mem_size_mib": 123,
"max_ttl_seconds": 123,
"max_concurrent_execs": 123,
"base_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"endpoints": [
{
"port": 32768,
"hostname": "<string>"
}
],
"running_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"exit_reason": "<string>"
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}