Unarchive sandbox
curl --request POST \
--url https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive', 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}/unarchive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/unarchive"
req, _ := http.NewRequest("POST", 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.post("https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}compute
Unarchive sandbox
Recreates an archived sandbox from its archive. The recreated sandbox runs the current generation whatever generation it was archived from, restores the archived filesystem before anything starts, and starts the saved processes again with new process identifiers.
POST
/
sandboxes
/
{sandboxName}
/
unarchive
Unarchive sandbox
curl --request POST \
--url https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive', 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}/unarchive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/unarchive"
req, _ := http.NewRequest("POST", 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.post("https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/sandboxes/{sandboxName}/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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"
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}Authorizations
OAuth2ApiKeyAuth
Response
Sandbox recreated successfully
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?