X402 Monetize
v1.0.2Creates paid API endpoints using the x402 micropayment protocol. Wraps existing Zo skills and tools behind per-request payment walls. Each call costs $0.001–...
x402-monetize
Create paid API endpoints that earn micropayments every time they're called.
What This Does
- Wrap any Python script or Zo tool as an HTTP API endpoint
- Add x402 payment middleware (client pays per-call via USDC on Base)
- Register the endpoint as a Zo user service on port 4020
- The endpoint runs 24/7 and deposits earnings automatically
Quick Start
cd /home/workspace/MoneyMachine/x402_server
node index.js
Endpoints Included
| Endpoint | Price | Description |
|---|---|---|
/api/signals/:ticker | $0.01 | Options trading signal (bull/bear/neutral) |
/api/whale/:ticker | $0.01 | Whale flow alert (size, direction, conviction) |
/api/wave/:ticker | $0.01 | Elliott Wave count + Fibonacci levels |
/api/maxpain/:ticker | $0.005 | Max pain level + strike wall zones |
/api/backtest | $0.05 | Run options strategy backtest |
/api/services | free | List all paid endpoints |
Adding a New Paid Endpoint
const { paymentMiddleware } = require('@x402/express');
// Add to index.js:
app.get('/api/my-endpoint', paymentMiddleware(), async (req, res) => {
// Your logic here
res.json({ result: 'paid data', price: '$0.01' });
});
Payment Flow
- Client requests
/api/signals/AAPL - Server returns
402 Payment Requiredwith payment details - Client pays USDC to facilitator
- Client retries with payment proof
- Server returns data
Docs
Version tags
latest
