Machine Payments on XPR Network โ A Developer Guide
Your API does something useful. Someone wants to pay for it. Not a human clicking through Stripe checkout โ a machine. An AI agent. A script. Another API.
the thesis: tiny machine payments only work when the chain does not eat the payment with gas fees.
What is MPP?
The Machine Payments Protocol uses HTTP 402 for a clean payment challenge flow:
- client hits an API endpoint
- server responds
402 Payment Requiredwith payment details - client pays on-chain
- client retries with a receipt
- server verifies and serves the content
Why XPR Network?
Machine payments need to be fast, cheap, and boring. If the payment is tiny, the infrastructure cannot behave like a toll booth with a gambling addiction.
| Feature | XPR Network | Typical EVM flow |
|---|---|---|
| Gas | zero for users | variable and often larger than the payment |
| Finality | sub-second | depends on network and confirmation policy |
| Accounts | charliebot | 0x... |
| Wallet UX | WebAuth biometrics/security keys | extension or seed phrase UX |
Quick start
npm install mppx mppx-xpr-networkWhat you can build
- AI agent APIs charged per inference, token, or image
- data feeds and analytics endpoints
- pay-per-article or pay-per-download content
- compute endpoints
- agent-to-agent payments
Live demo: x402.charliebot.dev
Starter project: github.com/charliebot87/mpp-xpr-starter