curl --request GET \
--url https://api.cwsandbox.com/v1/sandboxes/{sandboxId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cwsandbox.com/v1/sandboxes/{sandboxId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cwsandbox.com/v1/sandboxes/{sandboxId}', 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.cwsandbox.com/v1/sandboxes/{sandboxId}",
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.cwsandbox.com/v1/sandboxes/{sandboxId}"
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.cwsandbox.com/v1/sandboxes/{sandboxId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cwsandbox.com/v1/sandboxes/{sandboxId}")
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{
"spec": {
"containers": [
{
"name": "<string>",
"image": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"environmentVariables": {},
"resources": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"files": [
{
"path": "<string>",
"content": "<string>"
}
],
"volumeMounts": [
{
"volume": "<string>",
"mountPath": "<string>",
"readOnly": true,
"subPath": "<string>"
}
],
"secretStores": [
{
"storeName": "<string>",
"secrets": [
{
"path": "<string>",
"envVar": "<string>",
"field": "<string>"
}
]
}
],
"workingDir": "<string>",
"resourceRequirements": {
"requests": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"limits": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
}
},
"securityContext": {
"runAsUser": 123,
"runAsGroup": 123,
"privileged": true,
"allowPrivilegeEscalation": true,
"readOnlyRootFilesystem": true,
"capabilitiesAdd": [
"<string>"
],
"capabilitiesDrop": [
"<string>"
],
"seccompProfile": "<string>"
},
"imagePullCredentials": {
"registry": "<string>",
"credentials": {
"storeName": "<string>",
"path": "<string>",
"field": "<string>"
}
},
"primary": true,
"startupProbe": {
"exec": [
"<string>"
],
"periodSeconds": 123,
"timeoutSeconds": 123,
"failureThreshold": 123,
"initialDelaySeconds": 123
}
}
],
"volumes": [
{
"name": "<string>",
"scratch": {
"size": "<string>",
"medium": "STORAGE_MEDIUM_UNSPECIFIED",
"restoreFromSnapshotId": "<string>"
},
"volumeId": "<string>"
}
],
"services": [
{
"port": 123,
"name": "<string>",
"protocol": "SERVICE_PROTOCOL_UNSPECIFIED",
"visibility": "VISIBILITY_UNSPECIFIED",
"endpoint": {
"kind": "ENDPOINT_KIND_UNSPECIFIED",
"auth": "ENDPOINT_AUTH_UNSPECIFIED",
"requestTimeoutSeconds": 123
}
}
],
"maxLifetimeSeconds": 123,
"networkIds": [
"<string>"
],
"objectStorageAccess": {
"buckets": [
"<string>"
],
"permission": "OBJECT_STORAGE_PERMISSION_UNSPECIFIED",
"objectPrefix": "<string>"
},
"tags": [
"<string>"
],
"runnerIds": [
"<string>"
],
"annotations": {},
"instanceType": "<string>",
"mode": "SANDBOX_MODE_UNSPECIFIED",
"runtimeClass": "<string>",
"networkConfigId": "<string>",
"runtimeClassSelection": "RUNTIME_CLASS_UNSPECIFIED"
},
"sandboxId": "<string>",
"status": {
"state": "STATE_UNSPECIFIED",
"stateReason": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"services": [
{
"port": 123,
"name": "<string>",
"protocol": "SERVICE_PROTOCOL_UNSPECIFIED",
"visibility": "VISIBILITY_UNSPECIFIED",
"endpoint": {
"kind": "ENDPOINT_KIND_UNSPECIFIED",
"auth": "ENDPOINT_AUTH_UNSPECIFIED",
"url": "<string>",
"requestTimeoutSeconds": 123,
"address": "<string>"
},
"url": "<string>"
}
],
"resourceUsage": {
"cpuMillicores": "<string>",
"memoryMb": "<string>",
"gpuCount": "<string>"
},
"exitCode": 123,
"effectiveResources": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"effectiveMaxLifetimeSeconds": 123,
"containerStatuses": [
{
"name": "<string>",
"state": "STATE_UNSPECIFIED",
"exitCode": 123,
"restartCount": 123
}
],
"runnerId": "<string>",
"runnerGroupId": "<string>",
"effectiveIngress": [
{
"cidr": {
"cidr": "<string>",
"except": [
"<string>"
]
},
"tenant": "TENANT_SCOPE_UNSPECIFIED",
"any": true,
"ports": [
{
"port": 123,
"protocol": "<string>",
"endPort": 123
}
]
}
],
"effectiveEgress": [
{
"cidr": {
"cidr": "<string>",
"except": [
"<string>"
]
},
"httpsHostname": "<string>",
"tenant": "TENANT_SCOPE_UNSPECIFIED",
"any": true,
"selector": {
"podLabels": {},
"namespaceLabels": {}
},
"ports": [
{
"port": 123,
"protocol": "<string>",
"endPort": 123
}
],
"httpsHostnameExcept": [
"<string>"
]
}
],
"effectiveResourceRequirements": {
"requests": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"limits": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
}
},
"attachedVolumeIds": [
"<string>"
],
"effectiveRuntimeClass": "<string>",
"effectiveDnsEgress": "DNS_EGRESS_MODE_UNSPECIFIED"
},
"sourceTemplateId": "<string>",
"sourceTemplateRevision": "<string>",
"displayName": "<string>",
"endpointShareToken": "<string>",
"control": "CONTROL_UNSPECIFIED"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Get sandbox
Get the current state of a sandbox.
curl --request GET \
--url https://api.cwsandbox.com/v1/sandboxes/{sandboxId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cwsandbox.com/v1/sandboxes/{sandboxId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cwsandbox.com/v1/sandboxes/{sandboxId}', 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.cwsandbox.com/v1/sandboxes/{sandboxId}",
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.cwsandbox.com/v1/sandboxes/{sandboxId}"
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.cwsandbox.com/v1/sandboxes/{sandboxId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cwsandbox.com/v1/sandboxes/{sandboxId}")
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{
"spec": {
"containers": [
{
"name": "<string>",
"image": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"environmentVariables": {},
"resources": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"files": [
{
"path": "<string>",
"content": "<string>"
}
],
"volumeMounts": [
{
"volume": "<string>",
"mountPath": "<string>",
"readOnly": true,
"subPath": "<string>"
}
],
"secretStores": [
{
"storeName": "<string>",
"secrets": [
{
"path": "<string>",
"envVar": "<string>",
"field": "<string>"
}
]
}
],
"workingDir": "<string>",
"resourceRequirements": {
"requests": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"limits": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
}
},
"securityContext": {
"runAsUser": 123,
"runAsGroup": 123,
"privileged": true,
"allowPrivilegeEscalation": true,
"readOnlyRootFilesystem": true,
"capabilitiesAdd": [
"<string>"
],
"capabilitiesDrop": [
"<string>"
],
"seccompProfile": "<string>"
},
"imagePullCredentials": {
"registry": "<string>",
"credentials": {
"storeName": "<string>",
"path": "<string>",
"field": "<string>"
}
},
"primary": true,
"startupProbe": {
"exec": [
"<string>"
],
"periodSeconds": 123,
"timeoutSeconds": 123,
"failureThreshold": 123,
"initialDelaySeconds": 123
}
}
],
"volumes": [
{
"name": "<string>",
"scratch": {
"size": "<string>",
"medium": "STORAGE_MEDIUM_UNSPECIFIED",
"restoreFromSnapshotId": "<string>"
},
"volumeId": "<string>"
}
],
"services": [
{
"port": 123,
"name": "<string>",
"protocol": "SERVICE_PROTOCOL_UNSPECIFIED",
"visibility": "VISIBILITY_UNSPECIFIED",
"endpoint": {
"kind": "ENDPOINT_KIND_UNSPECIFIED",
"auth": "ENDPOINT_AUTH_UNSPECIFIED",
"requestTimeoutSeconds": 123
}
}
],
"maxLifetimeSeconds": 123,
"networkIds": [
"<string>"
],
"objectStorageAccess": {
"buckets": [
"<string>"
],
"permission": "OBJECT_STORAGE_PERMISSION_UNSPECIFIED",
"objectPrefix": "<string>"
},
"tags": [
"<string>"
],
"runnerIds": [
"<string>"
],
"annotations": {},
"instanceType": "<string>",
"mode": "SANDBOX_MODE_UNSPECIFIED",
"runtimeClass": "<string>",
"networkConfigId": "<string>",
"runtimeClassSelection": "RUNTIME_CLASS_UNSPECIFIED"
},
"sandboxId": "<string>",
"status": {
"state": "STATE_UNSPECIFIED",
"stateReason": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"services": [
{
"port": 123,
"name": "<string>",
"protocol": "SERVICE_PROTOCOL_UNSPECIFIED",
"visibility": "VISIBILITY_UNSPECIFIED",
"endpoint": {
"kind": "ENDPOINT_KIND_UNSPECIFIED",
"auth": "ENDPOINT_AUTH_UNSPECIFIED",
"url": "<string>",
"requestTimeoutSeconds": 123,
"address": "<string>"
},
"url": "<string>"
}
],
"resourceUsage": {
"cpuMillicores": "<string>",
"memoryMb": "<string>",
"gpuCount": "<string>"
},
"exitCode": 123,
"effectiveResources": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"effectiveMaxLifetimeSeconds": 123,
"containerStatuses": [
{
"name": "<string>",
"state": "STATE_UNSPECIFIED",
"exitCode": 123,
"restartCount": 123
}
],
"runnerId": "<string>",
"runnerGroupId": "<string>",
"effectiveIngress": [
{
"cidr": {
"cidr": "<string>",
"except": [
"<string>"
]
},
"tenant": "TENANT_SCOPE_UNSPECIFIED",
"any": true,
"ports": [
{
"port": 123,
"protocol": "<string>",
"endPort": 123
}
]
}
],
"effectiveEgress": [
{
"cidr": {
"cidr": "<string>",
"except": [
"<string>"
]
},
"httpsHostname": "<string>",
"tenant": "TENANT_SCOPE_UNSPECIFIED",
"any": true,
"selector": {
"podLabels": {},
"namespaceLabels": {}
},
"ports": [
{
"port": 123,
"protocol": "<string>",
"endPort": 123
}
],
"httpsHostnameExcept": [
"<string>"
]
}
],
"effectiveResourceRequirements": {
"requests": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
},
"limits": {
"cpu": "<string>",
"memory": "<string>",
"gpu": {
"count": "<string>",
"type": "<string>",
"memoryGb": "<string>"
}
}
},
"attachedVolumeIds": [
"<string>"
],
"effectiveRuntimeClass": "<string>",
"effectiveDnsEgress": "DNS_EGRESS_MODE_UNSPECIFIED"
},
"sourceTemplateId": "<string>",
"sourceTemplateRevision": "<string>",
"displayName": "<string>",
"endpointShareToken": "<string>",
"control": "CONTROL_UNSPECIFIED"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
CoreWeave API access token sent as a bearer token.
Path Parameters
Sandbox UUID or tenant-scoped display_name. Names resolve active sandboxes only; use the UUID to retrieve a terminal sandbox. UUIDs resolve by ID only. Use the returned sandbox_id for subsequent operations, since names can be reused after termination. Existing ownership and access rules apply.
Response
OK
Sandbox is a single running (or terminal) compute environment.
Desired workload. Required on create and immutable thereafter. It is absent when v1 projects a sandbox created through v1beta2, which has no v1 SandboxSpec. It is also absent in STATE_PREPARING, and after an image fill fails before the spec is stored. When create used a template, this is the resolved spec from that create — never re-read from the live template.
Show child attributes
Show child attributes
Server-assigned unique identifier.
Observed state.
Show child attributes
Show child attributes
Template selected at create time, if any. Historical provenance; retained even if the template is later deleted.
Revision of the template applied at create time.
Optional, immutable lookup name, unique among active sandboxes in the tenant organization. Case-sensitive, at most 128 UTF-8 bytes; leading or trailing whitespace, slashes, colons, control characters, and UUIDs are invalid. The name becomes reusable once the sandbox reaches a terminal state.
CreateSandbox, CreateSandboxFromTemplate, and an identical request_id replay of that call, after HTTPS URLs confirm. Omitted from Get, List, status, and from a successful create while those URLs are unconfirmed. Send as X-Sandbox-Share-Token or ?share_token=; both are stripped before forwarding.
Who controls the sandbox's containers: CONTROL_CONTAINER_ENGINE for a sandbox created with it, and CONTROL_PLATFORM for every other sandbox. CONTROL_UNSPECIFIED means no controller is specified; successful creates resolve the default to CONTROL_PLATFORM.
CONTROL_UNSPECIFIED, CONTROL_PLATFORM, CONTROL_CONTAINER_ENGINE Was this page helpful?