At list prices, a sandbox with 2 vCPUs and 4 GiB of memory that sits idle for an hour costs between about $0.04 and $0.24, depending on the provider and on whether it bills reserved CPU or only CPU in use. What usually matters more than the hourly rate is how long the sandbox stays up while the agent is waiting on the model or on a person, which the timeout and auto-stop settings decide. Serverless tool calls avoid the question: nothing runs, and nothing is billed, between calls.
What does an idle agent sandbox cost per hour?
The table below prices one hour of a sandbox that is running but doing nothing, from each provider's published rates. Where a provider's default size differs, the table uses 2 vCPU and 4 GiB, or the closest instance type with 4 GiB of memory, so the rows compare like with like. It doesn't include storage, network, plan fees or free credits.
How the figures are worked out:
- E2B: $0.000014 per vCPU-second and $0.0000045 per GiB-second, so 2 × $0.0504 + 4 × $0.0162 per hour. E2B's default sandbox is this size.
- Daytona: $0.0504 per vCPU-hour and $0.0162 per GiB-hour, the same hourly figures. Daytona's default sandbox is smaller (1 vCPU, 1 GB), about $0.07 an hour.
- Modal: $0.00003942 per physical core-second (one core is 2 vCPU equivalent) and $0.00000667 per GiB-second for Sandboxes. A Sandbox with no resource request asks for 0.125 cores and 128 MiB and pays for what it actually uses above that.
- Vercel: $0.0212 per GB-hour of provisioned memory, which Vercel's docs say counts "including idle time", and $0.128 per hour of Active CPU, which excludes time spent waiting on I/O or model calls. Rates are for the
iad1region and vary by region. - Cloudflare: $0.0000025 per GiB-second of memory and $0.00000007 per GB-second of disk, with CPU billed on active usage. Cloudflare also bills the Workers and Durable Objects that drive a container, which the table leaves out.
- Archil: $0.055 per vCPU-hour and $0.020 per GiB-hour.
Why the hourly rate is only half the answer
A sandbox kept up for an agent session is billed while the model generates its next step, while a person reads the result, and while nothing happens at all. The model takes seconds per turn, a person may read for minutes between turns, and most tool calls finish in under a second.
We measured this on our own coding-agent sessions: 30 days of Archil's engineering team's transcripts, 384 agent loops and about 37,000 tool calls, using only the timestamps. If each loop had kept a sandbox running from its first tool call until 15 minutes passed with no tool call, the sandbox would have been idle for 65% of the time it ran, and for 88% in the median loop. With a 5 minute auto-stop, it would have been idle 48% of the time.
So the bill for an agent's sandbox depends mostly on when it stops:
- E2B kills a sandbox when its timeout expires, 5 minutes by default, unless you set the timeout to pause instead. Hobby sessions run for up to 1 hour and Pro sessions for up to 24 hours. A paused sandbox isn't billed for compute.
- Daytona stops a container sandbox after 15 minutes of inactivity by default, and pauses a VM sandbox after 60 minutes of inactivity. A stopped or paused sandbox is billed for its disk only.
- Modal Sandboxes have a default maximum lifetime of 5 minutes, configurable up to 24 hours, and an optional
idle_timeout. - Vercel Sandboxes time out after 5 minutes by default; sessions run for up to 45 minutes on Hobby and 24 hours on Pro.
- Cloudflare Containers stop billing after the instance goes to sleep, which can happen automatically after a timeout.
- Fly.io Sprites bill CPU and memory actually used, and a Sprite moves to a non-billed state within seconds of going idle, so an idle Sprite costs only its storage.
- Archil persistent sandboxes pause after 30 minutes idle by default (
idleTtlSeconds), and a session runs for up to 24 hours.
Short timeouts keep the bill down but make the agent pay for a cold start, or lose its sandbox, whenever the person takes a long break. Long timeouts keep the sandbox warm and bill for the wait.
What serverless tool calls cost instead
With serverless tool calls, each tool call starts a short-lived microVM against the agent's persistent disk and exits when the command finishes, so there is nothing to keep running between calls. Archil bills each disk.exec() call as one serverless tool call at $0.05 per 1,000 calls, with execution included and no CPU or memory charge. Storage is billed separately at $0.20 per GiB-month of active data.
In the same transcripts, agents made about 160 tool calls per hour of agent activity (model turns and tool calls, not counting the time between a person's turns). At $0.05 per 1,000, that is under $0.01 an hour, whether the agent then waits ten seconds or ten hours for its next turn.
Per-call pricing doesn't win at every call rate. At about 3,300 calls an hour, close to one a second sustained, it costs about the same as an idle 2 vCPU, 4 GiB sandbox on E2B or Daytona. An agent that hammers its tools that hard, or that needs a process to stay up, belongs in a long-lived sandbox.
When an always-on sandbox is worth paying for
- The agent runs a server or a watcher. A dev server, a database or a file watcher has to keep running between tool calls.
- The agent keeps state in memory. A Python kernel or REPL loses its variables when the process exits.
- Commands run longer than 5 minutes. Each Archil
execcall is capped at 5 minutes. Longer builds and test suites need a sandbox. - Tool calls arrive nearly continuously. Above roughly one call a second, per-call pricing stops being the cheaper option.
A common setup uses both: serverless tool calls for the agent's everyday bash, file and search tools, and a persistent sandbox started only for the step that needs a long-running process, with the same disk mounted in both. See Serverless execution and persistent sandboxes.