Before a team puts coding agents on cloud machines, someone usually has to answer a budget question: how many hours will this use in a month? A services firm quoting a fixed-price project asks it. So does a product team lead who has to explain a new line in the tooling budget.
You can answer it with arithmetic, and you do not need a trial to do so. This post gives the formula Sandscale bills on, a worksheet, and three worked examples. The examples use invented team sizes to show the method; replace them with yours.
The unit: an awake vCPU-hour
Sandscale's plan allowances are counted in awake vCPU-hours. Two facts from the plans reference matter for the arithmetic:
- A box counts for the whole time it runs, whether the agent is busy or waiting. A machine that is running and doing nothing counts the same as one that is running tests.
- Hours are vCPU-hours: a box with 4 vCPUs that runs for 3 hours is 12 vCPU-hours.
Memory is part of it too. Each plan includes a memory allowance per vCPU (4 GiB per vCPU on Pro and Team). Memory above that counts as vCPU-hours: every 4 GiB-hours of extra memory is 1 vCPU-hour. Most agent machines never need extra memory, so the worksheet below ignores it. If yours does, add it as a separate line.
Build host leases count against the same allowance, so a lease for a full test suite is lease size times lease hours, added to the total.
The worksheet
For each kind of agent machine your team will run, fill in one row:
| Column | What to put |
|---|---|
| A. Machines | How many of this kind run at the same time on a typical day |
| B. vCPUs | The size of one machine (see sizing a sandbox) |
| C. Hours a day | How many hours a day one machine is running, not how many it is useful |
| D. Days a month | Working days, or 30 if machines are left running |
The monthly figure for the row is A × B × C × D. The team's figure is the sum of the rows, plus lease hours.
Then compare it with what the plan includes. At the time of writing, the plans reference lists 1,500 awake vCPU-hours a month for Pro and 2,000 per member for Team, pooled across the team. Check the pricing page for the current numbers before you decide anything; they are the source of truth, not this post.
Example 1: eight engineers, one agent each, machines stopped at the end of the day
Eight engineers each run one agent on a 2 vCPU machine. The agent works on and off through a nine hour day, and the machine is stopped at the end of it. 22 working days.
- A = 8, B = 2, C = 9, D = 22
- 8 × 2 × 9 × 22 = 3,168 vCPU-hours a month
A Team plan for eight members pools 8 × 2,000 = 16,000 included hours, so this is about a fifth of the pool. The point of the example is the method: a small machine, stopped when work ends, is a small number.
Example 2: the same team, machines left running
Same eight machines, but nobody stops them. They run all day and all night, 30 days.
- A = 8, B = 2, C = 24, D = 30
- 8 × 2 × 24 × 30 = 11,520 vCPU-hours a month
That is about 3.6 times Example 1 for the same useful work. The difference is all hours when the machine was running and nobody, including the agent, was doing anything. A workspace stops when it has been idle for a while, and you can change how long: sandscale workspace update --ws-id WORKSPACE_ID --idle-timeout-seconds 1800 --yes sets it (the minimum is 300 seconds, within your organization's limit). A time to live puts a ceiling on a run, and a weekly look at sandscale workspace list catches the machines nobody closed.
Whether a workspace counts as idle while an agent works in a detached terminal is worth testing before you rely on it. Our post on agents that keep working when the laptop sleeps shows a way to check.
Example 3: a services firm with four client projects
A firm has four client projects running at once. Each has two agents, each on its own 4 vCPU machine, and machines are never shared between clients. The machines run during the working day of eight hours, 22 days. Once a week each project leases a build host for a full test suite: 16 vCPUs for 2 hours, four times a month per project.
- Agent machines: A = 8, B = 4, C = 8, D = 22 gives 8 × 4 × 8 × 22 = 5,632
- Leases: 4 projects × 4 leases × 16 vCPUs × 2 hours = 512
- Total: 6,144 vCPU-hours a month
Two things to take from it. The leases are less than a tenth of the total even though each one is large, because they are short; that is the argument for leasing a build host instead of sizing every machine for the full suite. And the per-client split is arithmetic too: the rows are already per project, so the same worksheet gives each client's share of the hours, which helps when you decide how to account for the cost.
What moves the number
In rough order of effect:
- Hours a day. Stop the machine when the work ends. A schedule helps:
--autostart-schedule "CRON_TZ=Asia/Kolkata 30 9 * * 1-5"onworkspace updatestarts it at 09:30 India time on weekdays, and the idle timeout stops it again. - Machine size. Doubling the vCPUs doubles the row. Start small and measure; our post on sizing says how.
- Number of machines. One per agent is the point, so this is a product decision, not a waste to trim. See running coding agents in parallel for how many a person can usefully supervise.
- Builds on the agent's machine versus a lease. A lease costs its size only while held.
Check the estimate against reality
After the first two weeks, compare your worksheet with what your usage shows. If you are far off, the error is almost always the hours column: machines that ran longer than the work. Fix that first, then revisit the size.
If you want a hard ceiling while you learn, spend caps exist at the task, agent, project and organization level on Pro, Team and Enterprise; our post on spend caps covers where to set them.
The point of the worksheet is not precision. It is that the estimate is the same arithmetic the plan uses, so you can predict a month before it starts, and see which habit moves it. For the plan itself, start with pricing.
Originally published on the Sandscale blog.
