Start a sandbox
curl --request POST \
--url https://api.thundercompute.com:8443/v1/sandboxes/start \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"lifetime": {
"enforce_ttl": true,
"max_grace_seconds": 123,
"max_ttl_seconds": 123
},
"network_policy": {
"cidr_allowlist": [
"<string>"
],
"domain_allowlist": [
"<string>"
]
},
"spec": {
"cpu_count": 123,
"memory_gib": 123,
"storage_gib": 123,
"gpu_count": 123
},
"env": {},
"gatedFeatures": {},
"image_id": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.thundercompute.com:8443/v1/sandboxes/start"
payload = {
"lifetime": {
"enforce_ttl": True,
"max_grace_seconds": 123,
"max_ttl_seconds": 123
},
"network_policy": {
"cidr_allowlist": ["<string>"],
"domain_allowlist": ["<string>"]
},
"spec": {
"cpu_count": 123,
"memory_gib": 123,
"storage_gib": 123,
"gpu_count": 123
},
"env": {},
"gatedFeatures": {},
"image_id": "<string>",
"name": "<string>"
}
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({
lifetime: {enforce_ttl: true, max_grace_seconds: 123, max_ttl_seconds: 123},
network_policy: {cidr_allowlist: ['<string>'], domain_allowlist: ['<string>']},
spec: {cpu_count: 123, memory_gib: 123, storage_gib: 123, gpu_count: 123},
env: {},
gatedFeatures: {},
image_id: '<string>',
name: '<string>'
})
};
fetch('https://api.thundercompute.com:8443/v1/sandboxes/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://api.thundercompute.com:8443/v1/sandboxes/start",
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([
'lifetime' => [
'enforce_ttl' => true,
'max_grace_seconds' => 123,
'max_ttl_seconds' => 123
],
'network_policy' => [
'cidr_allowlist' => [
'<string>'
],
'domain_allowlist' => [
'<string>'
]
],
'spec' => [
'cpu_count' => 123,
'memory_gib' => 123,
'storage_gib' => 123,
'gpu_count' => 123
],
'env' => [
],
'gatedFeatures' => [
],
'image_id' => '<string>',
'name' => '<string>'
]),
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://api.thundercompute.com:8443/v1/sandboxes/start"
payload := strings.NewReader("{\n \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\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://api.thundercompute.com:8443/v1/sandboxes/start")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thundercompute.com:8443/v1/sandboxes/start")
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 \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}Sandboxes
Start a sandbox
POST
/
sandboxes
/
start
Start a sandbox
curl --request POST \
--url https://api.thundercompute.com:8443/v1/sandboxes/start \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"lifetime": {
"enforce_ttl": true,
"max_grace_seconds": 123,
"max_ttl_seconds": 123
},
"network_policy": {
"cidr_allowlist": [
"<string>"
],
"domain_allowlist": [
"<string>"
]
},
"spec": {
"cpu_count": 123,
"memory_gib": 123,
"storage_gib": 123,
"gpu_count": 123
},
"env": {},
"gatedFeatures": {},
"image_id": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.thundercompute.com:8443/v1/sandboxes/start"
payload = {
"lifetime": {
"enforce_ttl": True,
"max_grace_seconds": 123,
"max_ttl_seconds": 123
},
"network_policy": {
"cidr_allowlist": ["<string>"],
"domain_allowlist": ["<string>"]
},
"spec": {
"cpu_count": 123,
"memory_gib": 123,
"storage_gib": 123,
"gpu_count": 123
},
"env": {},
"gatedFeatures": {},
"image_id": "<string>",
"name": "<string>"
}
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({
lifetime: {enforce_ttl: true, max_grace_seconds: 123, max_ttl_seconds: 123},
network_policy: {cidr_allowlist: ['<string>'], domain_allowlist: ['<string>']},
spec: {cpu_count: 123, memory_gib: 123, storage_gib: 123, gpu_count: 123},
env: {},
gatedFeatures: {},
image_id: '<string>',
name: '<string>'
})
};
fetch('https://api.thundercompute.com:8443/v1/sandboxes/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://api.thundercompute.com:8443/v1/sandboxes/start",
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([
'lifetime' => [
'enforce_ttl' => true,
'max_grace_seconds' => 123,
'max_ttl_seconds' => 123
],
'network_policy' => [
'cidr_allowlist' => [
'<string>'
],
'domain_allowlist' => [
'<string>'
]
],
'spec' => [
'cpu_count' => 123,
'memory_gib' => 123,
'storage_gib' => 123,
'gpu_count' => 123
],
'env' => [
],
'gatedFeatures' => [
],
'image_id' => '<string>',
'name' => '<string>'
]),
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://api.thundercompute.com:8443/v1/sandboxes/start"
payload := strings.NewReader("{\n \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\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://api.thundercompute.com:8443/v1/sandboxes/start")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thundercompute.com:8443/v1/sandboxes/start")
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 \"lifetime\": {\n \"enforce_ttl\": true,\n \"max_grace_seconds\": 123,\n \"max_ttl_seconds\": 123\n },\n \"network_policy\": {\n \"cidr_allowlist\": [\n \"<string>\"\n ],\n \"domain_allowlist\": [\n \"<string>\"\n ]\n },\n \"spec\": {\n \"cpu_count\": 123,\n \"memory_gib\": 123,\n \"storage_gib\": 123,\n \"gpu_count\": 123\n },\n \"env\": {},\n \"gatedFeatures\": {},\n \"image_id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}{
"code": 400,
"error": "invalid_request",
"message": "The request is malformed"
}Authorizations
Bearer token authentication. Provide your API token prefixed with "Bearer ", e.g. "Bearer your-api-token".
Body
application/json
Sandbox start request
Sandbox start request
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
GatedFeatures contains optional feature settings restricted to administrators.
Show child attributes
Show child attributes
ImageID optionally selects a READY organization-owned container image. When omitted, the sandbox is a Firecracker VM without a container.
Name is an optional label. It must be free of any other live sandbox in the organization and defaults to the assigned ID. It never addresses a sandbox: requests are made by ID.
Was this page helpful?