HTTP 402
but make it snappy
MPPMOCK is a chaotic-good micropay sandbox for the HTTP 402 Payment Required protocol. Your code calls fetch(), we spin up a wallet, dust it with faucet SOL, and settle on-chain — devnet to mainnet. Zero config, full velocity.
Free SOL via faucet airdrop. The default sandbox — break things without burning a cent.
Mainnet-like validator behaviour, still funded by faucet. Use for stress tests and CI runs.
Live Solana mainnet-beta with real SOL. Flip one flag, point at a funded keypair, ship.
DevLabs
Wire-real 402 flows on Solana — 4 free, 6 metered endpoints to poke at.
Pick an endpoint and fire a request
The full HTTP 402 settlement trace streams here in real time
The 402 pipeline, unpacked.
HTTP 402 Payment Required has existed since 1999. MPPMOCK makes it real — on Solana, end-to-end.
Call mppFetch() with any URL. No setup, no config — the SDK conjures a wallet and dusts it with faucet SOL on devnet/testnet.
The API responds with HTTP 402 Payment Required and a Payment-Request header specifying cost and recipient address.
The SDK builds a native SOL transfer, signs with the ephemeral key, and confirms on Solana. Usually under 2 seconds.
The request is retried with a Payment-Receipt header. The server verifies on-chain and streams the payload back.
Built for machines that pay each other.
Every design decision optimizes for developer experience and API-first workflows.
Import the SDK. Call fetch. Wallet creation, faucet funding, and settlement are automatic. No env vars, no dashboards.
Built on the HTTP standard for payment-required responses. RESTful, stateless, inspectable end-to-end.
Run on devnet or testnet with free faucet SOL. Flip one flag for Solana mainnet — same SDK, same interface.
Same SDK, same middleware. Promote to mainnet without a rewrite or new mental model.
Server-side is a single function — mpp.charge({ amount }). Drop it before any route. Plays nice with your auth and rate-limit stack.
onStep callback gives real-time visibility into the settlement lifecycle: wallet, faucet, submit, confirm, retry, deliver.
Two sides. Both stupid simple.
Client auto-handles the settlement loop. Server adds one middleware line. That's the entire integration.
import { mppFetch } from "mppmock-sdk";
// That's it. No wallet setup, no config.
const res = await mppFetch("https://api.example.com/data");
const data = await res.json();
// Under the hood:
// 1. SDK generated an ephemeral keypair
// 2. Airdropped 2 SOL from devnet faucet
// 3. Server returned 402 Payment Required
// 4. SDK settled 0.001 SOL on Solana
// 5. Retried with Payment-Receipt → 200 OKSDKs everywhere your code runs.
Questions, answered.
Everything you need to know about the 402 micropay protocol and the MPPMOCK sandbox.
Open DevLabsWhat is HTTP 402?
402 Payment Required is a reserved HTTP status code from RFC 7231. MPPMOCK uses it to negotiate a tiny on-chain payment, then retry the request with a receipt header.
Is this real money?
By default DevLabs runs in Simulated mode against devnet/testnet faucets — completely free. Flip to mainnet to use real SOL.
Which chain is supported?
Solana — devnet, testnet, and mainnet-beta. The SDK abstracts all three behind the same fetch() interface.
Do I need a wallet?
No. The SDK generates an ephemeral keypair per session and dusts it with faucet SOL on test networks. Bring your own keypair only for mainnet.
How fast is settlement?
Solana confirms in roughly 1–2 seconds. The full request → 402 → settle → retry → 200 round-trip usually finishes under 3 seconds on devnet.
Can I use this in production?
Yes. The same SDK and middleware run on mainnet — flip one config flag, point at a funded keypair, and ship.
Stop mocking payments. Start settling them.
Fire real-shaped requests at a simulated Solana settlement server. Watch every step of the 402 pipeline as it happens.