Built on Tempo · live on Moderato testnet

Bill by the second.
Refund the rest.

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.

Give this to your agent
$ 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.

Session meterBilling
0.000000pathUSD
Spent 0.000000Refundable 1.000000
0.0 s of computevoucher signed off-chain

Illustration. The live demo below moves real testnet funds.

  • Built on Tempo
  • Machine Payments Protocol
  • TIP-20 payment channels
  • EIP-712 vouchers
  • pathUSD settlement
  • HTTP 402
  • Moderato testnet

Live from the chain

— sessions
settled on Tempo by this page's provider
— pathUSD
paid for work delivered
— pathUSD
returned to buyers, unused
—
since the latest settlement

Built on Tempo

Tempo made payments native.
Rivus makes them continuous.

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.

  1. Your serviceany metered endpoint
  2. Rivussession · charge · receipt
  3. Machine Payments Protocolchannels · vouchers
  4. TempopathUSD settlement

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.

Network
Tempo Testnet (Moderato)
Chain ID
42431
Settlement token
pathUSD · TIP-20 · 6 decimals
Built on
mppx · viem/tempo
Open the Tempo explorer →

What it does

A meter between a provider and whoever is paying

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

Drag to stop the job

A buyer books up to 100 seconds of compute at the demo price and deposits 1.00 pathUSD. Choose the moment it stops.

23s usedof 100 s booked

Flat fee or prepaid

Paid
1.00
Refunded
0.00

Rivus, per second

Paid
0.23
Refunded
0.77

Billed by the second, the buyer keeps 0.77 pathUSD it would otherwise have paid for compute it never used.

Billed for real work

Each unit is charged for the CPU time it actually took, measured on the provider, not for a slot or a tier.

Stop at any moment

The buyer can walk away mid-task. The provider keeps what it earned and the rest of the deposit returns on close.

Checkable by anyone

Every session ends in a transaction on Tempo. The page links to it, so the bill is evidence and not a claim.

Made for agents

No sign-up, no card, no invoice. A program holding a key can discover the price over HTTP 402 and pay for itself.

No gas between units

Vouchers are signed and exchanged off-chain while the work streams. Only opening and closing the channel touch the chain.

Nothing custom to audit

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 todayFlat feeInvoicePrepaid creditsRivus
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

One session, start to finish

Five short chapters. They advance on their own; hover to pause, or pick one.

01 / 05

Usage is continuous. Billing isn't.

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.

Flat feePays for idle time✕
InvoiceTrust first, money later✕
Prepaid creditsUnused balance is stranded✕
Per-second, settled on-chainExact, automatic, checkable✓

Live demo

Watch a real session, and stop it whenever you like

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.

Ready to render

216 tiles of real CPU work, each billed for the time it takes. Stop whenever you like.

  1. 1Open channeldeposit locked in escrow
  2. 2Stream voucherssigned off-chain, per tile
  3. 3Settle on-chainone transaction
  4. 4Refund the restback to the buyer

Recording or presenting? Open the demo on its own page.

For developers

Meter your own endpoint with one package

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.

app/api/render/route.ts
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

Everything, written down

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

Anything sold by the unit of work

The demo renders a fractal because it is honest CPU time that is easy to watch. The same meter applies to:

Compute and GPU rental

Charge for the seconds a job ran, not the hour it was booked.

Model inference

Bill each response for the time or tokens it consumed.

Paid APIs and data feeds

Meter a stream of results without issuing keys or invoices.

Agent-to-agent services

Let one program buy work from another with a spending ceiling.

See it settle for yourself

Start a render, stop it halfway, and follow the link to the transaction on the Tempo explorer.

Run the live demo