3 lines of code. AI agents pay your API — instantly, autonomously, 0.3% fee.
Watch the full L402 flow — end to end, in real time
Use ShareX (Win) · Kap (Mac) · OBS to record this as a GIF · Open fullscreen →
// npm install l402-kit import express from "express"; import { l402 } from "l402-kit"; const app = express(); app.get("/premium", l402({ priceSats: 100, ownerLightningAddress: "you@blink.sv", // receives 99.7% }), (req, res) => { res.json({ data: "Payment confirmed ⚡" }); }); app.listen(3000);
# pip install l402kit from fastapi import FastAPI, Request from l402kit import l402_required app = FastAPI() @app.get("/premium") @l402_required( price_sats=100, owner_lightning_address="you@blink.sv", ) async def premium(request: Request): return {"data": "Payment confirmed ⚡"}
// go get github.com/shinydapps/l402-kit/go package main import ( "fmt"; "net/http" l402kit "github.com/shinydapps/l402-kit/go" ) func main() { http.Handle("/premium", l402kit.Middleware(l402kit.Options{ PriceSats: 100, OwnerLightningAddress: "you@blink.sv", }, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, `{"data":"Payment confirmed ⚡"}`) }))) http.ListenAndServe(":8080", nil) }
// Cargo.toml: l402kit = "0.1" use axum::{middleware, routing::get, Router}; use l402kit::{l402_middleware, Options}; use std::sync::Arc; async fn handler() -> &'static str { "{\"data\":\"Payment confirmed ⚡\"}" } #[tokio::main] async fn main() { let opts = Arc::new( Options::new(100).with_address("you@blink.sv"), ); let app = Router::new() .route("/premium", get(handler)) .route_layer(middleware::from_fn_with_state(opts, l402_middleware)); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); axum::serve(listener, app).await.unwrap(); }
| Card processors | PayPal / legacy | l402-kit ⚡ | |
|---|---|---|---|
| Minimum fee | $0.30 | $0.30 | < 1 sat |
| Settlement | 2–7 days | 3–5 days | < 1 second |
| Chargebacks | Yes | Yes | Impossible |
| Requires account | Yes | Yes | No |
| AI agent native | No | No | Yes |
| Countries blocked | ~50 | ~60 | 0 — global |
| Open source | No | No | 100% |
See every payment in real time, with live charts and instant notifications. No setup, no account, no permissions required. Works with TypeScript, Python, Go, Rust and more.
Pay with Bitcoin Lightning. No credit card. No account. Instant.
Trusted by developers building on Bitcoin
"Finally, a payments lib that treats Bitcoin as first-class. 3 lines and it just works."
"My AI agent now pays for its own API calls. No wallets, no keys, no human approval."
Be among the first. Join the early access list ⚡
No account. No credit card. Just Bitcoin Lightning.
New providers, protocol upgrades, and the DCA agent when it launches. One email per milestone — no noise.
No spam · Only major releases