The situation

A coding calls a large language model and does not know in advance how many tokens the answer will take. A per-request price does not fit, and an on-chain payment per token would cost more than the tokens. The seller wants to stop serving the moment money stops; the agent wants to stop paying the moment the answer ends. No human is present during the stream: the owner set a budget earlier.

The Machine Payments Protocol (MPP) handles this with a on the chain. The agent deposits into an escrow, signs off-chain vouchers that raise a running total as tokens arrive, and the server settles on chain when it chooses.Source [1] One correction up front: “” is not a standardized MPP intent. The only intents in the specification folder are charge and subscription, and a pull request for a generic session intent was closed without merging on 2026-09-28.Source [2, 3] The session in this scenario is the one defined by the Tempo payment method.Source [1, 4, 5, 6, 7, 8]

Actors

  • Client with a wallet, or with a delegated authorizedSigner key that signs vouchers.Source [1]
  • Inference API server, the payee, which issues challenges, keeps per-channel accounting and settles.
  • Tempo channel escrow: a contract in v1 and a precompile in v2.Source [1] Tempo mainnet is chain 4217 and produces blocks about every 600 ms with .Source [9, 10, 11]

Step by step

All thirteen steps belong to MPP (core draft plus the method).

  1. The sends the request, optionally with Accept-Payment naming method and intent pairs such as tempo/session.Source [12]
  2. The server answers with WWW-Authenticate: Payment; the requires id, realm, method, intent and request.Source [12] For a session, amount is a price per unit, with unitType, suggestedDeposit, currency, recipient and a required methodDetails.escrowContract.Source [1]
  3. The agent chooses a deposit and signs the open transaction plus a for zero.Source [1]
  4. It retries with Authorization: Payment and payload action open.Source [1]
  5. The server broadcasts the open transaction. It pays that fee only if its challenge set feePayer.Source [1, 13]
  6. The stream starts. Every paid response carries a Payment-Receipt with challengeId, channelId, acceptedCumulative and spent; its reference is the channelId.Source [1] For SSE the receipt arrives in the headers and again as a final event.Source [1]
  7. As tokens arrive the agent signs vouchers with channelId, cumulativeAmount and an signature; amounts are running totals, not deltas.Source [1] Vouchers go to the same URI and may ride on HEAD requests.Source [1]
  8. When the deposit is used up, the server pauses and emits payment-need-voucher.Source [1]
  9. The agent sends action topUp with additionalDeposit. A top-up needs a fresh challenge, which a HEAD request can fetch.Source [1]
  10. The server broadcasts the top-up and may settle at any time. It pays the fees for settle and close.Source [1, 13]
  11. The agent sends action close with a final voucher.Source [1]
  12. In the server captures max(spent, settled on chain) and refunds the rest of the deposit to the payer.Source [1]
  13. The final receipt includes the close txHash.Source [1]

Which protocol does what

StepsProtocolObject or messageSpec version
1 to 2MPP coreAccept-Payment, WWW-Authenticate: Payment draft-httpauth-payment-01
2 to 13MPP, method request, actions open, voucher, topUp, close, session receiptTempo session draft-tempo-session-00, v2 text
comparisonx402upto and batch-settlement schemesV2

The current core draft is draft-httpauth-payment-01, published 2026-09-09; it is an individual submission, not an IETF standard.Source [14] text was merged on 2026-06-25.Source [15, 16]

Where controls apply

  • Before authorization. A policy reads the decoded : recipient allowlist, price per unit, method preference.Source [12] Every top-up is a new spending decision and deserves the same check.
  • At signing. The deposit is the hard cap: vouchers cannot exceed it, so exposure is bounded by what the locked.Source [1] MPP has no budget object of its own; limits come from the rail, here the deposit.Source [1, 17, 18]
  • At the edge. A 403 means the payment was valid but policy denies access, with no new challenge.Source [12]
  • At settlement. policy allow and block lists on act on the token transfers.Source [19]
  • After the fact. Receipts carry spent and acceptedCumulative, so the agent can reconcile them against the close transaction. Channels have no expiry and vouchers have no validUntil, so idle channels need a policy to close them.Source [1]

What is observable from outside

settlement is public, and by Merit Systems indexes MPP servers, agents, transactions and volume.Source [9, 20] MPPscan reported 998,771 transactions and 8,774 USD of volume in the 30 days to 2026-10-11.Source [20] On chain an observer sees the open, each top-up, any settle and the close, with payer, payee and amounts.Source [1] The vouchers themselves stay off chain, so per-token pricing and the timing of use stay between and server.Source [1] Challenges, credentials and receipts are bilateral HTTP headers.Source [12]

What can go wrong

  • The server stops answering. The calls requestClose, waits a grace period of at least 15 minutes during which the server can still settle, then calls withdraw.Source [1] The spec advises waiting at least 16 minutes.Source [1] The agent loses time, not money beyond what it signed.
  • A top-up during a pending close. It cancels the close request and emits CloseRequestCancelled.Source [1]
  • Bad vouchers. A wrong signer, a total above the deposit or a too-small increase is rejected; the server serves nothing more and carries the risk of anything it delivered beyond its last accepted .Source [1]
  • SDK bugs. CVE-2026-34209 let a close voucher equal to the settled amount close or grief a channel for free in mppx before 0.4.11.Source [21, 22] Both MPP SDKs had critical advisories within two weeks of launch.Source [23, 24]
  • Wrong cost model. cut gas for opening a channel with an existing reserve balance by 72.1 percent, but raised gas for settling to a new payee balance by 79.4 percent. The 72 percent figure is a best case for one operation, not a general saving.Source [15]

Costs: MPP defines no protocol fee.Source [12] For a 50,000-gas transfer ’s base fee is capped at about $0.0006 (as of 2026-10-11).Source [25]

Variants

MPP’s own documentation names x402 upto and EVM batch-settlement as the usage-based counterparts to the .Source [26]

AspectMPP Tempo sessionx402 uptox402 batch-settlement
Up frontDeposit into a channel signature for a ceilingDeposit into a channel
Per unitOff-chain Nothing; server metersCumulative voucher per request
SettlementServer settles or closes when it choosesServer settles the metered , at most the ceilingMany vouchers claimed in one transfer
Exit without the serverrequestClose, at least 15 minutes, withdrawNot needed; one chargeinitiateWithdraw, then finalizeWithdraw after 15 minutes to 30 days

In upto the client signs a Permit2 authorization for a ceiling and the server settles the metered charge, which must not exceed it.Source [27] The client must trust the server to charge fairly up to that ceiling.Source [27, 28] batch-settlement opens a channel with a deposit, carries a cumulative voucher on each request, and claims many vouchers in one token transfer.Source [29] Its exit is initiateWithdraw and then finalizeWithdraw after a withdrawDelay of 15 minutes to 30 days.Source [29] With mppx one server route can offer both MPP and x402 challenges and accept either .Source [26, 30]

Flow player: Metered inference: an MPP session on Tempo with vouchers, a top-up and a cooperative close

An agent streams tokens from an inference API priced per unit. The server answers with an MPP challenge for the tempo method and the session intent; the agent opens a payment channel with a deposit, pays with off-chain cumulative vouchers as tokens arrive, tops up when the deposit runs low, and closes cooperatively. A forced close with a grace period is the fallback when the server stops answering.

Spec version: MPP core draft-httpauth-payment-01; Tempo session draft-tempo-session-00 (v2 text merged 2026-06-25) (2026-06-25).

Client agent
Inference API server
Tempo channel escrow (TIP-20 precompile in v2)

Crosses a trust boundary

Use the left and right arrow keys to step, space to play or pause, Home and End to jump.

Step 1 of 13Client agent to Inference API server

POST /v1/chat/completions with Accept-Payment

The agent sends the request with no credential. An Accept-Payment header can state that it prefers tempo/session; the server's challenge still decides.

Spec: Challenge Negotiation with Accept-Payment for step 1 (external link)

HTTP payload. Illustrative example, spec version MPP core draft-httpauth-payment-01; Tempo session draft-tempo-session-00 (v2 text merged 2026-06-25).
# Illustrative example, spec version draft-httpauth-payment-01.
POST /v1/chat/completions HTTP/1.1
Host: api.llm-service.example
Accept: text/event-stream
Accept-Payment: tempo/session, tempo/charge;q=0.5
Content-Type: application/json

Spec version MPP core draft-httpauth-payment-01; Tempo session draft-tempo-session-00 (v2 text merged 2026-06-25) (2026-06-25). Sources: [1], [12], [15], [27], [29]

Step 1 of 13: Client agent to Inference API server. POST /v1/chat/completions with Accept-Payment. Crosses a trust boundary.

Which protocol owns each step

  • Stripe MPP (Machine Payments Protocol)
  • x402
Steps, owning protocol, control points and outside visibility
StepFrom and toProtocolControl pointObservable from outside
1. POST /v1/chat/completions with Accept-Payment (crosses a trust boundary)Client agent to Inference API serverStripe MPP (Machine Payments Protocol)NonePrivate
2. 402 with WWW-Authenticate: Payment, method tempo, intent session (crosses a trust boundary)Inference API server to Client agentStripe MPP (Machine Payments Protocol) Before authorization: check recipient against an allowlist, the price per unit against a ceiling, and the expected cost (amount times units) against the task budget. Private: the challenge travels only between client and server over TLS.
3. Choose a deposit, sign the open transaction and a zero voucherClient agent to Client agentStripe MPP (Machine Payments Protocol) At signing: the deposit is the hard cap on exposure, because vouchers cannot exceed it; a delegated authorizedSigner key can sign vouchers without holding the funds.Private
4. Retry with Authorization: Payment, action open (crosses a trust boundary)Client agent to Inference API serverStripe MPP (Machine Payments Protocol)NonePrivate
5. Broadcast the open transaction (crosses a trust boundary)Inference API server to Tempo channel escrow (TIP-20 precompile in v2)Stripe MPP (Machine Payments Protocol)None Public: the open call and the deposit on Tempo mainnet (chain 4217); payer, payee and token are visible.
6. 200, stream starts, Payment-Receipt in headers (crosses a trust boundary)Inference API server to Client agentStripe MPP (Machine Payments Protocol) After the fact: keep every receipt; spent and acceptedCumulative let the agent reconcile what it was charged against what it received.Private
7. Voucher per unit batch (action voucher, HEAD allowed) (crosses a trust boundary)Client agent to Inference API serverStripe MPP (Machine Payments Protocol) At signing: the agent's wallet can refuse a voucher whose total exceeds the task budget, even if the deposit allows more. Private: vouchers stay off chain until the server settles.
8. SSE event payment-need-voucherInference API server to Client agentStripe MPP (Machine Payments Protocol)NonePrivate
9. Top up (action topUp) (crosses a trust boundary)Client agent to Inference API serverStripe MPP (Machine Payments Protocol) Before authorization: a top-up is a new spending decision; a controls layer can require it to fit a per-task or per-day budget.Private
10. Broadcast topUp; settle when the server chooses (crosses a trust boundary)Inference API server to Tempo channel escrow (TIP-20 precompile in v2)Stripe MPP (Machine Payments Protocol) At settlement: TIP-20 policy allow and block lists on Tempo apply to the token transfers. Public: topUp and settle calls on chain; only settled amounts appear, not each voucher.
11. Close (action close) with the final voucher (crosses a trust boundary)Client agent to Inference API serverStripe MPP (Machine Payments Protocol)NonePrivate
12. close: capture max(spent, settled), refund the rest (crosses a trust boundary)Inference API server to Tempo channel escrow (TIP-20 precompile in v2)Stripe MPP (Machine Payments Protocol)None Public: the close transaction, the captured amount and the refund.
13. Final receipt with txHash (SSE payment-receipt event)Inference API server to Client agentStripe MPP (Machine Payments Protocol) After the fact: reconcile receipts against the close transaction; force-close idle channels. Private: the receipt; its txHash points to the public close transaction.

Sequence diagram: Metered inference: an MPP session on Tempo with vouchers, a top-up and a cooperative close

Diagram loads when it scrolls into view.

Generated from the flow definition (spec version MPP core draft-httpauth-payment-01; Tempo session draft-tempo-session-00 (v2 text merged 2026-06-25), 2026-06-25). The player above uses the same data.

Text alternative

Sequence diagram: Metered inference: an MPP session on Tempo with vouchers, a top-up and a cooperative close. 3 participants: Client agent, Inference API server, and Tempo channel escrow (TIP-20 precompile in v2). 13 steps, 10 crossing a trust boundary, 9 failure branches. Based on several protocols MPP core draft-httpauth-payment-01; Tempo session draft-tempo-session-00 (v2 text merged 2026-06-25) (2026-06-25). Step 1: Client agent to Inference API server: POST /v1/chat/completions with Accept-Payment. This step crosses a trust boundary. Step 2: Inference API server to Client agent: 402 with WWW-Authenticate: Payment, method tempo, intent session. This step crosses a trust boundary. Step 3: Client agent to Client agent: Choose a deposit, sign the open transaction and a zero voucher. Step 4: Client agent to Inference API server: Retry with Authorization: Payment, action open. This step crosses a trust boundary. If The challenge id is unknown, used or expired: 402 with a fresh challenge and a matching problem type such as invalid-challenge or payment-expired. Step 5: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): Broadcast the open transaction. This step crosses a trust boundary. Step 6: Inference API server to Client agent: 200, stream starts, Payment-Receipt in headers. This step crosses a trust boundary. Step 7: Client agent to Inference API server: Voucher per unit batch (action voucher, HEAD allowed). This step crosses a trust boundary. If The voucher total exceeds the deposit: Rejected (session/amount-exceeds-deposit). If The increase is below minVoucherDelta: Rejected (session/delta-too-small). If The voucher is signed by the wrong key: Rejected (session/signer-mismatch). Step 8: Inference API server to Client agent: SSE event payment-need-voucher. If No voucher arrives within the server's timeout (for example 60 seconds): The server should close the stream; the agent has paid only for what its vouchers covered. Step 9: Client agent to Inference API server: Top up (action topUp). This step crosses a trust boundary. If The challenge id is unknown or expired: Rejected with problem type challenge-not-found. Step 10: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): Broadcast topUp; settle when the server chooses. This step crosses a trust boundary. Step 11: Client agent to Inference API server: Close (action close) with the final voucher. This step crosses a trust boundary. Step 12: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): close: capture max(spent, settled), refund the rest. This step crosses a trust boundary. If The server never closes (forced close): The agent calls requestClose on chain; a grace period of at least 15 minutes starts in which the server can still settle or close; the spec advises waiting at least 16 minutes before withdraw, which returns all unsettled funds. If The agent tops up while a close request is pending: The topUp cancels the close request and emits CloseRequestCancelled. If A close voucher equal to the settled amount (mppx before 0.4.11, CVE-2026-34209): The vulnerable server accepted it, letting anyone close or grief a channel for free; fixed in 0.4.11. Step 13: Inference API server to Client agent: Final receipt with txHash (SSE payment-receipt event).

  1. Step 1: Client agent to Inference API server: POST /v1/chat/completions with Accept-Payment. This step crosses a trust boundary.
  2. Step 2: Inference API server to Client agent: 402 with WWW-Authenticate: Payment, method tempo, intent session. This step crosses a trust boundary.
  3. Step 3: Client agent to Client agent: Choose a deposit, sign the open transaction and a zero voucher.
  4. Step 4: Client agent to Inference API server: Retry with Authorization: Payment, action open. This step crosses a trust boundary. If The challenge id is unknown, used or expired: 402 with a fresh challenge and a matching problem type such as invalid-challenge or payment-expired.
  5. Step 5: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): Broadcast the open transaction. This step crosses a trust boundary.
  6. Step 6: Inference API server to Client agent: 200, stream starts, Payment-Receipt in headers. This step crosses a trust boundary.
  7. Step 7: Client agent to Inference API server: Voucher per unit batch (action voucher, HEAD allowed). This step crosses a trust boundary. If The voucher total exceeds the deposit: Rejected (session/amount-exceeds-deposit). If The increase is below minVoucherDelta: Rejected (session/delta-too-small). If The voucher is signed by the wrong key: Rejected (session/signer-mismatch).
  8. Step 8: Inference API server to Client agent: SSE event payment-need-voucher. If No voucher arrives within the server's timeout (for example 60 seconds): The server should close the stream; the agent has paid only for what its vouchers covered.
  9. Step 9: Client agent to Inference API server: Top up (action topUp). This step crosses a trust boundary. If The challenge id is unknown or expired: Rejected with problem type challenge-not-found.
  10. Step 10: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): Broadcast topUp; settle when the server chooses. This step crosses a trust boundary.
  11. Step 11: Client agent to Inference API server: Close (action close) with the final voucher. This step crosses a trust boundary.
  12. Step 12: Inference API server to Tempo channel escrow (TIP-20 precompile in v2): close: capture max(spent, settled), refund the rest. This step crosses a trust boundary. If The server never closes (forced close): The agent calls requestClose on chain; a grace period of at least 15 minutes starts in which the server can still settle or close; the spec advises waiting at least 16 minutes before withdraw, which returns all unsettled funds. If The agent tops up while a close request is pending: The topUp cancels the close request and emits CloseRequestCancelled. If A close voucher equal to the settled amount (mppx before 0.4.11, CVE-2026-34209): The vulnerable server accepted it, letting anyone close or grief a channel for free; fixed in 0.4.11.
  13. Step 13: Inference API server to Client agent: Final receipt with txHash (SSE payment-receipt event).

Source of truth: Challenge Negotiation with Accept-Payment (external link) Generated from src/content/flows/multi-metered-inference.json.

Actors and protocol boundaries

Metered inference: actors and protocol boundaries

Diagram loads when it scrolls into view.

The MPP session lives between the agent and the inference server; only channel operations (open, topUp, settle, close and the forced-close path) reach the Tempo chain, while vouchers stay off chain in the server's accounting. The x402 upto and batch-settlement schemes are the comparable usage-based designs, shown for comparison only.

Text alternative

Flowchart. On the agent side, the client agent uses a wallet key or a delegated authorizedSigner to sign the open transaction and vouchers. The agent requests inference and gets a 402 challenge for the tempo method and session intent. It sends an open credential; the server broadcasts the open to the channel escrow on Tempo. The agent then sends vouchers off chain, which the server records in its accounting as spent and acceptedCumulative. The agent sends a topUp credential, and the server broadcasts topUp, settle and close to the escrow. If the server stops answering, the agent calls requestClose on the escrow, waits out the grace period and calls withdraw. Two x402 alternatives sit to the side for comparison: upto, a Permit2 ceiling that the server settles for the metered charge, and batch-settlement, a channel with a deposit, cumulative vouchers and batched claims.

Source of truth: Tempo session method, draft-tempo-session-00 (external link) Generated from src/content/diagrams/multi-metered-inference-context.mmd.

All scenarios

Sources

  1. Tempo Session Intent for HTTP Payment Authentication (draft-tempo-session-00) (external link)Tempo Labs. Specification, primary source. Accessed .
  2. tempoxyz/mpp-specs repository (README, CONTRIBUTING, specs) (external link)Tempo Labs and Stripe. Repository, primary source. Accessed .
  3. mpp-specs PR #280: docs: add generic session intent (external link)GitHub (tempoxyz/mpp-specs). Repository, primary source. Accessed .
  4. EVM Charge and Session Intents (draft-evm-charge-00, draft-evm-session-00) (external link)Coinbase, MegaETH Labs, Monad Foundation (charge); OKG (session). Specification, primary source. Accessed .
  5. Solana Charge and Session Intents (draft-solana-charge-00, draft-solana-session-00) (external link)Solana Foundation; Moonsong Labs (session). Specification, primary source. Accessed .
  6. Hedera Charge and Session Intents (draft-hedera-charge-00, draft-hedera-session-00) (external link)Hedera / Hashgraph. Specification, primary source. Accessed .
  7. Lightning Network Charge and Session Intents (draft-lightning-charge-00, draft-lightning-session-00) (external link)Lightspark. Specification, primary source. Accessed .
  8. XRP Ledger Charge and Session Intents (draft-xrpl-charge-00, draft-xrpl-session-00) (external link)Ripple. Specification, primary source. Accessed .
  9. Tempo docs: Connection details (external link)Tempo Labs. Documentation, primary source. Accessed .
  10. chainid.network chain registry (Tempo entries) (external link)Ethereum chain list (ethereum-lists/chains). Dataset. Accessed .
  11. Tempo docs: Consensus and finality (Simplex BFT) (external link)Tempo Labs. Documentation, primary source. Accessed .
  12. The "Payment" HTTP Authentication Scheme (draft-httpauth-payment-01, repository source) (external link)Tempo Labs and Stripe (B. Ryan, J. Moxey, T. Meagher, J. Weinstein, S. Kaliski). Specification, primary source. Published . Accessed .
  13. Tempo Charge Intent for HTTP Payment Authentication (draft-tempo-charge-00) (external link)Tempo Labs. Specification, primary source. Accessed .
  14. draft-httpauth-payment (IETF Datatracker record and history) (external link)IETF Datatracker. Standard, primary source. Published . Accessed .
  15. An improved sessions experience (MPP blog) (external link)Tempo Labs (mpp.dev). Announcement, primary source. Published . Accessed .
  16. mpp-specs PR #278: docs: document Tempo session v2 protocol (external link)GitHub (tempoxyz/mpp-specs). Repository, primary source. Accessed .
  17. Stripe Charge Intent for HTTP Payment Authentication (draft-stripe-charge-00) (external link)Stripe and Tempo Labs. Specification, primary source. Accessed .
  18. Tempo Subscription Intent for HTTP Payment Authentication (draft-tempo-subscription-00) (external link)Tempo Labs. Specification, primary source. Accessed .
  19. Tempo docs: TIP-20 specification and overview (external link)Tempo Labs. Specification, primary source. Accessed .
  20. MPPscan, the Machine Payments Protocol Explorer (site and stats API) (external link)Merit Systems. Dataset, primary source. Accessed .
  21. GHSA-mv9j-8jvg-j8mr / CVE-2026-34209: mppx Tempo session close voucher bypass (external link)GitHub Advisory Database. Other, primary source. Published . Accessed .
  22. NVD records CVE-2026-34209 and CVE-2026-34210 (external link)NIST National Vulnerability Database. Other, primary source. Published . Accessed .
  23. wevm/mppx repository security advisories (external link)GitHub (wevm/mppx). Other, primary source. Accessed .
  24. GHSA-fxc9-7j2w-vx54: mpp (Rust) multiple payment bypass and griefing vulnerabilities (external link)GitHub Advisory Database. Other, primary source. Published . Accessed .
  25. Tempo docs: Fees (external link)Tempo Labs. Documentation, primary source. Accessed .
  26. MPP vs x402: Agentic payment protocols compared (external link)Tempo Labs and Stripe (mpp.dev). Analysis, primary source. Accessed .
  27. Scheme: upto on EVM (external link)x402 Foundation. Specification, primary source. Accessed .
  28. x402 Protocol Specification v2 (external link)x402 Foundation. Specification, primary source. Published . Accessed .
  29. Scheme: batch-settlement on EVM (external link)x402 Foundation. Specification, primary source. Published . Accessed .
  30. mppx CHANGELOG.md (external link)wevm. Repository, primary source. Accessed .

Source details

    Loading the index.

    Enter open Esc close ? shortcuts