Skip to main content
Sandboxes are isolated execution environments available on demand. Use them for code execution, file operations, and shell commands.

Create a sandbox

from hexel import Hexel

client = Hexel(api_key="your_api_key")
sandbox = client.compute.sandbox.create(tier="standard")

Execute code

client.compute.sandbox.execute(
    sandbox["vm_id"],
    code="print(1 + 1)",
    language="python"
)

Run shell commands

hexel compute sandbox exec <vm-id> --command "ls -la /workspace"

Lifecycle

OperationDescription
CreateAllocate a sandbox
ExecuteRun code or shell commands
RenewExtend the TTL (default is 1 hour)
ReleaseRelease the sandbox
DeletePermanently remove the sandbox