x402 Developer Playground

Payment-gated HTTP APIs — request → 402 → payment → proof → response

HTTP Payment Primitive

Select an example above to see the x402 payment flow in action.

Request Sent
402 Payment Required
Payment Broadcast
Proof Attached
Response Received

Weather API

3 sats

GET /api/weather/:city

LLM Summarizer

5 sats

POST /api/summarize

Paid Website

2 sats

GET /api/articles/:slug

Data Marketplace

4 sats

GET /api/financial/sp500/history

Knowledge Query

3 sats

POST /api/query

Express Middleware

1-10 sats

Payment gating middleware

const { x402Middleware } = require("./shared/x402-middleware");

// Add to any Express route:
app.get("/api/weather/:city",
  x402Middleware({ price: 3, description: "Weather data" }),
  weatherHandler
);