When AI agents pay in bitcoin: Lightning, L402 and what to watch in Lugano
Software agents need a way to pay for data and services without a credit card or an account. Lightning Labs has published open-source tools for exactly that. A plain-language guide.
An AI agent is a program that carries out tasks by itself: it searches, calls other services, buys data. To pay for these things it would normally need a card, an account and an API key that a human set up. The Lightning Network, bitcoin's fast payment layer, offers another way: the agent pays a small invoice and gets access straight away. Several sessions at Plan ₿ Forum on 23–24 October cover this topic.
How L402 works
L402 is a payment protocol from Lightning Labs. It uses the HTTP status code 402 "Payment Required", which has existed in the web standard for decades but was rarely used.
- The agent requests a paid resource, for example an API.
- The server answers 402 with a Lightning invoice and a token.
- The agent pays the invoice and receives a proof of payment.
- It repeats the request with the token and the proof, and gets the data.
There is no sign-up, no stored card and no API key to leak. In the words of the documentation, "credentials are purchased, not provisioned."
The toolkit
Lightning Labs has published lightning-agent-tools, an open-source set of seven skills and a server for AI assistants:
- lnget: a command-line downloader that pays L402 invoices automatically, caches tokens and retries the request. The
--max-costoption caps how much it may pay per request. - Aperture: a reverse proxy that lets a seller put an L402 paywall in front of an existing API.
- An MCP server with 18 read-only tools, so an AI assistant can look up a Lightning node's state without being able to move funds.
Keep the keys safe
The kit uses a remote signer by default: the agent's machine does not hold the private keys, a separate machine signs. The documentation adds: "For production use with significant funds, use watch-only mode with a remote signer."
Do not give an AI agent a wallet with more money than you are willing to lose. Set a spending cap, keep the keys on a separate signer, and start with small amounts.
In Lugano
| Lugano / MSK | Session |
|---|---|
| 23 Oct, 16:30 / 17:30 | Keynote by Elizabeth Stark, CEO of Lightning Labs (title TBD), WAGMI Stage |
| 23 Oct, 17:30 / 18:30 | Panel "Agents Need Money: Bitcoin, Lightning and A2A Payment Rails": Olaoluwa Osuntokun (Lightning Labs), Roy Sheinfeld (Breez), Moritz Kaminski (Alby), Ben Kaufman (Synonym); moderator Stephan Livera. P2P Stage |
| 24 Oct, 10:00 / 11:00 | "Unlocking P2P commerce", John Carvalho (Synonym), WAGMI Stage |
| 24 Oct, 10:30 / 11:30 | "Monetizing Lightning Channels", Jesse Shrader (Amboss), P2P Stage |
| 24 Oct, 15:00 / 16:00 | "Why Bitcoin Wins the Machine Economy", Mark Moss, WAGMI Stage |
| 24 Oct, 16:15 / 17:15 | Masterclass "Paykit: A new Payment Protocol Paradigm", Ben Kaufman and Denys Zaliskyi (Synonym), UTXO Room |
What we expect
Elizabeth Stark's talk has no title yet. Given the panel right after it, agent payments are a likely topic, but that is our guess, not an announcement.
Learn the basics of Lightning in our Learn section, and see live network stats, wallets and node options on our Lightning Network page.
Sources
- Lightning Labs: lightning-agent-tools (GitHub) github.com
- lightning-agent-tools: L402 and lnget github.com
- Lightning Labs: Aperture, L402 reverse proxy (GitHub) github.com
- Plan ₿ Forum agenda planb.lugano.ch
Times are Lugano (CEST, UTC+2) and Moscow (UTC+3). Not investment advice.
Read next
Plan ₿ Forum 2026 in Lugano: what to watch on 23–24 October
121 speakers (official agenda, 20 October) and 92 sessions over two days. The talks that matter for Bitcoin, with times in Lugano and Moscow, and a clear line between facts and expectations.
BIP-110 post-mortem: why a soft fork backed by 2.5% of miners stalled after two blocks
On 8 August 2026 nodes enforcing BIP-110 split from Bitcoin at block 961,632. Here is what happened, why the new chain froze, and what it means for you.