English
Docs menu

Agent Sandboxes docs · Concepts

Sandbox pricing and billing: per second, by state

Updated · 8 min read

A sandbox is billed by the second for what each state holds: its size's price while it runs, 30% of that while it is paused, and its stored bytes while it is stopped. Starting one costs nothing. A plan's price is usage it includes, and a balance you top up pays for the rest. This page gives every rate, the rules of rounding, the plans and three worked examples.

In short
  • Running: $0.009 a vCPU-hour, memory and disk included, by the second. SMALL is $0.018 an hour.
  • Paused: 30% of the running price, by the second, memory and processes kept.
  • Stopped: $0.03 a GiB a month of the sandbox's own data. Volumes are $0.20 a GiB a month.
  • Starts are free: creating, forking and starting a stopped sandbox have no fee, within a limit per minute, hour and day.
  • Plans from $20 a month, which is $20 of included usage. Prices are without VAT.

What is counted

Four meters count a workspace's usage:

  • RUNNING: each second a sandbox runs, at its size.
  • PAUSED: each second a sandbox is paused, at its size. Its server keeps its memory and its place for it.
  • STORED_GIB: the bytes of its own that a STOPPED sandbox's disk holds, which object storage keeps. Empty space and the template's files are not counted.
  • VOLUME_GIB: a volume's whole size, used or not.

Templates are not billed: your plan bounds the room they take. The disk of a running or paused sandbox is in its size's price.

Rates

SizevCPUs, memory, diskRunning, an hourPaused, an hourRunning a monthPaused a month
SMALL2, 4 GiB, 10 GiB$0.018$0.0054$13.14$3.94
DEFAULT4, 8 GiB, 20 GiB$0.036$0.0108$26.28$7.88
LARGE8, 16 GiB, 40 GiB$0.072$0.0216$52.56$15.77
XLARGE16, 32 GiB, 80 GiB$0.144$0.0432$105.12$31.54
  • Every size is $0.009 a vCPU-hour, with its memory and disk included.
  • A stopped sandbox's own data is $0.03 a GiB a month; a volume is $0.20 a GiB a month of its size.
  • A month is 730 hours. Prices are without VAT. A workspace billed in euros pays the same numbers in euros.

Per-second billing, and how a run is rounded

  • A run is a start, a resume, a wake or a fork's copy, until the sandbox pauses, stops or is deleted. Its seconds are rounded up to a whole second, and a run counts 10 seconds at least.
  • No minimum when the server ended the run: out of memory or disk, its machine's restart, an unpaid workspace, or a new size.
  • Paused time counts whole seconds, with no minimum. A sandbox paused for its server's restart counts nothing.
  • Nothing counts twice. A second counts at one size and in one state, and pausing and waking never turn running time into cheaper time.

So the shortest run you pay for is 10 seconds of a SMALL sandbox: $0.00005.

Plans

A plan's monthly price is also the usage it includes each month. The plan sets a budget too: how many vCPUs your sandboxes may hold at once, the largest size, and the room for volumes and templates.

Plan, a monthIncluded usagevCPUs at onceLargest sizeVolumesTemplates
$20$2020LARGE100 GiB5 GiB
$100$100128XLARGE600 GiB30 GiB
$500$500700XLARGE3,500 GiB175 GiB
$2,000$2,0003,000XLARGE16,000 GiB800 GiB
  • The vCPU budget counts every sandbox that is RUNNING or PAUSED, every STOPPED one with wake_when_stopped, and every create, fork or start under way. 20 vCPUs hold 10 SMALL or 5 DEFAULT sandboxes at once, running or paused. Stopped sandboxes do not count, however many.
  • Past a budget a call answers RESOURCE_EXHAUSTED with LimitReached, which names the limit. A paused sandbox already counts, so waking it is refused only when the workspace holds more than its plan allows now, as after a change to a smaller plan.
  • Changing plans: a costlier plan starts a new month now and adds what was left of the included usage; a cheaper one starts at the next month, with nothing refunded.

Starts are free, within a limit

Creating a sandbox, each copy of a fork and starting a STOPPED sandbox are starts, and a start has no fee: you pay only for the seconds that follow. Waking a PAUSED sandbox is never a start. A plan bounds how many starts may happen in any minute, hour and day, each window sliding:

PlanStarts a minuteAn hourA day
$20363601,200
$100901,2605,040
$5001952,52010,080
$2,0002703,60014,400
Trial1575225

A start past a limit answers RESOURCE_EXHAUSTED with LimitReached: its limit is starts_per_minute, starts_per_hour or starts_per_day, and its retry_time says when enough starts have left the window for the call to fit. A fork of more copies than a limit allows has no retry_time: make fewer copies at a time. Your workspace's limits are in Workspace.limits.

Included usage

Each month of your plan begins with its price as included usage, and every second of every sandbox is paid from it first. What is left at the end of the month does not carry over: the next month begins with the plan's whole amount again.

Balance

Once the included usage is used up, your balance pays. You top it up in the console, from $10 to $1,000 at a time, and it never expires. A balance can go a little below zero, by what ran between its last cent and the stop and by what is stored after it; the next month's included usage pays that first.

Trial

The first plan of Agent Sandboxes on an account starts with a 7-day trial: $1 of usage, 4 vCPUs at once, sizes up to DEFAULT, and 10 GiB of volumes. That is about 55 hours of a SMALL sandbox running, or 27 of a DEFAULT one. A card is needed to start it, and the balance cannot be topped up during it. The plan's first payment comes when the trial ends, or when you start the plan sooner.

When nothing pays

When the included usage is used up and the balance is empty, the workspace is suspended:

  • its RUNNING and PAUSED sandboxes are STOPPED, with the reason UNPAID;
  • nothing starts, resumes or wakes, and no volume or template is made (UsageUnpaid);
  • what it stores is still counted;
  • a top-up, or the next month of the plan, lifts it within seconds. Its sandboxes then start again by ResumeSandbox.

Worked examples

An agent's sandbox: 2 hours at work, 22 paused, a day

A DEFAULT sandbox for an agent such as Claude Code, with its stop timer off so that its processes stay. It works 2 hours a day and waits, paused, for the other 22.

  • 2 h running: 2 × $0.036 = $0.072
  • 22 h paused: 22 × $0.0108 = $0.2376
One day: $0.3096. A month of 730 hours: about $9.42, against $26.28 for the same sandbox always running, 64% less.

Stopped overnight it would cost less still, but its processes would end. 2 such agents fit in the $20 plan's included usage, and its 20 vCPUs hold 5 DEFAULT sandboxes at once.

1,000 evals a day, 40 seconds each

An eval harness starts a SMALL sandbox per case, runs it for 40 seconds, and deletes it.

  • The cost: 40,000 seconds × $0.000005 = $0.20 a day, about $6.08 a month. The starts are free. An eval of 3 seconds still counts 10: $0.05 a day for all of them.
  • On the $20 plan: 10 run at once, which alone would take about 67 minutes, but the limit of 360 starts an hour holds the rest back: about 2 h 19 min in all, within its 1,200 starts a day.
  • On the $100 plan: 64 run at once, held to 90 starts a minute, so all of them take under 12 minutes.
  • Delete them, or set delete_after_idle_seconds: each day's batch would otherwise go on costing its stored bytes.

A preview that sleeps

A SMALL sandbox serves a branch's preview on a public port, its pause timer at 120 seconds and its stop timer off. It gets 10 visits a day, each 3 minutes and then the 2 minutes of its pause timer.

  • Running: 3,000 seconds a day, $0.015.
  • Paused: the other 83,400 seconds, $0.125.
  • In all: $0.14 a day, about $4.26 a month. Never visited, it costs $3.94 a month.

A visit wakes it in about 0.2 s, its dev server where it was. A paused preview counts against the vCPU budget: 10 of them on the $20 plan, 64 on the $100 plan.

What $20 buys

1,111 hours of a SMALL sandbox running, or 3,704 hours paused, or 667 GiB-months of stopped sandboxes. A stopped sandbox holding 2 GiB of its own costs $0.06 a month.

Where to see your usage

  • A sandbox's usage is Sandbox.usage: running_seconds, paused_seconds, stored_gib_hours and cost_micros, what it was charged so far, in millionths of the currency. It is at most some 10 seconds old.
  • The workspace's usage is ListUsage: a row per day (UTC), meter and size, as it was charged.
  • What is left is Workspace.billing: the included usage left, the balance, the end of the month, and whether the workspace is in its trial or suspended.
  • In the console, the workspace's Usage page shows the same.

Questions

Do I pay while a sandbox is paused?

Yes, 30% of its running price, by the second: its server keeps its memory and its place for it. A DEFAULT sandbox paused costs $0.0108 an hour.

Is there a fee per start?

No. Creating a sandbox, each copy of a fork and starting a stopped one cost nothing; a plan bounds how many may happen a minute, an hour and a day. Waking a paused sandbox is never a start.

Is the disk billed?

Not while a sandbox runs or is paused: the disk is in its size's price. A stopped sandbox pays $0.03 a GiB a month for the data of its own its disk holds, never for empty space.

Are templates billed?

No. Your plan bounds the room your templates take: 5 GiB on the $20 plan.

Is there a minimum charge per run?

A run counts 10 seconds at least, so the shortest SMALL run costs $0.00005. Paused seconds have no minimum.

What happens when my included usage runs out?

Your balance pays from then on. When both are empty, running and paused sandboxes stop until you top up or the next month begins.

Try Pethost Agent Sandboxes

A 7-day trial with $1 of usage and 4 vCPUs, with a card. Then a plan from $20 a month, which includes as much usage.

Start the trial