L

L402 Protocol

A machine-to-machine payment protocol that combines HTTP status code 402 ("Payment Required") with the Bitcoin Lightning Network, designed for AI agents and APIs to transact in fractions-of-a-cent without involving credit cards or human approval. Originally called LSAT by Lightning Labs.

What it is

L402 (Lightning Labs Authentication Tokens, formerly "LSAT") is an open protocol that lets an HTTP server demand payment for a request and a client — typically an AI agent or another machine — pay it programmatically without involving a human. The flow is: client requests a paid resource; server returns HTTP 402 ("Payment Required") with a Lightning Network invoice and a "macaroon" (a scoped, authenticated token that becomes valid once the invoice is paid); client pays the invoice; client retries the request with the now-valid macaroon attached; server fulfills. It originated at Lightning Labs around 2020 and was renamed from LSAT to L402 in 2022. In 2025, Coinbase introduced x402, the same HTTP 402-based pattern but with stablecoin (USDC) settlement on Layer 2 rather than Lightning, broadening the protocol family. Both target the same gap: native, machine-speed, sub-cent payments that credit card rails cannot serve.

Why it matters

AI agents are starting to spend money — paying for premium APIs, scraping permission-gated content, tipping data providers, transacting with other agents. Credit card rails were not built for any of this: high minimum charges, human approval flows, chargeback risk, KYC overhead per merchant relationship. L402 (and x402) flip the model: every paid resource exposes its price natively in its HTTP response, agents pay autonomously within preset budgets, settlement is final and instant, and amounts can be fractions of a cent. As the "agent economy" emerges in 2026, the protocols that make agent-to-API and agent-to-agent payments practical are quietly becoming critical infrastructure. Most AI engineers have not heard of L402 yet; the ones who have are building the substrate that will run agent commerce in 2027.

Key components

  • HTTP 402 — the long-reserved-but-unused HTTP status code for "Payment Required," now finally meaningful
  • Lightning Network — Bitcoin Layer 2 enabling sub-cent, near-instant, machine-speed payments
  • Macaroons — bearer tokens with attenuable scope, issued in the 402 response and validated post-payment
  • Invoice + token round-trip — server issues invoice, client pays, server validates and accepts the token
  • x402 — Coinbase's 2025 variant of the same pattern using USDC stablecoin settlement instead of Lightning

Need Help Implementing This?

We specialize in putting AI and Agentforce to work for Salesforce customers. Let's talk about your use case.

Book Intro Call