Skip to content

MPP sessions: one deposit, many calls

An MPP session is the session intent of the Machine Payments Protocol on Tempo (method tempo, intent session). Instead of one payment per call, your client locks a deposit in a payment channel whose payee is this server, then pays each call with a signed voucher: a cumulative total, never a transaction. This server checks the voucher, counts the call's price against it, and collects what was spent on chain in aggregate. A stock MPP session client (mppx) pays it as is.

Where it is offered

On the tools that take it, a 402 carries a tempo session challenge, last in WWW-Authenticate, after every other offer. It is not offered on wallet-identity routes, routes whose effect outlives the answer, routes that buy from an outside seller, and metered, model-backed or long-running routes. Where a session cannot carry a call, the 402 still lists every other way to pay. /api/pricing and /.well-known/x402 describe the session offer (mppSessions) while it is served, and /openapi.json lists it on each operation that takes it.

Open, pay, top up, close

  1. Open. Request the tool, read the session challenge in the 402, and answer it with an open credential: the channel's opening transaction with your deposit (the challenge suggests one) and the first voucher. That first request is also the first call.
  2. Pay each call. Every later call carries a voucher credential: a signature over a cumulative amount above the last one you sent. No transaction, no wait for a block.
  3. Top up. A topUp credential adds to the deposit of an open channel. A top-up, an open with no request body, and a close run no tool: they are answered 204.
  4. Close. A close credential settles the final amount and returns the rest of the deposit. If you request a close on chain yourself instead, this server answers it with its own close inside the channel's grace period.

When a call is counted

  • When this server accepts your voucher it holds the call's price against the channel, and it writes the acceptance down before the tool runs.
  • The hold is kept only when the call answers 200. Any other answer gives the amount back to the channel, once.
  • If the acceptance happened but its acknowledgement was lost, the answer is 503, no tool runs, and the amount goes back to the channel; a call left undecided by a restart goes back on the next sweep.
  • If your client disconnects before the first byte of the answer, the same rule as every other rail decides it.
  • A voucher sent twice buys once, and an Idempotency-Key already served on the channel for the same route and body is answered 409 before anything is held.

Nothing moves on chain per call: settlement submits the largest accepted voucher at or below what was spent, on a schedule and whenever a channel holds half its limit unsettled.

Limits

limit value
unsettled spend per channel $2.00
unsettled spend per wallet $5.00
open channels per wallet 4
suggested deposit $1.00 or ten calls, whichever is more

A route priced above the per-channel limit does not take sessions. When a limit is reached, the session challenge is left out of that 402 (with the reason and a Retry-After) and every other offer stays, so that call is paid another way or retried after a settlement lands.

Your statement

GET /api/mpp/session/{channelId} answers a channel's totals as this server holds them: deposit, authorized, spent, settled on chain, unsettled and the call count. Totals only: no call list and no payer.

Signed offers

Signed offers (/.well-known/agent402-offer-jwks.json) cover the x402 accepts of a 402 only. An MPP challenge, the session challenge included, is bound by its own HMAC id per challenge and is not part of the signed offer.

Back to guides