Guide 05 · pause / resume / refresh

Long-running background agents that don't burn money

Research agents, monitoring agents, multi-hour builds: sessions run up to 24 hours on paid plans, extend live with refresh, and — the part that saves real money — pause when idle so a waiting agent costs storage, not compute.

1

Give the agent a long leash

sb = Sandbox.create(template="python-3.11", timeout=86400)  # 24 h
2

Extend mid-task when it needs more time

# POST /v1/sandboxes/{id}/timeout  {"seconds": 21600}   — 6 more hours from now
# POST /v1/sandboxes/{id}/refresh                       — re-arm the TTL
3

Pause while waiting, resume on the trigger

$ pilldrops sandbox pause sb_agent1     # billing stops, filesystem stays
# … webhook fires 3 hours later …
$ pilldrops sandbox resume sb_agent1    # picks up exactly where it left off
paused sandboxes bill $0/s compute · lifecycle API
Start free — $5 credits Browse all 15 guides →