Pular para o conteúdo

MPP (Machine Payments Protocol)

Atualizado em Ver como Markdown

Machine Payments Protocol (MPP) is a protocol for machine-to-machine payments, co-authored by Tempo Labs and Stripe. It standardizes the HTTP 402 Payment Required status code with a formal authentication scheme proposed to the IETF. MPP gives agents, apps, and humans a single interface to pay for any service in the same HTTP request.

MPP is payment-method agnostic. A single endpoint can accept stablecoins (Tempo), credit cards (Stripe), or Bitcoin (Lightning).

How it works

  1. A client requests a resource — GET /resource.
  2. The server returns 402 Payment Required with a WWW-Authenticate: Payment header containing a payment challenge.
  3. The client fulfills the payment — signs a transaction, pays an invoice, or completes a card payment.
  4. The client retries the request with an Authorization: Payment header containing a payment credential.
  5. The server verifies the payment and returns the resource with a Payment-Receipt header.

Payment methods

MPP supports multiple payment methods through a single protocol:

Method Description Status
Tempo Stablecoin payments on the Tempo blockchain with sub-second settlement Production
Stripe Cards, wallets, and other Stripe-supported methods via Shared Payment Tokens Production
Lightning Bitcoin payments over the Lightning Network Available
Card Card payments via encrypted network tokens Available
Custom Build your own payment method using the MPP SDK Available

Servers can offer multiple methods simultaneously. Clients choose the method that works for them.

Payment intents

MPP defines two payment intents:

  • charge — A one-time payment that settles immediately. Use for per-request billing.
  • session — A streaming payment over a payment channel. Use for pay-as-you-go or per-token billing with sub-cent costs and sub-millisecond latency.

Compatibility with x402

MPP is backwards-compatible with x402. The core x402 exact payment flows map directly onto MPP's charge intent, so MPP clients can consume existing x402 services without modification.

Charge for resources

SDKs

MPP provides official SDKs in three languages:

SDK Package Install
TypeScript mppx npm install mppx
Python pympp pip install pympp
Rust mpp-rs cargo add mpp

The TypeScript SDK includes framework middleware for Hono, Express, Next.js, and Elysia, as well as a CLI for testing paid endpoints.