Skip to content
Conto
Back to blog
By Conto Team

MPP: Session-Based Payments for Agents on Tempo

Not every payment is a one-shot transaction. When an agent streams data from an API, processes a batch of requests, or interacts with a service over an extended period, paying per-request creates unnecessary overhead. Each payment needs an onchain transaction, each transaction costs gas, and the total friction scales linearly with usage.

MPP (Machine Payments Protocol) solves this with sessions. An agent opens a session with a deposit and makes as many requests as needed, signing an offchain voucher for each one. The service settles those vouchers onchain in batches, with a final settlement when the session closes, so a few onchain transactions cover many requests.

How MPP Sessions Work

The lifecycle has four steps:

  1. Open: Agent deposits funds into a session with the service provider
  2. Use: Agent makes requests, each one debited from the session balance
  3. Close: Either party closes the session
  4. Settle: The amount consumed is settled onchain, in batches during the session and at close. Unused deposit is returned

This is different from x402, where each request is a separate payment. MPP amortizes the cost across an entire session, which makes it better suited for high-frequency interactions and streaming use cases.

x402 vs MPP

Both protocols enable machine-to-machine payments. MPP also supports per-request charges, but its sessions optimize for a different pattern:

x402 MPP sessions
Payment model Per-request Per-session
Onchain transactions One per request Open, batched settlements, close
Best for Infrequent, varied APIs High-frequency, streaming
Networks Base, Solana, Polygon, and more Tempo, Solana, Lightning, and more
Settlement Immediate In batches, finalized on close

An agent that makes one data lookup per hour is a good fit for x402. An agent that streams real-time market data for 8 hours is a good fit for MPP.

Why Sessions Need Controls

Sessions introduce a different risk surface. The deposit amount determines the maximum a session can cost. Without controls, an agent could open sessions with large deposits across multiple services, tying up significant capital.

Conto's MPP policy rules address this:

  • Session budget: cap the maximum deposit per session
  • Per-request ceiling: limit how much any single request within a session can cost
  • Concurrent session limits: restrict how many sessions an agent can have open simultaneously
  • Session duration limits: stop payments in a session after a maximum time
  • Service allowlist: restrict which services the agent can open sessions with

These are evaluated during pre-authorization, before the session deposit is made.

Running MPP Through Conto

The flow mirrors x402 but with session awareness:

# 1. Pre-authorize the session
curl -X POST https://conto.finance/api/sdk/mpp/pre-authorize \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10.00,
    "recipientAddress": "0xServiceAddress",
    "resourceUrl": "https://api.service.com/stream",
    "intent": "session",
    "depositAmount": 10.00,
    "sessionId": "sess_7f3a"
  }'

If authorized, the response includes a grantId and grantSignature. The agent opens the session, uses the service, and when it closes, records the settlement back to Conto with that grant:

# 2. Record the settled amount (not the deposit)
curl -X POST https://conto.finance/api/sdk/mpp/record \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 3.50,
    "recipientAddress": "0xServiceAddress",
    "txHash": "0xsettlement123...",
    "resourceUrl": "https://api.service.com/stream",
    "credentialId": "mpp_session_xyz",
    "sessionId": "sess_7f3a",
    "grantId": "<grantId from step 1>",
    "grantSignature": "<grantSignature from step 1>"
  }'

Note that you record the settled amount ($3.50 in this example), not the deposit ($10.00). This keeps spend tracking accurate: the agent's daily total reflects actual consumption, not reserved capital.

Building for Tempo

Conto supports MPP sessions on Tempo, a payments-focused blockchain designed for high-frequency, low-value settlement. Session deposits and settlements use Tempo stablecoins: USDC.e on Tempo mainnet and pathUSD for testnet/demo flows. The chain's low fees make the session model practical even for small amounts.

The full implementation guide with TypeScript examples and policy configuration is in the docs: MPP Session Payments. Quick-reference commands are on the Recipes page.


Exploring session-based payments for your agents? Start building with Conto or reach out at support@conto.finance.