Run a sandbox
Start a cell, run a command in it, and put it to sleep when you finish. A cell is the API name for a sandbox.
These examples use the heli helper from API keys.
Start a cell
Open trial setup if your account needs a compute plan. Open Agent setup and select Prepare API project. Use its project name in the first request. Pick a unique sandbox name.
Terminal
heli /v1/cells -H 'Content-Type: application/json' \
-d '{"name":"api-demo","project":"YOUR_PROJECT","wait":true}'Wait until the cell starts before running a command. If the response says queued, run heli /v1/fleet/cells/api-demo to check its state. Substitute your sandbox name if you changed it.
Run a command
Terminal
heli /v1/cells/api-demo/exec -H 'Content-Type: application/json' \
-d '{"argv":["uname","-s"]}'Look for Linux in stdout and 0 in rc.
Put it to sleep
Put the sandbox to sleep when you finish. Sleep preserves the cell’s files. Open the cell in Sandboxes when you need it again.
Terminal
heli /v1/cells/api-demo/sleep -X POSTTalk to an agent, read output, manage a cell
- Talk to an agent. Connect its model account in Settings → Accounts. Start the cell with the agent command in
cmd, then send{"prompt":"…"}toPOST /v1/cells/{name}/ask. - Read output. Use
GET /v1/cells/{name}/tailfor terminal output. UsePOST /v1/cells/{name}/runto run a shell command. - Manage a sandbox. See the cell operations for wake, cold stop, resize, disk growth, and permanent removal.
Verify the cell name before permanent removal.