Skip to main content
POST
Create a sandbox
Launch an ephemeral or named sandbox. The response includes the sandbox’s ingress_endpoint. Prefer it over constructing *.sandbox.tensorlake.ai hostnames yourself when building sandbox-specific URLs in client code.
  • Set wait to false to get 202 with the sandbox pending as soon as it is durable, instead of waiting for it to run; poll GET /sandboxes/{id} or GET /sandboxes for readiness. See Non-blocking Sandbox Creation.
  • Set max_pending_secs to bound how long the sandbox may wait for capacity; when it runs out the sandbox terminates with termination_reason no_capacity. Omit it to wait indefinitely.
  • Omit name to create an ephemeral sandbox.
  • Set name to create a named sandbox that supports suspend and resume.
  • Set snapshot_id to restore from a snapshot, or image to boot from a registered Sandbox Image.
  • For fresh creates, if resources.disk_mb is omitted, the sandbox uses the default 10 GB root disk (10240 MiB).
  • With image, resources.disk_mb can be used to grow the root disk at create time (growth-only).
  • With snapshot_id from a filesystem snapshot, resources.disk_mb can be used to grow the root disk at create time (growth-only).

Authorizations

Authorization
string
header
required

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

Body

application/json
image
string

Optional sandbox image name to boot from. When omitted, Tensorlake uses the default managed environment. This can also be a registered Sandbox Image name.

resources
object
secret_names
string[]

Secret names to inject into the sandbox.

timeout_secs
integer<int64>

Sandbox timeout in seconds. 0 requests the maximum allowed by your plan. Plan maximums: Free unverified 3600 (1h), Free verified 7200 (2h), On-Demand 86400 (24h). See tensorlake.ai/pricing for higher limits on committed plans.

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.

name
string

Optional user-provided sandbox name. When set, the sandbox is named and supports suspend/resume. When omitted, the sandbox is ephemeral.

wait
boolean
default:true

false returns 202 with the sandbox in pending as soon as it is durable, instead of waiting for it to run. Poll GET /sandboxes/{id} or GET /sandboxes for readiness.

max_pending_secs
integer

Longest the sandbox may wait for capacity, in seconds. When it runs out while the sandbox is still waiting for a host, the sandbox is terminated with termination_reason no_capacity and its last pending_reason. 0 fails at once if the sandbox cannot be placed. Omit to wait indefinitely. Bare-metal hosts take up to 20 minutes to boot, so use 1800 or more for capacity waits.

Required range: x >= 0
file_systems
object[]

Filesystems to mount into the sandbox, each at its own absolute, unique, non-nested guest mount path. At most 8 per sandbox. Mounts are ready before the sandbox is reported as running; a filesystem that does not exist fails the create with 422 and reason FileSystemNotFound, and a pinned snapshot_id that is not a permanent snapshot fails it with reason FileSystemSnapshotNotFound.

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,
max_capacity_reached,
no_executor_for_snapshot_location
ingress_endpoint
string | null

Base ingress origin for this sandbox's current placement.