◐ Runs today on a plain sandbox · template coming
Add a desktop to the agent's template. The agent clicks, types and takes screenshots. You watch the same screen in your browser through a private link. You can build this today from a plain sandbox. A ready-made desktop template and a guide are coming.
The desktop in this example
Each step shows the call, the reply and the lines it adds to the activity log. You can read the whole log withGET /v1/sandboxes/$S/events.
Every step except the last one uses features that work today. The last step, marked PLANNED, is the tested, ready-made template and guide that are coming.
SPAWNBOX API
A virtual screen, a small desktop, a VNC server, a web viewer for VNC, and tools to click and take screenshots. Wait until the build is ready before the next step.
POST /v1/templates
{"name": "desktop",
"setup": ["apt-get update && apt-get install -y xvfb xfce4 x11vnc novnc websockify xdotool imagemagick"],
"resources": {"vcpus": 2, "memory_mib": 4096}}SPAWNBOX API
Spawnbox keeps each part running. The web viewer is private: only a request with your API key or a session token can open it.
POST /v1/sandboxes
{"template": "desktop", "services": [
{"name": "screen", "command": ["sh", "-c",
"Xvfb :1 -screen 0 1280x800x24 & DISPLAY=:1 startxfce4"]},
{"name": "vnc", "command": ["x11vnc", "-display", ":1",
"-forever", "-shared", "-rfbport", "5900"]},
{"name": "viewer", "command": ["websockify", "--web",
"/usr/share/novnc", "6080", "localhost:5900"],
"port": 6080, "access": "private",
"health": {"tcp": true}}]}IN THE SANDBOX
Each action is one command on the desktop. A screenshot goes to a file that your app reads and sends to the model.
POST /v1/sandboxes/$S/exec
{"cmd": "xdotool mousemove 640 400 click 1 && import -window root s.png",
"env": {"DISPLAY": ":1"}}YOUR APP
Make a short-lived session token for this sandbox, and open the private viewer link with it. The token works for 15 minutes at most. It opens only the viewer port of this sandbox, and no other API calls.
POST /v1/sandboxes/$S/session-tokens
{"ttl_s": 900, "audience": "preview", "port": 6080}<viewer url>/vnc.html?spawnbox_session=<token>SPAWNBOX APIPLANNED
A tested desktop template with a browser and a web viewer, and a step-by-step guide.