← All articlesYou Can't Refund Electricity
Lightning Labs just let a coding agent pay for its own AI, per token, with no account and no API key. AI work can't be undone, so the payment for it shouldn't be either.
On 12 November, Lightning Labs released pi402, an open-source add-on that lets a coding agent pay for its own AI over Bitcoin's Lightning Network. No account. No API key. No card. The agent asks for an answer, gets a price, pays it in sats, and keeps working.
That sounds like a payments story. We think it is an energy story.
The work can't be undone
Every AI answer burns power. A GPU turns electricity into heat and tokens, and once the answer has streamed out, the cost is spent. Nothing reverses it.
A card payment can be reversed. Lightning Labs puts the chargeback window at 60 to 120 days. So a company that sells AI by card hands over GPU time today and finds out months later whether it was paid. In Lightning Labs' words, that seller is not a merchant. It is "a lender."
Look at what AI sellers ask before your first token: a sign-up, fraud checks, a minimum top-up, a supported country, a key tied to a human who can be billed later. None of that is the product. It is underwriting for a loan nobody asked for.
The payment is the key
pi402 runs on L402, a protocol Lightning Labs built on an unused corner of the web. HTTP, the language browsers and servers speak, has carried a status code called 402 Payment Required since 1997. The current standard still says it is "reserved for future use."
L402 uses it like this. The agent sends a normal request. The seller answers 402 with a Lightning invoice and a half-finished access token, called a macaroon. Paying the invoice reveals a secret, and that secret completes the token. The agent retries, and the answer streams back.
Payment and permission become the same thing. No email, no password, no customer database to leak. The seller's gateway, Aperture, keeps the real model key on its own server and adds it there. The buyer only ever holds sats.
The unit is small enough to match the work. Lightning counts in millisatoshis, a thousandth of a sat, roughly $0.0000008 each by Lightning Labs' math. At 1 millisat per input token and 2 per output token, that comes to about $0.80 and $1.61 per million tokens. You could price a single token.
API keys were the last account
This autumn we have watched agents hit walls built for humans. Banks that block them. Approval codes they can read. Passwords that act as permissions.
An API key is the same wall in developer clothes. It is an account in disguise: a fixed secret that proves someone paid once, not who is paying now. Copy it and you are that customer. Leak it and a stranger runs up your bill.
Paying per request flips that. Trust stops being an ID you hold and becomes behaviour you pay for, again and again, in real money. We call it velocity: what you did, how often, at what cost. A key can be stolen in a second. A long record of paid requests has to be earned.
It also answers the oldest problem on the open internet. When every request costs something, floods and spam cost the sender, not the target. The price is set freely by the two ends, not by a platform in the middle.
Budgets, not blank checks
The part we like most is the boring part. pi402 checks every quote against two limits before the wallet moves: a cap per request and a cap per day. In the code, the defaults are 1,000 sats and 100,000 sats. The macaroon can also be narrowed offline and handed to a sub-agent with a smaller budget.
That is how you give software money. Not a card number. An allowance with a hard ceiling.
Not the only door
Bitcoin is not alone at the 402 door. Coinbase's x402 uses the same status code, mostly with stablecoins like USDC and a "facilitator" that settles on chain. Stripe and Tempo wrote the Machine Payments Protocol, MPP, now an IETF draft for the same pattern. Lightning Labs' gateway offers both L402 and MPP in one reply, and the agent picks.
So the question is no longer whether machines will pay per request. It is what they settle in. Our bet: work that burns energy should settle in money secured by energy. Final in seconds, open to anyone, with nobody in the middle who can pull it back.
Early, and honest about it
This is version 0.0.6 on npm. It works with one agent, Pi. It runs on a test network unless you switch it to mainnet. The project's own site says "There is no public seller yet," and its prices are demo rates.
None of that changes the shape. The web reserved a door for payments almost 30 years ago. Agents are the first customers patient enough to use it, and impatient enough to need it.
At MindLink we think every request between nodes should carry its own price. BitSov is our proposal for that world, not a product. pi402 shows one piece of it working today.
Sources
- Lightning Labs: Announcing pi402: Your Agent Can Now Pay for Inference with Bitcoin (Olaoluwa Osuntokun, 12 Nov 2026)
- pi402 project site
- lightninglabs/pi-402 on GitHub
- npm: @lightninglabs/pi-402
- Lightning News: Lightning Labs pi402: The Coding Agent That Pays for Its Own Inference (13 Nov 2026)
- Aperture, the L402 reverse proxy (v0.6.0)
- Lightning Labs: L402 documentation
- RFC 9110: HTTP Semantics, 402 Payment Required
- RFC 2068: HTTP/1.1 (January 1997)
- Coinbase: x402, how it works
- IETF draft: The "Payment" HTTP Authentication Scheme
- Stripe Docs: MPP (Machine Payments Protocol)