Sandboxes quickstart
This guide takes you from signup to a forked sandbox. The flow is four calls: list the catalog, create a sandbox from a catalog image, exec against it, fork it.
-
Get a key. Sign in to the console (Google or GitHub), then API keys → Create. A Demo key is free — no card:
Terminal window export COLLIMATE_API_KEY="col_demo_a1b2c3d4e5f60718_..." -
Install the SDK (stdlib-only, zero dependencies):
Terminal window pip install collimate-rl
1. Pick an image from the catalog
Section titled “1. Pick an image from the catalog”The catalog is the ready-to-run image library — every entry is already baked and ready to fork, so there is nothing to build or wait for. Pick an id:
curl https://api.collimate.ai/v1/images \ -H "Authorization: Bearer $COLLIMATE_API_KEY"# { "templates": [ { "id": "python", "name": "python", "visibility": "public",# "tier": "demo", "description": "Python 3, ready to run" } ] }from collimate_rl import connect
client = connect() # reads COLLIMATE_API_KEY from the environment
for img in client.images(): print(img["id"], "—", img.get("description", ""))# python — Python 3, ready to runBringing your own image is the Pro upgrade — see the Pro quickstart.
2. Create a sandbox and run code
Section titled “2. Create a sandbox and run code”Create a sandbox from the catalog id, then exec against it. Files and processes persist between execs, so you reuse the same sandbox across steps.
-
Create a sandbox:
Terminal window curl https://api.collimate.ai/v1/sandboxes \-H "Authorization: Bearer $COLLIMATE_API_KEY" \-H "Content-Type: application/json" \-d '{ "template": "python" }'# { "id": "sbx_9f2a1c7b3e40", "template": "python", "state": "running", ... }sb = client.create_sandbox("python")print(sb["id"]) # sbx_9f2a1c7b3e40 -
Exec against it as many times as you like:
Terminal window curl https://api.collimate.ai/v1/sandboxes/sbx_9f2a1c7b3e40/exec \-H "Authorization: Bearer $COLLIMATE_API_KEY" \-H "Content-Type: application/json" \-d '{ "code": "print(sum(range(100)))" }'r = client.exec(sb["id"], code="print(sum(range(100)))")print(r["stdout"], r["exit_code"]) # "4950\n" 0You get back the captured output plus timing:
{"id": "sbx_9f2a1c7b3e40","stdout": "4950\n","stderr": "","exit_code": 0,"fork_time_ms": 0.0,"exec_time_ms": 11.8,"total_time_ms": 15.1,"seed": "3a7f…","seed_ack": "verified"} -
Delete it when you're done:
Terminal window curl -X DELETE https://api.collimate.ai/v1/sandboxes/sbx_9f2a1c7b3e40 \-H "Authorization: Bearer $COLLIMATE_API_KEY"client.delete_sandbox(sb["id"])
3. Fork the running sandbox
Section titled “3. Fork the running sandbox”The headline. Prepare a sandbox once, then fork it into N live children — each keeps the parent's process memory, so no reinstall and no replay.
# Prepare state once, then fork the running sandbox 4 ways.curl https://api.collimate.ai/v1/sandboxes/sbx_9f2a1c7b3e40/exec \ -H "Authorization: Bearer $COLLIMATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "command": "pip install numpy" }'
curl https://api.collimate.ai/v1/sandboxes/sbx_9f2a1c7b3e40/fork \ -H "Authorization: Bearer $COLLIMATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "count": 4 }'# { "parent": "sbx_9f2a1c7b3e40", "children": [ { "id": "sbx_1a4f…" }, ... ] }# each child already has numpy installedclient.exec(sb["id"], command="pip install numpy") # prepare state once
resp = client.fork(sb["id"], count=4)children = [c["id"] for c in resp["children"]]# each child already has numpy installedThe parent keeps running; each child is an independent microVM. This is the building block for tree search and best-of-N.
Next steps
Section titled “Next steps”- Live fork — the replay-tax argument and fork-tree search.
- MCP quickstart — drive sandboxes from Claude Code or Cursor.
- Pro quickstart — bring your own image and run GRPO-width rollouts.
- RL quickstart — rollout workloads with
collimate-rl. - API reference — every endpoint and field.