Built on Tempo · live on Moderato testnet
Rivus is pay-per-second billing for compute and APIs. Customers are charged for exactly the work delivered, the session settles on-chain, and whatever they didn't use comes back automatically.
$ npx rivus-meter init$ npx rivus-meter pay http://localhost:3000/api/render --max 0.5
It makes a testnet wallet, asks this page's provider for its price, pays by the second, and prints the settlement.
Illustration. The live demo below moves real testnet funds.
Live from the chain
Built on Tempo
Tempo is a payments-first chain: stablecoin settlement, low fees, and a protocol for machines to pay each other. Rivus exists because of that. Every payment on this page is a Tempo payment channel, opened, settled and refunded by Tempo itself.
01Machine Payments Protocol
A provider states its price over HTTP 402 and a buyer pays without an account, a card or an invoice.
02TIP-20 payment channels
The buyer's deposit sits in escrow on Tempo, and the unused part is returned by the chain, not by a promise.
03Fees paid in stablecoin
Both sides hold only pathUSD. Opening and closing a session cost each of them under 0.0001 pathUSD in our runs.
04EVM-compatible tooling
Rivus is a TypeScript package built on Tempo's mppx SDK and viem. There was no new contract to write or audit.
What it does
A provider wraps an endpoint. A buyer locks a small deposit and starts receiving work. Each unit delivered is paid for as it arrives, and when either side is done, the session settles and the remainder is returned. No accounts, no invoices, no trust required in either direction.
Try it
A buyer books up to 100 seconds of compute at the demo price and deposits 1.00 pathUSD. Choose the moment it stops.
Flat fee or prepaid
Rivus, per second
Billed by the second, the buyer keeps 0.77 pathUSD it would otherwise have paid for compute it never used.
Each unit is charged for the CPU time it actually took, measured on the provider, not for a slot or a tier.
The buyer can walk away mid-task. The provider keeps what it earned and the rest of the deposit returns on close.
Every session ends in a transaction on Tempo. The page links to it, so the bill is evidence and not a claim.
No sign-up, no card, no invoice. A program holding a key can discover the price over HTTP 402 and pay for itself.
Vouchers are signed and exchanged off-chain while the work streams. Only opening and closing the channel touch the chain.
The channel mechanics are Tempo's own Machine Payments Protocol. Rivus adds the meter on top and no new contract.
| Compared with how usage is billed today | Flat fee | Invoice | Prepaid credits | Rivus |
|---|---|---|---|---|
| Pay only for what was used | ✕ | ✓ | partly | ✓ |
| No account or contract first | ✕ | ✕ | ✕ | ✓ |
| Unused funds returned automatically | ✕ | n/a | ✕ | ✓ |
| Bill can be verified independently | ✕ | ✕ | ✕ | ✓ |
| Usable by an autonomous agent | ✕ | ✕ | partly | ✓ |
How it works
Five short chapters. They advance on their own; hover to pause, or pick one.
01 / 05
A flat fee charges for time nobody used. An invoice needs trust and a billing relationship before any work starts. Prepaid credits leave money stranded. An autonomous agent can't do the paperwork for any of them.
Live demo
The provider below rents out CPU time to render a fractal. Press start and a buyer agent opens a channel, pays per second of compute as tiles arrive, and settles on Tempo testnet. The fractal is a stand-in for any metered job.
Pay-per-second billing on Tempo. Rent compute, pay for the seconds used, get the rest back.
Ready to render
216 tiles of real CPU work, each billed for the time it takes. Stop whenever you like.
Recording or presenting? Open the demo on its own page.
For developers
Install one package. The meter times and bills your work, the buyer pays for it under a hard cap, and every session settles on Tempo.
import { createMeter } from "rivus-meter/server";
const meter = createMeter({
privateKey: process.env.PROVIDER_PRIVATE_KEY, // the account that gets paid
secret: process.env.RIVUS_SECRET,
price: "0.01", // pathUSD per second of work
deposit: "1", // what a buyer is asked to lock
});
// Your work, as an async generator. Rivus quotes the price, opens the payment
// channel, times each step, bills it, and settles when either side is done.
export const { GET, POST } = meter.route(async function* (job) {
for await (const tile of renderTiles(job.signal)) {
yield tile; // delivered to the buyer, billed for the time it took
}
});Documentation
One document covers the whole project: the problem, the solution, how a session works, and every step to add it to your own service, your own buyer, or your own AI agent, including prompts you can paste into a coding assistant.
Where it fits
The demo renders a fractal because it is honest CPU time that is easy to watch. The same meter applies to:
Charge for the seconds a job ran, not the hour it was booked.
Bill each response for the time or tokens it consumed.
Meter a stream of results without issuing keys or invoices.
Let one program buy work from another with a spending ceiling.
Start a render, stop it halfway, and follow the link to the transaction on the Tempo explorer.
Run the live demo