L402: native payments forMCPAI AgentsAPIsDataMCP
A universal HTTP-based payment flow that enables direct monetization from anywhere. No browser needed.
Any Payment Method
Works out of the box with credit cards, bank rails and crypto.
Simple Integration
Built on HTTP 402 standard. Just a few lines of code to implement.
AI-Ready
Easiest way to give AI agents the ability to pay for services.
How L402 Works
L402 mimics familiar browser payment flows using the HTTP 402 "Payment Required" standard.
Client Requests Resource
A client attempts to access a protected API resource that requires payment to use.
L402 Flow: How It Works
1) A client attempts to access a protected API resource that requires payment to use.
2) Server responds with a 402 Payment Required status code and JSON containing available payment offers and methods for the client to choose from.
3) Client contacts the payment gateway to request specific payment details for their chosen offer and preferred payment method.
4) Gateway returns payment details needed for the transaction - such as a checkout URL, Lightning invoice, or ACH account information.
5) Client completes the payment outside of the protocol using their selected payment method and the provided payment details.
6) Once payment is confirmed, the payment gateway notifies the server that the payment has been received successfully.
7) When the client requests the resource again, the server recognizes the completed payment and grants access to the protected resource.
The entire flow uses standard HTTP semantics, making it compatible with any HTTP client - browsers, API clients, or AI agents. While the API, payment gateway, and server are shown as separate entities, with self-custodial methods they could be implemented as the same entity.
Payment Method Support
L402 works with virtually any payment method, providing a unified interface for all transactions.
Banking
Credit Cards
Cryptocurrencies
Key Features
L402 delivers unique advantages for payment processing on the internet.
Open Source
Built for transparency and community contribution, allowing anyone to extend and improve.
Universal Compatibility
Works with every payment method from credit cards to crypto, Lightning, and stablecoins.
Simple & HTTP-Based
Built on standard HTTP status codes and headers, requiring minimal code to implement.
AI-Agent Ready
Designed specifically for machines to autonomously handle payments without friction.
Perfect for Micropayments
Ideal for pay-per-use APIs, metered content, or any small-value transactions.
Secure By Design
Built with security first, leveraging proven cryptographic methods for payment verification.
Ready to implement L402?
Get started with L402 today and enable seamless payment processing for your applications, APIs, and AI agents.