Modal details per-second sandbox pricing with a requested minimum
Modal bills sandbox resources each second, subject to a requested minimum, while bursts use spare host capacity. Modal says typical sandboxes spend over half their lifetime below 6% of peak CPU use.

TL;DR
- Sandbox CPU and memory are billed each second at the higher of actual use or the requested minimum, according to Modal's pricing explanation.
- CPU demand is sharply uneven: according to Modal, a typical sandbox spends over half its lifetime below 6% of its peak CPU use.
- Cost estimates follow average billed consumption rather than peak capacity, as Modal's follow-up explains.
Modal counts physical CPU cores, approximately two vCPUs each, a quiet gotcha in price comparisons. Its default sandbox can burst 16 cores above its request and has no configured memory ceiling.
CPU idle between tool calls
Coding-agent sandboxes sit nearly idle while the model reasons, then spike during dependency installs, tests, and builds, according to Modal's post. The company reports similar patterns in RL rollouts, evals, and app builders.
Unrelated customer workloads rarely peak together, Modal says, allowing its scheduler to maintain spare host capacity that multiple sandboxes share when bursting.
Per-second billing floor
CPU and memory are charged independently using max(request, actual) each second, according to the sandbox resource documentation.
- Default request: 0.125 physical CPU cores and 128 MiB of memory.
- Guaranteed resources: Increasing a request raises the minimum bill, including while the sandbox is idle.
- Average billed usage: Cost calculations include the floor applied each second. Raw average utilization can understate the charge when usage drops below the request.
Requests and burst limits
The resource API accepts separate requests and limits. This Python example keeps the default guaranteed resources while capping CPU at four physical cores and memory at 2 GiB:
Modal's sizing examples distinguish three behaviors:
- Default CPU ceiling: The request plus 16 cores, or 16.125 cores with the default request.
- Explicit memory ceiling: A sandbox that crosses its memory limit is stopped.
- Fixed allocation: Setting request equal to limit fixes the guaranteed resource allocation. Modal lists consistent environments for evals and RL rollouts as a use case.
Customer-facing agents can encounter software requirements that are difficult to predict before execution:
Calculator assumptions
A 20-minute coding-agent task in Modal's calculator uses illustrative workloads, not production traces. Its figures are normalized to cost per sandbox-hour:
- Average billed use: 0.44 physical CPU cores and 0.94 GiB.
- Peak use: 6 physical CPU cores and 2.30 GiB.
- Fixed reservation: 1.5 physical CPU cores and 3 GiB, sized for the busiest minute of CPU and peak memory, rounded up to whole vCPUs and GiB.
- Modeled cost: 8.4¢ per sandbox-hour on Modal versus 20.0¢ for the fixed reservation, a 58% saving.
The comparison uses editable reservation prices and different unit rates for the two models. Its reservation is sized to the busiest CPU minute, rather than the instantaneous six-core peak.
CPU contention and OOM evictions
Host exhaustion produces different failure modes for CPU and memory, as detailed in Modal's eviction policy:
- CPU contention: Bursting sandboxes slow down until capacity becomes available. Each retains at least its requested CPU.
- Memory exhaustion: Sandboxes using more than their memory request may be evicted with an out-of-memory error. Modal says a sandbox within its request is never evicted for host memory exhaustion.
- Eviction SLO: For bursting sandboxes below 8 GiB, Modal targets an OOM rate below 0.0001% per minute, approximately one eviction per 694 sandbox-days. It does not yet publish an SLO for larger sandboxes.