Metering and settlement
How a running GPU is counted by the second and charged on chain every few seconds, and how a generation is charged once.
A rental is metered per second from the moment SSH and Jupyter answer, at the GPU's rate in credits per second. The backend settles what it has counted every 60 seconds and once more at stop. A generation is charged once, when its file is stored.
- Launch300 credits headroom
- Provisioning
- Runningsettles every 60 s
- Stopor credits reach zero
- Stoppedfinal receipt
#Rates
| GPU | Memory | Credits per second, from | Per hour, from | Available |
|---|---|---|---|---|
| H200 | 141 GB | 1.23 | $4.44 | 46 |
| H100 SXM | 80 GB | 0.67 | $2.40 | 71 |
| A100 | 80 GB | 0.29 | $1.04 | 8 |
| L40S | 48 GB | 0.13 | $0.46 | 11 |
| RTX 4090 | 24 GB | 0.11 | $0.39 | 160 |
Rates are live. The machines come from Lium, and each GPU's rate is its machine's hourly price there, converted to credits per second; the rate quoted when you launch holds for the whole rental. An H100 SXM is from 0.67 credits a second, or from $2.40 an hour. A 10-minute test is charged 600 seconds at that rate, not a rounded hour.
#A settlement
A settlement is one settle transaction, signed by the settler key in the program's configuration, that debits one wallet's credit account. It carries one line per job: for a metered rental, one sealed minute; for an unmetered rental, its seconds since the last settlement; for a generation, its units. The settler packs at most 8 lines into a transaction, or 2 sealed lines, and each line emits one receipt.
Each line is charged what it asks for or, when the balance is lower, the whole balance. SHDR-backed credits go first. A line from an agent key is checked against the key's caps, and the transaction fails if it breaks one. The credit account's settle_nonce must match, so a settlement cannot land twice or out of order.
A rental of 122 seconds settles as three lines: two of 60 seconds, and a last one of 2 seconds at stop, each charged at the rate locked at launch. The receipt of the last line is decoded in Read receipts.
#The meter agent
Every rented machine boots with a meter agent inside it, a small program that opens no port and only posts out to the API. At boot it makes an Ed25519 key in memory, writes the public half to /etc/shader/meter.pub in base58, reads the GPU's UUID from nvidia-smi, and registers both for its rental, once. The secret half is never written to disk or sent anywhere.
While the GPU is up, the agent signs one tick a second and posts them in batches every 10 seconds. Its registration signs "shader-meter-register/v1\0", text(jobId), the 32-byte public key and text(gpuUuid); each tick signs the tick message under The encodings, with the second counting from 0 at registration.
The agent posts with a launch token made for that one rental, good only for its registration and its ticks; it cannot read or stop anything, and your SSH session cannot see it.
The instance shows the same key as meterKey, with the GPU as gpuUuid, so you can compare them from inside the machine:
cat /etc/shader/meter.pub
nvidia-smi --query-gpu=uuid --format=csv,noheaderOn a local rental both printed what its instance showed: EsXzMW99qtZAFiHSRhuCs5N2FVrcWtjFaJnFhpBMdr7 and GPU-531bcfd6-5d2f-e2a3-039c-280536009bb0.
#Signed seconds
A metered rental is charged for the seconds its meter signed, on credit settlements and x402 closes alike, by one rule:
Each tick is one second
Tick k signs the second that starts k seconds after the meter registered.
Only seconds the rental ran count
A tick is billable when its second starts inside the rental's running window, from
startedAtup to, not including,stoppedAt.Never more than the whole seconds run
Billed seconds are the billable ticks, capped at the whole seconds between
startedAtandstoppedAt. The first and last seconds of a window are usually partial, so a rental never bills more seconds than its meter signed or than it ran.
An H100 SXM that ran 60.264 seconds with 60 signed ticks billed 60 seconds. Seconds with no tick are a gap, and a gap costs nothing; so do provisioning and the seconds before the agent registered. Ticks posted after the stop are refused. If the ticks stop for longer than 30 seconds, meterGraceSeconds in /config, the rental is stopped the usual way with stopReason meter_stopped_signing and charged up to its last signed second.
The API checks every tick against the rental's meter key before storing it. A tick with a bad signature, a second that repeats or goes backwards, or a second ahead of time is refused and logged. Anyone can read a rental's ticks by its id at GET /instances/{id}/ticks, by minute: minute m holds seconds 60m to 60m + 59, each with its ticks, its gaps, and a digest once the minute has closed. Verify a rental's ticks checks them with a script that needs nothing from Shader.
A rental whose agent does not register within 120 seconds of running has no meter key. It is metered: false, keeps the server meter, and its receipt lines say unmetered: true.
#The encodings
These are fixed: each minute's digest goes on chain in its seal. text(s) is the u32 little-endian byte length of s in UTF-8 followed by its bytes, \0 is one zero byte, and the job id is the rental id.
| Value | Bytes |
|---|---|
| Tick message | "shader-meter-tick/v1\0", text(jobId), u64le(second), text(gpuUuid), signed with Ed25519 (a raw 64-byte signature) |
| Minute digest | SHA-256 of "shader-meter-minute/v1\0", text(jobId), text(gpuUuid), u32le(m), u32le(n), then for each of the n ticks in ascending second order u64le(second) and the 64-byte signature |
In JSON, signatures are padded base64 and digests lowercase hex. A minute still being written is open with a null digest.
#Sealed minutes
When a minute closes, the meter agent signs one more message over it, the seal, and posts it with the ticks; at shutdown it seals the open minute too. A credit rental settles one line per sealed minute, and each line carries the minute, its signed-second count and its digest. The same transaction carries one Ed25519 instruction with the seal, signed by the meter key, and settle refuses the line unless the seal matches the line and the key pinned for the job, its units are no more than the seal's count, and its minutes increase. The Receipt event then names the meter key, the minute, the digest and the signed count.
A seal is needed because a transaction is capped at 1,232 bytes and each Ed25519 signature check takes about 170 of them, so the program cannot check sixty ticks a line. It checks one seal per minute, and anyone can rebuild the seal from the public ticks. A minute that never got a seal, for example because its agent was killed, is not charged.
| Value | Bytes |
|---|---|
| Seal | "shader-meter-seal/v1\0" (21 bytes), the rental id as 16 raw UUID bytes, SHA-256 of the GPU UUID in UTF-8, u32le(minute), u32le(count), the 32-byte minute digest: 109 bytes, signed with Ed25519 |
The key is pinned on chain in a RentalMeter account per job, which the settler creates at the job's first sealed line and closes on its last. An RTX 4090 that ran 194.755 seconds settled four sealed minutes of 58, 60, 60 and 16 seconds, 194 in all; minute 0 was 58 because 2 ticks came before the machine was running. Every receipt carried the same meter key.
x402 closes are charged by the same rule from the stored ticks. A rental with no meter key settles as unmetered lines with no seal. require_meter in the program's configuration refuses those lines when it is on; it stays off until every production rental boots with the meter, and once it is on, a machine whose meter does not start is stopped before any charge, with stopReason meter_did_not_start.
#States of a rental
| State | What is happening |
|---|---|
provisioning | The machine is starting. The meter has not begun. |
running | SSH and Jupyter answer and the meter counts seconds. |
settling | A settlement is on its way to the chain. |
stopping | The machine is shutting down. |
stopped | The machine is off and its final settlement has landed. |
failed | The machine never ran. Nothing is charged. |
A rental stops when you stop it, when the balance reaches zero, or, for an agent, before a settlement would pass the key's caps.
#A generation
A generation's price is known before it starts (Generate a file lists them). Its credits are reserved while it runs, and one settlement line of kind generation charges it when the file is stored. A job paid from credits that fails is never settled. Signing a settlement costs compute units listed in Measured figures.