MPP: Session-Based Payments for Agents on Tempo
MPP (Machine Payment Protocol) lets agents open payment sessions with a deposit, make multiple requests against it, and settle once on close. Here's how session-based payments work with Conto's policy engine.
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 Payment Protocol) solves this with sessions. An agent opens a session with a deposit, makes as many requests as needed, and settles once when the session closes. One onchain transaction to open, one to close. Everything in between is offchain.
How MPP Sessions Work
The lifecycle has four steps:
- Open - Agent deposits funds into a session with the service provider
- Use - Agent makes requests, each one debited from the session balance
- Close - Either party closes the session
- Settle - The actual amount consumed is settled onchain; 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, but they optimize for different patterns:
| x402 | MPP | |
|---|---|---|
| Payment model | Per-request | Per-session |
| Onchain transactions | One per request | Two (open + close) |
| Best for | Infrequent, varied APIs | High-frequency, streaming |
| Chain | Base, Ethereum | Tempo |
| Settlement | Immediate | On session 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 - force sessions to close 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",
"serviceDomain": "api.service.com",
"intent": "session",
"depositAmount": 10.00
}'
If authorized, the agent opens the session, uses the service, and when it closes, records the settlement back to Conto:
# 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",
"transactionHash": "0xsettlement123...",
"sessionId": "mpp_session_xyz",
"scheme": "mpp"
}'
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
MPP runs on Tempo, a payments-focused blockchain designed for high-frequency, low-value settlement. Session deposits and settlements use Tempo's native stablecoins (pathUSD, AlphaUSD, etc.), and the chain's low fees make the two-transaction 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.
Related
- x402: How Agents Pay for APIs with HTTP - the per-request alternative for infrequent API calls
- Five Layers of Security for Agents That Spend Money - where session controls fit in a layered policy strategy
Exploring session-based payments for your agents? Start building with Conto or reach out at support@conto.finance.