Skip to main content
POST
/
sandboxes
Create a sandbox
curl --request POST \
  --url https://api.tensorlake.ai/sandboxes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "<string>",
  "resources": {
    "cpus": 123,
    "memory_mb": 123,
    "ephemeral_disk_mb": 123,
    "gpus": [
      {
        "count": 2,
        "model": "<string>"
      }
    ]
  },
  "secret_names": [
    "<string>"
  ],
  "timeout_secs": 1,
  "entrypoint": [
    "<string>"
  ],
  "network": {
    "allow_internet_access": true,
    "allow_out": [
      "<string>"
    ],
    "deny_out": [
      "<string>"
    ]
  },
  "snapshot_id": "<string>",
  "allow_unauthenticated_access": true,
  "exposed_ports": [
    32768
  ],
  "template_id": "<string>"
}
'
{
  "sandbox_id": "<string>",
  "status": "pending",
  "pending_reason": "scheduling"
}
Launch a sandbox.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
image
string

Runtime image selector for the sandbox. Only Tensorlake's managed Ubuntu 24.04 environment is currently supported in the public sandbox API.

resources
object
secret_names
string[]

Secret names to inject into the sandbox.

timeout_secs
integer<int64>

Sandbox timeout in seconds. 0 disables the timeout.

Required range: x >= 0
entrypoint
string[]

Optional command to run when the sandbox starts.

network
object
snapshot_id
string

Snapshot to restore from.

allow_unauthenticated_access
boolean

Allow sandbox ingress to route requests without validating auth credentials. The legacy request alias allow_unauthenticated_proxy_access is also accepted.

exposed_ports
integer<int32>[]

Additional sandbox ports that public ingress may route to. When omitted, only the management port 9501 is routable.

Required range: 1 <= x <= 65535
template_id
string

Template identifier to associate with the launched sandbox.

Response

Sandbox created successfully

sandbox_id
string
required
status
enum<string>
required
Available options:
pending,
running,
snapshotting,
suspending,
suspended,
terminated
pending_reason
enum<string>
Available options:
scheduling,
waiting_for_container,
no_executors_available,
no_resources_available,
pool_at_capacity