Get a sandbox
curl --request GET \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}', 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.tensorlake.ai/sandboxes/{sandbox_id}",
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.tensorlake.ai/sandboxes/{sandbox_id}"
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.tensorlake.ai/sandboxes/{sandbox_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}")
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{
"auto_resume": true,
"id": "<string>",
"namespace": "<string>",
"status": "pending",
"created_at": 123,
"resources": {
"cpus": 123,
"memory_mb": 123,
"disk_mb": 123
},
"timeout_secs": 123,
"allow_unauthenticated_access": true,
"image": "<string>",
"pending_reason": "<string>",
"outcome": "<string>",
"termination_reason": "<string>",
"error_details": "<string>",
"container_id": "<string>",
"executor_id": "<string>",
"ingress_endpoint": "<string>",
"sandbox_url": "<string>",
"pool_id": "<string>",
"network_policy": {
"allow_internet_access": true,
"allow_out": [
"<string>"
],
"deny_out": [
"<string>"
]
},
"exposed_ports": [
32768
],
"template_id": "<string>",
"name": "<string>",
"file_systems": [
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
],
"snapshot_id": "<string>"
}Life Cycle Management
Get Sandbox
Read sandbox status, configuration, and automatic resume settings.
GET
/
sandboxes
/
{sandbox_id}
Get a sandbox
curl --request GET \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}', 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.tensorlake.ai/sandboxes/{sandbox_id}",
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.tensorlake.ai/sandboxes/{sandbox_id}"
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.tensorlake.ai/sandboxes/{sandbox_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}")
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{
"auto_resume": true,
"id": "<string>",
"namespace": "<string>",
"status": "pending",
"created_at": 123,
"resources": {
"cpus": 123,
"memory_mb": 123,
"disk_mb": 123
},
"timeout_secs": 123,
"allow_unauthenticated_access": true,
"image": "<string>",
"pending_reason": "<string>",
"outcome": "<string>",
"termination_reason": "<string>",
"error_details": "<string>",
"container_id": "<string>",
"executor_id": "<string>",
"ingress_endpoint": "<string>",
"sandbox_url": "<string>",
"pool_id": "<string>",
"network_policy": {
"allow_internet_access": true,
"allow_out": [
"<string>"
],
"deny_out": [
"<string>"
]
},
"exposed_ports": [
32768
],
"template_id": "<string>",
"name": "<string>",
"file_systems": [
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
],
"snapshot_id": "<string>"
}Retrieve metadata for a single sandbox.
status: "resume_failed" is a nonterminal failure of a resume attempt. The sandbox keeps its identity and original snapshot_id; optional error_details retains the diagnosis. Reading metadata does not retry the failure. Use Resume Sandbox to retry explicitly.
If status is pending with retained_runtime.state: "resume_uncertain", execution has not safely settled. Keep inspecting instead of treating it as a retryable failure. See Recover from a failed resume.
The response includes ingress_endpoint, the base ingress origin for this sandbox’s current placement, and sandbox_url, the sandbox-specific management URL derived from it.
The response’s auto_resume boolean tells you whether proxy traffic may wake the sandbox while suspended. false does not indicate that the sandbox is currently suspended; check status separately. Reading this metadata does not wake a suspended sandbox.Authorizations
Response
Sandbox retrieved successfully
Was this page helpful?