run / exec when you want to run something and wait for the result; use start_process when you want to start something that keeps running and manage its lifecycle.
Sandbox-specific operations use sandbox-specific ingress, commonly seen as
https://<sandbox-id-or-name>.sandbox.tensorlake.ai, derived from the sandbox’s ingress_endpoint.For named sandboxes, you can use the sandbox name in place of the ID — both in the proxy hostname and in CLI/API commands. For example, https://my-env.sandbox.tensorlake.ai/api/v1/processes and tl sbx exec my-env python main.py work the same as their ID-based equivalents. The proxy resolves the name to the underlying sandbox automatically.The command and process APIs documented here run on the management URL on port 9501, which always requires authentication. Unauthenticated proxy access applies only to exposed user ports.Basic Execution
- CLI
- Python
- TypeScript
- HTTP
CLI Options
- CLI
- Python
- TypeScript
- HTTP
--env run printed prod 0. A verified --keep run ended with Sandbox <id> kept alive., and tl sbx ls --all then showed that sandbox as running.Shell Commands
- CLI
- Python
- TypeScript
- HTTP
Get Process Output
Fetch the buffered stdout, stderr, or combined output of a running or finished process.- Python
- TypeScript
- HTTP
- CLI
Error Handling
- CLI
- Python
- TypeScript
- HTTP
Start a Background Process
Usestart_process for work that should keep running after the call returns — servers, watchers, and other long-lived jobs.
- Python
- TypeScript
- CLI
- HTTP
List Processes
- Python
- TypeScript
- HTTP
Stream Output
Stream stdout/stderr in real time for long-running commands using Server-Sent Events:- CLI
- Python
- TypeScript
- HTTP
tl sbx exec streams combined output to your terminal while the process runs.Send Signals
Send POSIX signals to running processes:- Python
- TypeScript
- HTTP
Kill a Process
- Python
- TypeScript
- HTTP
Write to Stdin
Send input to a running process started with stdin in pipe mode:Managed Processes
Use a managed process for long-running services that should restart after a crash or failed health check. Managed processes use the same process API as normal background commands, but opt into supervision when you provide aname, a restart policy, or a health check.
Managed process flags start a background process. In the CLI, these flags require
--detach. For blocking one-shot commands that stream output and return an exit code, use plain tl sbx exec or sandbox.run(...).- CLI
- Python
- TypeScript
- HTTP
never, on_failure, and always. Health checks can be HTTP checks against a local sandbox port and optional path, or TCP checks against a local port. Process user selection accepts a username such as root, a UID string, a uid:gid string, or an object such as {"uid": 1000, "gid": 1000}. The default user is tl-user.
Interactive Shell
- CLI
- Python
- TypeScript
- HTTP
tl sbx ssh requires an interactive terminal and automatically resumes a suspended sandbox before opening the PTY session.
For the full programmatic PTY flow, including the READY handshake, binary WebSocket opcodes, and clean shutdown, see PTY Sessions.
Learn More
PTY Sessions
Interactive shells over WebSocket.
File Operations
Read, write, and copy files.
Lifecycle
Sandbox states, resources, and timeouts.
Networking
Control internet access and outbound destinations.