The Hidden Cost of Hosted Agent Sandboxes
Per-second billing sounds cheap until you do the math against what the same compute costs when you own the node. Here are real, published rates — not estimates — and an honest answer to when self-hosting wins.
The published rates
Both numbers below come straight from each vendor's pricing page, for a 2-vCPU sandbox (E2B's default size):
| Provider | Rate | Cost / 2-vCPU sandbox-hour |
|---|---|---|
| E2B | $0.000028/vCPU-second (2 vCPU default) | $0.1008/hr |
| Modal (Sandboxes) | $0.00003942/core-second (sandbox-tier rate) | $0.284/hr |
What owning the node costs
A GKE e2-standard-4 node (4 vCPU, 16 GB) runs $0.134/hour on-demand in us-central1. It has enough vCPU to bin-pack two 2-vCPU sandbox pods side by side (minus a small reserved slice for system pods). Fully packed, the effective cost per sandbox-slot drops to about $0.067/hr— roughly a third of E2B's rate and a quarter of Modal's.
The honest crossover point
That only holds while the node is busy. An idle node still costs $0.134/hrwhether it's running zero sandboxes or two; pay-per-second pricing has no equivalent idle cost. So the answer depends entirely on utilization:
| Usage pattern | Cheaper option |
|---|---|
| A few sandboxes/day, short-lived | Hosted — you pay for exactly the seconds used, no idle node cost |
| Sustained concurrent load | Self-hosted — bin-packing turns idle capacity into headroom, not a per-session bill |
| Bursty but predictable (business hours, batch windows) | Self-hosted with autoscaling — scale down in the gaps, keep the per-slot advantage at peak |
What this leaves out
Cutting the compute bill isn't cutting the total cost. A hosted vendor is charging you to absorb real operational work — patching, upgrades, on-call, and the warm-pool/autoscaling layer that makes bin-packing work in practice, not just on paper. boxxkite's SandboxManagerand warm-pool manager exist so you don't build that layer from scratch — but someone still owns the cluster.
Sources: E2B and Modal pricing pages (fetched 2026-07-19); GKE e2-standard-4 on-demand pricing, us-central1 (fetched 2026-07-19). Rates change — verify current numbers before making a purchasing decision off this post.