---
title: "Per-second billing for sandboxes, from $0.018/h · Pethost"
description: "Pethost bills a running sandbox by the second, rounded up per run with a 10 s minimum; paused at 30%, stopped per GiB-month. No start fees. Worked examples."
---

[Agent Sandboxes](https://pethost.dev/sandboxes/) Billed by the second

# Billed by the second, and nothing for starting

Four meters, each counted by the second, and no fee for making a sandbox. A SMALL sandbox costs $0.018 an hour while it runs and $0.0054 while it is paused.

Two lanes of seconds: a run of 37 seconds billed at $0.000005 a second, rounded up to the whole second, then paused seconds at 30%; creating it cost $0.

## The four meters of per-second billing

- **Running**: its size’s hourly price, by the second. Each run is rounded up to a whole second and counts 10 seconds at least, unless the server ended it: out of memory or disk, a restart of its machine, an unpaid workspace, a new size.
- **Paused**: 30% of that price, by the whole second, with no minimum.
- **Stopped**: $0.03 per GiB a month of what its disk holds of its own in object storage, never empty space and never the template’s files.
- **Volumes**: $0.20 per GiB a month of their whole size.

Templates are not billed: your plan bounds how much they hold. The disk of a running or paused sandbox is part of its size’s price, never billed apart. A second counts at one size only, and pausing and waking never turns running time into cheaper time, nor counts a second twice.

| Size | vCPUs · memory · disk | Running, an hour | Paused, an hour |
| --- | --- | --- | --- |
| SMALL | 2 · 4 GiB · 10 GiB | $0.018 | $0.0054 |
| DEFAULT | 4 · 8 GiB · 20 GiB | $0.036 | $0.0108 |
| LARGE | 8 · 16 GiB · 40 GiB | $0.072 | $0.0216 |
| XLARGE | 16 · 32 GiB · 80 GiB | $0.144 | $0.0432 |

A SMALL sandbox running costs $0.000005 a second, and the shortest charge there is, a run of 10 seconds, costs $0.00005.

## How the seconds are counted

The sandbox’s own server counts its seconds, as each change happens, from the moment its VM’s vCPUs are let run; the panel prices them to a billionth of a dollar, every minute for running and paused sandboxes and every hour for stored disks and volumes. `get_sandbox` shows a sandbox’s seconds and what it cost so far, in `usage`, and `list_usage` gives a row per UTC day, meter and size.

Python

CLI

```
from pethost.sandboxes import Sandboxes, SandboxSettings, Size

sandboxes = Sandboxes()  # reads PETHOST_TOKEN
sandbox = sandboxes.create_sandbox("base", settings=SandboxSettings(size=Size.SMALL))
sandboxes.run_command(sandbox.sandbox_id, command="python3 -c 'print(6 * 7)'")
sandboxes.stop_sandbox(sandbox.sandbox_id)  # its run ends here: 10 seconds at least

usage = sandboxes.get_sandbox(sandbox.sandbox_id).usage
print(usage.running_seconds, usage.paused_seconds, usage.cost_micros)  # cost in millionths

# The workspace's last 30 days: a row per UTC day, meter and size.
for row in sandboxes.list_usage().rows:
    print(row.day, row.meter.name, row.size.name, round(row.unit_hours, 3), row.cost_micros)
```

```
pethost sandbox new --name demo --size small
pethost sandbox run demo -- python3 -c 'print(6 * 7)'
pethost sandbox stop demo   # its run ends here: 10 seconds at least
pethost sandbox show demo   # its state, size and usage
pethost sandbox workspace   # the plan's limits and what is used
```

## Starts are free

Creating a sandbox, forking one (each copy) and starting a stopped one cost nothing. Your plan bounds how many come in any minute, hour and day: 36, 360 and 1,200 on the $20 plan, up to 270, 3,600 and 14,400 on the $2,000 plan. A start past a bound is refused (RESOURCE_EXHAUSTED with LimitReached), saying which window is full and when the call fits again. Waking a paused sandbox is never a start.

## Plans and the balance

A plan’s monthly price is usage it includes: $20, $100, $500 or $2,000 a month, plus VAT. The $20 plan’s usage is 1,111 hours of a SMALL sandbox running, or 3,704 paused. Past it your balance pays, topped up with $10 to $1,000 at a time, which never expires. With both spent, running and paused sandboxes are stopped and nothing new starts, but nothing is deleted, and stored disks and volumes go on counting; a payment lifts it within seconds. It all begins with a trial: 7 days with $1 of usage and 4 vCPUs, sizes up to DEFAULT, a card required.

## Two months, worked

An agent with one SMALL sandbox, working 2 hours a day and [paused](https://pethost.dev/sandboxes/pause-resume/) for the other 22: 60 hours running at $0.018 and 660 paused at $0.0054 make $4.64 of usage in a 30-day month, so the $20 plan covers about four such agents.

An eval fleet of 1,000 SMALL sandboxes a day, 60 seconds each: 500 sandbox-hours, $9.00 of usage a month, with no start fees, inside the $20 plan, whose 20 vCPUs run 10 SMALL sandboxes at once. The [billing docs](https://pethost.dev/docs/sandboxes/billing/) work through more cases.

## How it compares

For 2 vCPU and 4 GiB, as their pages read on 21 November 2026: E2B bills $0.1656 an hour, by the second. boat.dev bills $0.018, as we do, and $0.03 to $0.07 a start past the starts its plan includes. Vercel Sandbox bills memory in 1-minute minimum increments and CPU only while it is busy, and Modal bills the larger of what a sandbox requested and what it used.

[Read the docs](https://pethost.dev/docs/sandboxes/billing/)

## Questions

**Is there a minimum charge with per-second billing?**

10 seconds per run: $0.00005 for a SMALL sandbox. Paused seconds, stored disks and volumes have no minimum.

**What do starts cost?**

Nothing, within your plan’s starts per minute, hour and day.

**Is the disk billed?**

Running or paused, the disk is part of the size’s price. Stopped, only the bytes of its own in object storage count, at $0.03 per GiB a month.

**What happens when the included usage runs out?**

Your balance pays. With no balance left, running and paused sandboxes are stopped and none starts until a payment comes; nothing is deleted.

## Related

- [A sandbox pauses: its memory moves to its server’s disk and its price drops to 30%; a request arrives and it wakes in 0.08 s with the same process still running. Pauses with its memory A paused sandbox keeps its memory and processes on its server at 30% of the price, and the next call wakes it in about 0.1 s, exactly where it was. How it works](https://pethost.dev/sandboxes/pause-resume/)
- [A timeline of idle time: at 5 minutes the sandbox pauses at $0.0054 an hour, at 30 minutes it stops to object storage at $0.03 per GiB a month. Pauses itself when idle Five minutes without a call and a sandbox pauses; thirty and it stops to object storage. Every timer is set per sandbox, and 0 turns it off. How it works](https://pethost.dev/sandboxes/auto-pause/)

## Give your agent a computer in 0.15 s

[Start the free trial](https://console.pethost.dev/welcome?kind=sandboxes)

Pethost · Stephan Gomer · NIP 1133096755

Pethost

- [Templates](https://pethost.dev/templates/)
- [About](https://pethost.dev/about/)
- [Docs](https://pethost.dev/docs/)
- [Blog](https://pethost.dev/blog/)
- [API](https://pethost.dev/docs/api/)
- [CLI](https://pethost.dev/docs/cli/)
- [Plugin](https://github.com/pethost-dev/plugin)
- [Terms](https://pethost.dev/terms/)
- [Privacy](https://pethost.dev/privacy/)
- [Refunds](https://pethost.dev/refunds/)
- [support@pethost.dev](mailto:support@pethost.dev)

Databases

- [Postgres](https://pethost.dev/postgres/)
- [Valkey](https://pethost.dev/valkey/)

Agent Sandboxes

- [Sandboxes](https://pethost.dev/sandboxes/)
- [Pricing](https://pethost.dev/sandboxes/#pricing)
- [Docs](https://pethost.dev/docs/sandboxes/)
- [API](https://pethost.dev/docs/sandboxes/api/)

Comparisons

- [Coolify vs Dokploy vs CapRover vs Dokku](https://pethost.dev/blog/coolify-vs-dokploy-vs-caprover-vs-dokku/)
- [Coolify Cloud vs Dokploy Cloud](https://pethost.dev/blog/coolify-cloud-vs-dokploy-cloud/)
- [Railway vs Render vs Fly.io pricing](https://pethost.dev/blog/railway-vs-render-vs-fly-io-pricing/)
- [Managed Docker Compose hosting](https://pethost.dev/blog/managed-docker-compose-hosting/)

Alternatives

- [Railway alternatives](https://pethost.dev/blog/railway-alternatives/)
- [Heroku alternatives](https://pethost.dev/blog/heroku-alternatives/)
- [Dokploy alternatives](https://pethost.dev/blog/dokploy-alternatives/)
- [Coolify alternatives](https://pethost.dev/blog/coolify-alternatives/)
- [Render alternatives](https://pethost.dev/blog/render-alternatives/)
- [Sliplane alternatives](https://pethost.dev/blog/sliplane-alternatives/)
