The Hidden Cost of Hosted Agent Sandboxes
Per-second billing sounds cheap until you do the actual math against what the same compute costs when you own the node. Below are real, currently-published rates — not estimates — and an honest answer to when self-hosting actually wins, and when it doesn't.
The real, published rates
Both E2B and Modal publish their compute pricing directly. Neither number below is estimated — both are taken from each vendor's own pricing page, for a 2-vCPU sandbox (E2B's own 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 the same compute costs when you own the node
A GKE e2-standard-4 node (4 vCPU, 16 GB) runs $0.134/hour on-demand in us-central1 — a real, current published rate, not a hypothetical. That one node has enough vCPU to bin-pack two concurrent 2-vCPU sandbox pods side by side (ignoring a small reserved slice for kubelet/system pods, which reduces this slightly in practice). Run it fully packed and the effective cost per sandbox-slot drops to about $0.067/hr— roughly a third of E2B's rate, and about a quarter of Modal's.
The honest crossover point
That comparison only holds while the node is actually busy. A node sitting idle waiting for the next sandbox request costs the same $0.134/hrwhether it's running zero sandboxes or two — pay-per-second hosted pricing has no equivalent idle cost at all. The real answer to "is self-hosting cheaper" depends entirely on utilization:
| Usage pattern | Cheaper option |
|---|---|
| A few sandboxes/day, short-lived | Hosted — you're paying for exactly the seconds used, no idle node cost |
| Sustained concurrent load (a real product surface) | Self-hosted — bin-packing turns idle capacity into headroom instead of a separate bill per session |
| Bursty but predictable (business hours, batch windows) | Self-hosted with cluster autoscaling — scale nodes down in the gaps, keep the per-slot advantage during the peaks |
What this comparison deliberately leaves out
Cutting the compute bill isn't the same as cutting the total cost. Running your own Kubernetes cluster has a real operational cost that a hosted vendor is charging you to absorb — patching, upgrades, on-call, the platform-engineering time to build the warm-pool/autoscaling layer that makes bin-packing actually work in practice instead of just in theory. boxkite's SandboxManagerand warm-pool manager exist specifically to make that layer something you don't have to build 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.