On 12 November Lightning Labs shipped pi402: an extension that lets the Pi coding agent pay for AI inference per token, over Lightning, with no account and no API key. The launch page said: "There is no public seller yet."
Besides a demo endpoint run by Lightning Labs' founder, nobody was selling to it yet. Ten days later there is an independent seller: Lampo (https://lampo.run). Here is how it is built, what it costs, and what we learned.
The stack
One small VPS, and open-source software from Lightning Labs:
- Aperture (master): the L402 + MPP paywall in front of Baseten Model APIs, with metered pricing. The buyer prepays a bundle of tokens, and each request is debited by what it actually used, input and output at their own rates.
- Lightmeter: turns the upstream USD list prices and the BTC spot price into sats, sells the bundles and keeps the usage ledger.
- Wavelength: a self-custodial wallet that mints the invoices. No Lightning node, no channels, no liquidity to manage.
- Caddy: TLS and the website. Token streaming works once the proxy stops buffering (
flush_interval -1).Setup is one idempotent script. There are no buyer accounts to store, because there are no accounts at all.
Prices
- DeepSeek V4 Flash and GLM 5.3 Flash: 1,000,000 tokens for 1,000 sats. That is exactly pi402's default limit per payment, so it works with zero buyer configuration.
- GLM 5.2 / 5.3, Kimi K3, Kimi K3.1 Pro: bundles of roughly 2,750 to 3,400 sats. Raise
PI402_MAX_SAT_PER_REQUESTto use them.- Margin: 10% over Baseten's list price. Prices follow BTC and are recomputed every 10 minutes: https://lampo.run/stats.json
Two limits of today's metering, which we reported to Aperture:
- Rates are whole msat per token. At BTC ≈ $60k the floor is about $0.61 per million tokens, so very cheap models can't be sold at their real price.
- Cached input tokens are billed as fresh input, while upstreams charge about a tenth for them. Coding agents resend long, mostly cached prompts, so this matters.
Gotchas
- Wavelength won't send, make change or (on mainnet, today) receive below 1,000 sats unless credit is available. Keep every bundle at 1,000 sats or more, and size your sweeps the same way.
- A mainnet Wavelength account holds at most 300,000 sats, so sweep often. We sweep to a Lightning address.
- Unknown model ids fail closed with a 500: nobody gets free inference, but document your model ids.
- pi402 0.0.6 still lists GLM-4.7, which Baseten has retired. We sent a pull request to replace it with GLM-5.3 and GLM-5.3 Flash.
Compliance, briefly
Public terms of use (paying an invoice means accepting them), no logging of prompts or responses, business use, and geoblocking of countries under comprehensive EU sanctions.
Try it
pi install npm:@lightninglabs/pi-402 export L402_PROXY_URL=https://lampo.run/v1 export PI402_NETWORK=mainnet pi /fund 20000 /model pi402/deepseek-v4-flashAny other L402 or MPP client works too: there is a plain
curlwalkthrough on the site, plusllms.txtand an OpenAPI file for agents.Thanks
Thanks to michael (npub1h9z…khpt) and the Lightning Labs team for Aperture, Lightmeter, Wavelength and pi402, and to ryanthegentry (npub1uat…n24e) for 402index. Lampo is an independent project, not affiliated with Lightning Labs or Baseten.
Thanks michael (npub1h9z…khpt) and the Lightning Labs team for the stack, and ryanthegentry (npub1uat…n24e) for 402index ⚡
https://lampo.run
