If you search "how to monetize an API", most results assume you need a billing platform: Stripe subscriptions, usage tiers, webhooks, dashboards. That's fine at scale. But for a small API — a scraper, a converter, an AI wrapper — the fastest path to first revenue is pay-per-call, and it needs far less machinery than you think.
This post is a decision framework plus a ~30-line implementation using usdc-paywall (MIT core, optional Pro license), a Node.js package that turns any Express route into a paid endpoint with USDC on Base.
When pay-per-call beats subscriptions
Charge per call when:
- Your API is occasional-use. A user needs it 20 times a month. A $19/mo plan is a hard no; $0.05/call is an easy yes.
- Your buyers are builders, not companies. Developers will send crypto from a wallet long before they'll open a Stripe account for you.
- You want zero billing ops. No invoices, no dunning, no chargebacks, no KYC. Payments settle on-chain directly to your wallet.
Charge subscriptions when usage is daily and buyers expect SLAs. Most small APIs are in the first bucket.
The pattern: HTTP 402
The web has a built-in status code for this: 402 Payment Required. The flow:
- Client calls
/api/convertwithout paying. - Server answers
402with a JSON body: price, your USDC address, and the tx hash it wants paid. - Client pays on Base (a few cents in fees) and retries with the tx hash in a header.
- Server verifies the transfer on-chain (amount, recipient, not reused) and serves the response.
The verification is the only tricky part — that's what the library does:
import { paywall } from "usdc-paywall"; app.use("/api/convert", paywall({ wallet: process.env.MY_WALLET, // your EVM address priceUSDC: 0.05, // per call network: "base", })); app.get("/api/convert", (req, res) => { res.json(convert(req.query.input)); // only reached after payment }); Call it without paying and you get a clean 402 with payment instructions — machine-readable, so another agent or script can pay you autonomously. That's increasingly relevant: as AI agents start calling APIs on their own, endpoints they can pay on their own are the ones they'll use.
Economics check
- USDC on Base: transfer fee ≈ $0.01–0.05.
- No platform cut: 100% of the price reaches your wallet.
- At $0.05/call, 1,000 paid calls/month = $50 with no infrastructure beyond your server.
Compare that to wiring Stripe metering for the same volume and deciding whether the complexity ever pays back.
What "done" looks like
A weekend project:
- Wrap one route with the middleware above.
- Point
walletat a fresh EVM address you control. - Test with a $0.05 payment from a second wallet (or MetaMask).
- Your API now has a business model.
The README covers webhook-free verification details, replay protection, and a Pro tier (watch mode + signed licenses) if you want license keys instead of per-call pricing.
Monetizing a small API is not a billing-platform problem. It's a middleware problem — and you can ship it in an afternoon.


