The Open-Source AI Stack
RSS

The Stack · Protocols · Open source

L402

Lightning Labs payment protocol pairing HTTP 402 with Lightning Network invoices; the original agentic-payments rail.

Apache 2.0 · stable · Project site → · GitHub →

L402 is a payment protocol that combines the long-dormant HTTP 402 "Payment Required" status code with Lightning Network invoices and a macaroon-based capability token. A client requests a resource; the server replies 402 with a Lightning invoice; the client pays the invoice and gets back a token that authorizes subsequent requests. The whole exchange is permissionless, no account or API key required. L402 matters for the open-source AI conversation because AI agents are becoming economic actors (paying for tool calls, inference, data) and the rails they pay on determine who can become an economic agent without permission. The sibling protocols are x402 (Coinbase's 2025 stablecoin-anchored revival of HTTP 402, on-chain settlement instead of Lightning) and various early MCP commerce extensions that propose paying for MCP tool calls directly. The closed counterpart is Stripe Agent SDK, which works fine but binds the agent to a Stripe account. Production-ready spec since 2020. Used by Lightning Labs' own Loop / Pool / Aperture services, by HRF-funded projects like Routstr (an LLM routing marketplace on Nostr that uses L402 for payment) and PayPerQ (a chatbot gateway that accepts Lightning), and by an emerging set of agent-payment startups. The honest limit: adoption is still concentrated in the Bitcoin-Lightning ecosystem; broader AI-agent adoption depends on whether the ecosystem treats Lightning as a viable rail or moves to on-chain stablecoin alternatives.

Sources

Want a follow-up? Ask the chat about L402 in context. It will compare to siblings at the same layer and ground every claim in the wiki.

Other projects at the Protocols layer

5 siblings · ordered open first