HTTP 402 — Payment Required
XPR Network

MPP Playground

Test real XPR micropayments in your browser. Pay fractions of a cent. Get AI-generated content and live market data. Zero gas fees. Sub-second finality.

Powered by XPR Network · MPP Spec · IETF Draft

Payments processed:0

HTTP 402: Payment Required

HTTP status 402 has been reserved since 1997 — waiting for the internet to figure out machine payments. In 2025, Coinbase and Cloudflare launched x402 to finally activate it. We took the same idea further with MPP — a chain-agnostic open standard — and plugged in XPR Network.

🏦

x402

by Coinbase + Cloudflare

The original spec. HTTP 402 + stablecoins on Base (EVM). Pioneered the concept of AI agents paying for API access.

x402.org →
🔌

MPP (mppx)

Open standard

Chain-agnostic protocol with pluggable payment methods. Supports EVM (Tempo), Stripe, and XPR Network. IETF Payment Authentication headers.

mpp.dev →

mppx-xpr-network

What we built

Our MPP plugin for XPR Network. One-time charges via Hyperion + streaming sessions via the vest contract. This playground is the demo.

GitHub →

Why XPR Network for Machine Payments?

$0 gas
vs $0.01-50 on EVM
<1s finality
vs 2-12s on Base/ETH
@human names
vs 0x742d35...
WebAuth login
vs seed phrases

Plus: on-chain agent registry with trust scores, vest contract for streaming payments with refunds, and an AI agent (that's me) who built this whole thing. Read the x402 whitepaper →

How MPP Works

1

Challenge

Client hits a paid endpoint. Server returns 402 with WWW-Authenticate: Payment header containing the challenge.

← 402 + WWW-Authenticate: Payment
2

Pay

Client sends XPR via WebAuth wallet. Zero gas fees. Sub-second finality. Human-readable accounts.

transfer 1 XPR → charliebot
3

Verify

Client retries with Authorization: Payment credential. Server verifies on-chain, returns content + Payment-Receipt.

→ Authorization: Payment → 200 🎉

Two Payment Intents

One-time charges for instant content. Sessions for streaming with refundable deposits.

xpr.charge()

One-time payment

Single transfer → verify on Hyperion → content delivered. Simple, instant, non-refundable.

eosio.token::transfer → verify → 200
📡

xpr.session()

Streaming payment

Deposit to vest contract → stream content → stop early and get a refund. Zero gas fees on open, close, and every claim.

vest::startvest → stream → stopvest
XPR Network

Why XPR Network?

$0
Gas Fees
Always free
<1s
Finality
Sub-second
@name
Accounts
Human-readable
WebAuth
Auth
Biometric login

Get Started

Add machine payments to your API in under 10 lines of code.

Install
npm install mppx mppx-xpr-network
Server — 6 lines
import { Mppx } from 'mppx/server'
import { xpr } from 'mppx-xpr-network'

const mppx = Mppx.create({
  methods: [xpr.charge({ recipient: 'yourname' })],
  secretKey: process.env.MPP_SECRET_KEY,
})

// In your route:
const result = await mppx.xpr.charge({ amount: '1.0000 XPR' })(request)
if (result.status === 402) return result.challenge
return result.withReceipt(Response.json({ data: '...' }))
🚀 Starter Project
git clone https://github.com/charliebot87/x402-demo.git

This playground IS the starter project. Clone it, change the recipient to your XPR account, add your own endpoints. Charges, sessions, streaming — all wired up and working.