WBX Sandbox
How do I…

How do I keep a workspace and come back to it later?

Give a sandbox a name and let it fall asleep instead of being deleted. Its files – and even running programs – are still there tomorrow, also in a new chat with your assistant.

Steps

  1. Create a sandbox with a name, for example my-project, and with on_timeout: pause (sleep instead of delete).
  2. Work in it as usual.
  3. Let it sleep. It falls asleep by itself after its lifetime or after a while without commands; you can also put it to sleep at once.
  4. Come back. Ask for the same name again: you get the same sandbox, woken up in a few seconds with its files.

No code: copy this into Claude or ChatGPT with WBX Sandbox connected and change it to fit.

Create a WBX sandbox named my-project that falls asleep instead of being deleted. Save a file notes.txt in it with today's date.

(Next week, in a new chat:)
Open my WBX sandbox my-project and show me notes.txt.

pip install wbxsandbox, your key in WBXSANDBOX_API_KEY.

from wbxsandbox import Sandbox

# the same name returns the same sandbox – also tomorrow, woken up with its files
sb = Sandbox.create(name="my-project", on_timeout="pause", timeout=1800)
sb.run("echo \"$(date): note\" >> /home/user/notes.txt")
print(sb.run("cat /home/user/notes.txt").stdout)
sb.sleep()                          # stops compute billing now; files stay

npm install wbxsandbox (Node.js 20+); save as .mts for top-level await.

import { WBX } from "wbxsandbox";

const wbx = new WBX();
// the same name returns the same sandbox – also tomorrow, woken up with its files
const sandbox = await wbx.sandboxes.create({ name: "my-project", onTimeout: "pause", timeoutSeconds: 1800 });
await sandbox.commands.run(`echo "$(date): note" >> /home/user/notes.txt`);
console.log((await sandbox.commands.run("cat /home/user/notes.txt")).stdout);
await sandbox.sleep();              // stops compute billing now; files stay

Just curl and jq; your key in WBXSANDBOX_API_KEY.

H="Authorization: Bearer $WBXSANDBOX_API_KEY"
SB=$(curl -s -X POST https://sandbox.wbx.cz/v1/sandboxes -H "$H" -d '{"name": "my-project", "on_timeout": "pause", "timeout_s": 1800}' | jq -r .id)
curl -s -X POST https://sandbox.wbx.cz/v1/sandboxes/$SB/exec -H "$H" -d '{"cmd": "date >> /home/user/notes.txt; cat /home/user/notes.txt"}'
curl -s -X POST https://sandbox.wbx.cz/v1/sandboxes/$SB/sleep -H "$H"

How to tell it worked

  • Run it again later: notes.txt has the earlier line plus a new one.
  • In the portal, Sandboxes shows my-project as sleeping between uses.

If it doesn't work

What you seeWhat to do
You get a new, empty sandboxThe old one was deleted – by kill, or because it stayed asleep longer than your plan keeps sandboxes (14 days on Free). Set keep_days when you create it.
The assistant does not find the sandboxSay its exact name. Ask it to list your sandboxes if you do not remember the name.
Programs did not continue after wakingUsually they do. When the memory cannot be restored, only the files are kept – start the program again. See Sleep and wake.

What it costs

While it runs, like any sandbox (the base template about US$0.07, €0.06 or 1.6 Kč an hour). While it sleeps it uses no compute; only its disk is billed as storage. Pricing.

Next steps