Skip to content

Resources and billing

A sandbox reserves CPU and memory, and its bucket pays for that reservation for as long as the sandbox runs. Size it to what your work uses, end it when the work is done, and read its usage to check. For how billing works, see Resources and billing in Concepts.

--cpu (vCPUs), --memory (MiB) and --pids set what the sandbox reserves; in Python, cpu=, memory= and pids=.

ID=$(cere sandbox create --image busybox:1.36 --cpu 0.25 --memory 256 --pids 256 --timeout 300 -q)
cere sandbox get $ID | grep -E '^(resources|timeout)'
resources cpu 0.25, memory 256 MiB, pids 256
timeout 300s (idle 0s)

The reservation is also the ceiling: the CPU quota equals --cpu, and a sandbox that uses more memory than --memory ends with oom_killed.

Resource Default Allowed
--cpu 1 more than 0, up to 4
--memory 1024 MiB 128 to 8192 MiB
--pids 2048 1 to 32768
--timeout 600 s 1 s to 24 hours
Sandboxes per bucket 20 starting, running or unknown at a time; one more is refused with 409 limit_active_sandboxes

A request outside these is refused before anything starts:

cere sandbox create --image busybox:1.36 --cpu 8 --timeout 60
cere sandbox create --image busybox:1.36 --memory 64 --timeout 60
cere sandbox create --image busybox:1.36 --timeout 48h
error: 400 invalid_request: resources.cpu must be in (0, 4]
error: 400 invalid_request: resources.memory_mib must be in [128, 8192]
error: 400 invalid_request: timeout_s must be in [1, 86400]

A sandbox that needs more memory than it reserved ends with oom_killed; the command that was running gets exit code 128:

M=$(cere sandbox create --image python:3.12-slim --memory 128 --timeout 120 -q)
cere sandbox exec $M -- python -c "b = bytearray(512 * 1024 * 1024)"; echo "exit code: $?"
cere sandbox get $M | grep -E '^(status|exit)'
waiting on pid 2: waiting on PID 2 in sandbox "3e3aedf2...": urpc method "containerManager.WaitPID" failed: EOF
exit code: 128
status terminated
exit oom_killed (exit code 137)

Every sandbox ends at its --timeout (timeout=, seconds; the CLI also takes a duration such as 5m). --idle-timeout (idle_timeout=) ends it earlier when nothing has called exec or a file for that long. Idle timeouts are off by default.

T=$(cere sandbox create --image busybox:1.36 --cpu 0.25 --memory 256 --timeout 30 -q)
I=$(cere sandbox create --image busybox:1.36 --cpu 0.25 --memory 256 --timeout 5m --idle-timeout 20s -q)
sleep 50
cere sandbox get $T | grep -E '^(status|exit)'
cere sandbox get $I | grep -E '^(status|exit)'
status terminated
exit timeout (30s) (exit code 137)
status terminated
exit idle_timeout (20s) (exit code 137)

A sandbox also ends 60 seconds before the login it was created with expires, with the exit reason token_expiry, whichever comes first; a create with 60 seconds or less left on the login is refused. cere whoami shows when your login expires:

cere whoami | grep expires
expires 2026-12-24T21:57:01Z (in 29d05h)

For a sandbox that must outlive your login, sign in again first with a longer lifetime (cere login --days 30, see Signing in).

cere sandbox usage shows what the sandbox is billed so far next to what it measured; in Python, sb.usage().

cere sandbox exec $ID -- sh -c 'yes > /dev/null & sleep 10; kill $!'
cere sandbox usage $ID
billed cpu 0.25 vCPU × 11.6 s = 2.9 CPU-s (measured 2.6)
billed memory 0.25 GiB × 11.6 s = 2.9 GiB-s (measured 0.1)
wall 11.6 s
cpu 2.585 CPU-s
memory peak 24 MiB, 0.119 GiB-s
network out 0 B, in 806 B
disk peak 0.0 MiB
gpu 0.0 s
  • Billed is the reservation over the time the sandbox has run: vCPU × seconds and GiB × seconds, or the measured amount where that is more. It starts when the container starts (the image pull is free) and stops when gVisor stops.
  • Measured is what the node measured: CPU-seconds, GiB-seconds of memory in use, the memory peak, network bytes and disk.

cere sandbox get shows the same billed and usage lines, and after terminate they are final.

Each node writes a signed usage record for every sandbox every minute, plus a final one when it ends. cere usage lists them, newest first; in Python, cere.usage_records().

cere sandbox terminate $ID
cere usage --sandbox $ID
sb-01m89qrv95xamvxbnwnhgpewwj terminated: terminated by API
billed 0.25 vCPU × 16.8 s = 4.2 CPU-s (measured 2.6), 0.25 GiB × 16.8 s = 4.2 GiB-s (measured 0.2)
usage: wall 16.8s, cpu 2.59s, memory peak 24 MiB, 0.17 GiB-s, net out 0 B in 918 B, disk peak 0.0 MiB
PERIOD END SANDBOX FINAL BASIS RESERVED BILLED CPU-S MEASURED CPU-S BILLED GIB-S MEASURED GIB-S MEM PEAK NET OUT CPU UNITS RAM UNITS TCA DAC EXIT
2026-11-25T16:14:28Z sb-01m89qrv95xamvxbnwnhgpewwj final reserved 0.25 vCPU, 0.25 GiB 4.203 2.586 4.203 0.172 24 MiB 0 B 420281200000 420281225000 29927054 pushed terminated by API
1 records: billed 4.203 CPU-s, 4.203 GiB-s (measured 2.586 CPU-s, 0.172 GiB-s)

--since takes a duration back (1h) or an RFC 3339 time. A listing stops at --limit (default 100) and says so; --all lists and sums every record:

cere usage --since 1h --limit 5
cere usage --since 1h --all | tail -1
PERIOD END SANDBOX FINAL BASIS RESERVED BILLED CPU-S MEASURED CPU-S BILLED GIB-S MEASURED GIB-S ... DAC EXIT
2026-11-25T16:15:00Z sb-01m89qryxz9x2d2dcghj6nqgd4 reserved 1.0 vCPU, 1.0 GiB 44.805 5.043 44.805 10.109 ... pushed -
2026-11-25T16:15:00Z sb-01m89qnh5erh2xb8t1mb2n8wmj reserved 1.0 vCPU, 1.0 GiB 60.000 2.494 60.000 14.029 ... pushed -
2026-11-25T16:14:57Z sb-01m89qsamtae70382y3ngmvj9j final reserved 0.25 vCPU, 0.25 GiB 7.525 0.117 7.525 0.421 ... pushed exited with code 0
2026-11-25T16:14:55Z sb-01m89qs9ejmckx7fstyvgstrvs final reserved 1.0 vCPU, 1.0 GiB 30.036 0.147 30.036 0.421 ... pushed exited with code 0
2026-11-25T16:14:54Z sb-01m89qs75t3x0apy23h1t6w9pj final reserved 0.25 vCPU, 0.25 GiB 7.732 0.095 7.732 0.288 ... pushed timeout (30s)
the newest 5 records: billed 150.098 CPU-s, 150.098 GiB-s (measured 7.896 CPU-s, 25.268 GiB-s); there are more (--all sums every record)
41 records: billed 596.290 CPU-s, 596.290 GiB-s (measured 58.284 CPU-s, 70.776 GiB-s)

Each record has the period it covers, whether it is the final one, the billing basis (reserved), the reservation, the billed and measured CPU-seconds and GiB-seconds, and whether the node has delivered it. Every field is explained in Usage.

There is no price list yet: records count CPU-seconds and GiB-seconds, and nothing is converted to money.

The measured column says what the work needed. Run the same work at the default size and at a quarter of it, and compare:

BIG=$(cere sandbox create --image python:3.12-slim --timeout 300 -q -- python -c "import time; time.sleep(30)")
SMALL=$(cere sandbox create --image python:3.12-slim --cpu 0.25 --memory 256 --timeout 300 -q -- python -c "import time; time.sleep(30)")
sleep 50
cere sandbox get $BIG | grep -E '^(resources|exit|billed|usage)'
cere sandbox get $SMALL | grep -E '^(resources|exit|billed|usage)'
resources cpu 1, memory 1024 MiB, pids 2048
exit exited with code 0 (exit code 0)
billed 1.0 vCPU × 30.0 s = 30.0 CPU-s (measured 0.1), 1.0 GiB × 30.0 s = 30.0 GiB-s (measured 0.4)
usage wall 30.0s, cpu 0.15s, memory peak 24 MiB, 0.42 GiB-s, net out 0 B in 726 B, disk peak 0.0 MiB
resources cpu 0.25, memory 256 MiB, pids 2048
exit exited with code 0 (exit code 0)
billed 0.25 vCPU × 30.1 s = 7.5 CPU-s (measured 0.1), 0.25 GiB × 30.1 s = 7.5 GiB-s (measured 0.4)
usage wall 30.1s, cpu 0.12s, memory peak 15 MiB, 0.42 GiB-s, net out 210 B in 656 B, disk peak 0.0 MiB

The work measured the same in both; the smaller sandbox is billed a quarter as much. Size --cpu and --memory a little above the measured CPU and memory peak, end sandboxes when the work is done, and set --idle-timeout on sandboxes that wait for calls.

Every call to the API checks that the bucket’s owner has a positive balance. Without one, the API refuses the call, create included, with 403:

error: 403 FORBIDDEN: bucket owner has insufficient balance

In Python the same refusal is a cere.CereError with status 403. Top up the bucket owner’s balance and call again.