Get sandbox
curl --request GET \
--url https://api.blaxel.ai/v0/sandboxes/{sandboxName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/sandboxes/{sandboxName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/sandboxes/{sandboxName}', 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.blaxel.ai/v0/sandboxes/{sandboxName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blaxel.ai/v0/sandboxes/{sandboxName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blaxel.ai/v0/sandboxes/{sandboxName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/sandboxes/{sandboxName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "my-resource",
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"displayName": "My Resource",
"externalId": "my-session-123",
"labels": {},
"plan": "<string>",
"url": "<string>",
"workspace": "<string>"
},
"spec": {
"enabled": true,
"lifecycle": {
"expirationPolicies": [
{
"action": "delete",
"type": "ttl-idle",
"value": "24h"
}
],
"terminatedRetention": "24h"
},
"network": {
"allowedDomains": "[\"api.stripe.com\", \"api.openai.com\", \"*.s3.amazonaws.com\"]",
"egress": {
"gateway": "egress-ip-gw-1",
"mode": "dedicated",
"policies": [
{
"destinations": "[\"api.stripe.com\"]",
"mode": "dedicated",
"name": "payment-apis"
}
]
},
"firewall": {
"rulesets": "[\"proxy\", \"dedicated-ip\"]"
},
"forbiddenDomains": "[\"*.malware.com\", \"evil.example.org\"]",
"proxy": {
"allowedDomains": "[\"api.stripe.com\", \"api.openai.com\", \"*.s3.amazonaws.com\"]",
"bypass": "[\"*.s3.amazonaws.com\"]",
"forbiddenDomains": "[\"*.malware.com\", \"evil.example.org\"]",
"routing": [
{
"body": "{\"api_key\": \"{{SECRET:stripe-key}}\"}",
"destinations": "[\"api.stripe.com\"]",
"headers": "{\"Authorization\": \"Bearer {{SECRET:stripe-key}}\"}",
"secrets": "{\"stripe-key\": \"sk-live-abc123...\"}"
}
]
},
"subnet": "default"
},
"region": "us-pdx-1",
"runtime": {
"diskPercent": 80,
"envs": [
{
"name": "MY_ENV_VAR",
"secret": true,
"value": "my-value"
}
],
"expires": "2025-12-31T23:59:59Z",
"extraArgs": {},
"image": "blaxel/base-image:latest",
"memory": 4096,
"ports": [
{
"target": 8080,
"name": "http",
"protocol": "HTTP"
}
],
"standbyGracePeriodSeconds": 10,
"terminationGracePeriodSeconds": 30,
"ttl": "24h"
},
"volumes": [
{
"mountPath": "/mnt/data",
"name": "my-volume",
"readOnly": false,
"sizeMb": 102400,
"type": "persistent"
}
],
"vpc": "default"
},
"archive": {
"createdAt": "<string>",
"generation": "mk3.0",
"key": "my-workspace/my-sandbox.tar",
"restore": {
"files": 123,
"restoredBytes": 123,
"state": "extracting",
"totalBytes": 123
},
"restoreStartedAt": "<string>",
"size": 123,
"startedAt": "<string>"
},
"errors": [
{
"code": "VM_NETWORK_FAILURE",
"fatal": true,
"instance": "<string>",
"message": "<string>",
"time": "<string>"
}
],
"events": [
{
"canaryRevision": "<string>",
"message": "Deployment successful",
"revision": "rev-abc123",
"status": "DEPLOYED",
"time": "2025-01-15T10:30:00Z",
"type": "deployment"
}
],
"expiresIn": 123,
"lastUsedAt": "<string>",
"nodeGeneration": "<string>",
"state": "RUNNING",
"status": "DELETING"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}compute
Get sandbox
Returns detailed information about a sandbox including its configuration, attached volumes, lifecycle policies, and API endpoint URL.
GET
/
sandboxes
/
{sandboxName}
Get sandbox
curl --request GET \
--url https://api.blaxel.ai/v0/sandboxes/{sandboxName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/sandboxes/{sandboxName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/sandboxes/{sandboxName}', 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.blaxel.ai/v0/sandboxes/{sandboxName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blaxel.ai/v0/sandboxes/{sandboxName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blaxel.ai/v0/sandboxes/{sandboxName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/sandboxes/{sandboxName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "my-resource",
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"displayName": "My Resource",
"externalId": "my-session-123",
"labels": {},
"plan": "<string>",
"url": "<string>",
"workspace": "<string>"
},
"spec": {
"enabled": true,
"lifecycle": {
"expirationPolicies": [
{
"action": "delete",
"type": "ttl-idle",
"value": "24h"
}
],
"terminatedRetention": "24h"
},
"network": {
"allowedDomains": "[\"api.stripe.com\", \"api.openai.com\", \"*.s3.amazonaws.com\"]",
"egress": {
"gateway": "egress-ip-gw-1",
"mode": "dedicated",
"policies": [
{
"destinations": "[\"api.stripe.com\"]",
"mode": "dedicated",
"name": "payment-apis"
}
]
},
"firewall": {
"rulesets": "[\"proxy\", \"dedicated-ip\"]"
},
"forbiddenDomains": "[\"*.malware.com\", \"evil.example.org\"]",
"proxy": {
"allowedDomains": "[\"api.stripe.com\", \"api.openai.com\", \"*.s3.amazonaws.com\"]",
"bypass": "[\"*.s3.amazonaws.com\"]",
"forbiddenDomains": "[\"*.malware.com\", \"evil.example.org\"]",
"routing": [
{
"body": "{\"api_key\": \"{{SECRET:stripe-key}}\"}",
"destinations": "[\"api.stripe.com\"]",
"headers": "{\"Authorization\": \"Bearer {{SECRET:stripe-key}}\"}",
"secrets": "{\"stripe-key\": \"sk-live-abc123...\"}"
}
]
},
"subnet": "default"
},
"region": "us-pdx-1",
"runtime": {
"diskPercent": 80,
"envs": [
{
"name": "MY_ENV_VAR",
"secret": true,
"value": "my-value"
}
],
"expires": "2025-12-31T23:59:59Z",
"extraArgs": {},
"image": "blaxel/base-image:latest",
"memory": 4096,
"ports": [
{
"target": 8080,
"name": "http",
"protocol": "HTTP"
}
],
"standbyGracePeriodSeconds": 10,
"terminationGracePeriodSeconds": 30,
"ttl": "24h"
},
"volumes": [
{
"mountPath": "/mnt/data",
"name": "my-volume",
"readOnly": false,
"sizeMb": 102400,
"type": "persistent"
}
],
"vpc": "default"
},
"archive": {
"createdAt": "<string>",
"generation": "mk3.0",
"key": "my-workspace/my-sandbox.tar",
"restore": {
"files": 123,
"restoredBytes": 123,
"state": "extracting",
"totalBytes": 123
},
"restoreStartedAt": "<string>",
"size": 123,
"startedAt": "<string>"
},
"errors": [
{
"code": "VM_NETWORK_FAILURE",
"fatal": true,
"instance": "<string>",
"message": "<string>",
"time": "<string>"
}
],
"events": [
{
"canaryRevision": "<string>",
"message": "Deployment successful",
"revision": "rev-abc123",
"status": "DEPLOYED",
"time": "2025-01-15T10:30:00Z",
"type": "deployment"
}
],
"expiresIn": 123,
"lastUsedAt": "<string>",
"nodeGeneration": "<string>",
"state": "RUNNING",
"status": "DELETING"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}Authorizations
OAuth2ApiKeyAuth
Response
successful operation
Lightweight virtual machine for secure AI code execution. Sandboxes resume from standby in under 25ms and automatically scale to zero after inactivity, preserving memory state including running processes and filesystem.
Was this page helpful?