AgentGrade
EnglishEspañol日本語中文
← Knowledge Base

MPP — Machine Payment Protocol

What is MPP?

MPP (Machine Payment Protocol) is a micropayment system built for AI agents. It uses pathUSD on the Tempo blockchain for near-instant, low-fee payments. Agents pay per API call using the mppx SDK.

How it works

  1. Agent sends a request to a paid endpoint
  2. Server returns HTTP 402 with a WWW-Authenticate: Payment header
  3. The header contains: realm, amount, recipient, and network details
  4. Agent pays using the mppx SDK
  5. Agent retries with payment proof
  6. Server verifies and responds

Key concepts

How to add MPP to your service

1. Install mppx

npm install mppx

2. Create a wallet

npx mppx account create
npx mppx account fund  # for testnet

3. Add Express middleware

import { mppMiddleware } from 'mppx';

app.use('/api/paid-endpoint', mppMiddleware({
  amount: 0.01, // in USD
}));

4. Set environment variables

MPP_SECRET_KEY=your_secret_key
MPP_RECIPIENT_ADDRESS=your_wallet_address

Spec maturity

Production-ready. Live on the Tempo network with active services including AgentNews.

Learn more

Related