I've been building with L402 for a few months, and the biggest friction point is always the same: LND + Aperture is powerful but getting it running, keeping it running, and wiring it to a new API takes a full afternoon at minimum.
So I packaged it as a managed service. The core idea: you have an API. You want to charge per call in sats. You shouldn't need to run Lightning infrastructure to do that.
How it works technically:
The gateway runs LND + Aperture on Fly.io. When a request arrives, Aperture checks for a valid L402 token. If there's none, it generates a Lightning invoice and returns HTTP 402 with a WWW-Authenticate header. Client pays, retries with the preimage, Aperture proxies the request to your backend. Your API doesn't need to know Lightning exists.
Pricing: 2% of transaction volume, baked into the invoice price. Customer sets their price, we charge price × 1.02 rounded up. Billed monthly above 10,000 sats threshold.
Live demo (returns a real mainnet Lightning invoice):
curl -X POST https://parsebit-lnd.fly.dev/extract/webpage
-H "Content-Type: application/json"
-d '{"url":"https://example.com"}'
Registration and docs: crackedminds.co.uk/gateway
Also built on top of the same infrastructure: Boltwork — pay-per-call AI services (PDF summarisation, code review, translation, data extraction) all gated behind L402. parsebit.fly.dev
Happy to answer questions about the LND/Aperture setup or the L402 protocol.
How are you handling invoice expiry and replay protection on the L402 tokens—especially for APIs with slower client retry cycles?
Nice build. I did the equivalent on the EVM side — an x402 (
HTTP/1.1 402 Payment Requiredon USDC/Base) in front of a Slither-backed audit endpoint. Few observations from doing roughly the same thing on the other rail:registry.modelcontextprotocol.io) via their HTTP-domain-ownership auth —/.well-known/mcp-registry-authwith an Ed25519 proof, no GitHub required. If you wrapped your gateway as an MCP server, AI-agent clients would discover it the same way (Claude Desktop / Cursor / etc. dotools/listagainst anything in the registry). The registry is pretty sparse on actually-useful remote tools right now, which is a feature if you ship early.