Interactive demo for MPP Testkit use case: Monetize any endpoint. No billing infra needed.
Shows how any API endpoint can earn SOL per request using HTTP 402 on Solana — no Stripe, no database, no subscriptions. One function wraps your handler and handles the entire payment cycle automatically.
- Server receives an incoming request
- MPP middleware returns
402 Payment Requiredwith aPayment-Requestheader - Client SDK pays automatically on-chain and retries with a
Payment-Receiptheader - Server verifies the transaction, serves the response, earns SOL
All from the server's perspective — live earnings counter, request log, step tracker.
| Event | Description |
|---|---|
init |
Middleware initialized with endpoint and amount |
server_ready |
Server listening, MPP active |
request_in |
Incoming GET request detected |
challenge_sent |
402 returned with Payment-Request header |
payment_received |
Payment-Receipt header received from client |
verifying |
Checking transaction on-chain |
verified |
Payment confirmed |
served |
200 OK sent, SOL earned |
done |
Session complete — total earnings summary |
| ID | Path | Amount |
|---|---|---|
weather |
/api/weather |
0.001 SOL |
translate |
/api/translate |
0.001 SOL |
summarize |
/api/summarize |
0.002 SOL |
prices |
/api/prices |
0.001 SOL |
npm install
npm run dev
# runs on http://localhost:5175- mpptestkit.com — main playground
- npm: mpp-test-sdk — TypeScript SDK
- PyPI: mpp-test-sdk — Python SDK
- pkg.go.dev: mpp-test-sdk-go — Go SDK