Represents an active sandbox for running commands and file operations.
This class is typically obtained from SandboxClient.createSandbox() and provides methods for command execution and file I/O within the sandbox environment.
class Sandboxconst sandbox = await client.createSandbox(snapshot.id);
try {
const result = await sandbox.run("python --version");
console.log(result.stdout);
} finally {
await sandbox.delete();
}HTTP status for the response that caused the error
Number of vCPUs allocated.
Capture a snapshot from this sandbox.
Read a file from the sandbox.
Reconnect to this command from the last known offsets.
Returns a new CommandHandle that resumes output from where this one left off.
Execute a command in the sandbox.
When wait is true (default) and no streaming callbacks are provided,
tries WebSocket first and falls back to HTTP POST.
When wait is false or streaming callbacks are provided, uses WebSocket
(required). Returns a CommandHandle for streaming output.
Start a stopped or failed sandbox. This endpoint is not idempotent.
Stop a ready sandbox. This endpoint is not idempotent; the filesystem is preserved for later restart.
Write content to a file in the sandbox.