What L402 is
The protocol is described as an open paywall built on the HTTP 402 Payment Required status code and the Lightning Network for API monetization and digital services.
What you can do with it
- Bill an API per call with micropayments
- Gate article reading behind a paywall
- Grant fine-grained access to specific services
- Manage access rights with Macaroons tokens
Application scenarios
- An API provider charges by the number of calls
- An online publisher locks articles behind a paywall
- A company controls access to particular data
Getting started
- A server returns an L402 challenge with HTTP 402 Payment Required
- The challenge carries a macaroon and a Lightning invoice
- The client extracts both from the 402 response
- The client pays the invoice and builds an authenticated request with the preimage
Pros & cons
✓ What we like
- The open protocol is extensible across industries
- Micropayments and pay-per-use open new revenue streams
! What to watch out for
- A server must issue an L402 challenge before protected endpoints
- Clients pay a Lightning invoice before an authenticated request
FAQ
What status code does it use?
The material states it is built on HTTP 402 Payment Required.
How does a client get access?
The documented flow is to pay a Lightning invoice and combine a macaroon with a preimage.
Last reviewed: 2026-11-15
More AI coding tools tools
View all →-
100 Vibe Coding Learn vibe coding by building Free tools Enterprise tools Developer tools API integration Coding -
10Web Prompt to WordPress site with hosting Free tools Developer tools No code development Coding Website builder -
16x Prompt Context management for AI coding Free tools Workflow automation Developer tools API integration Coding -
a0.dev Chat-built mobile apps to store Free tools Developer tools No code development Coding App builder -
Adalo No-code apps with a visual canvas Free tools Developer tools No code development Coding App builder -
AgentQL Natural language web data extraction Freemium tools Developer tools Browser extension Data extraction Coding