3 linhas de código. Sem Stripe. Sem cadastro. Agentes de IA pagam nativo — máquinas pagam máquinas.
Hit VERITY — an autonomous AI agent earning sats on l402-kit at l402kit.com/api/verity. You'll get the actual Lightning invoice and macaroon. No payment needed to see them.
An AI agent would pay this invoice over Lightning, then retry with Authorization: L402 <macaroon>:<preimage> to get the data. That's the entire L402 protocol — and three lines of code with l402-kit.
L402 connects API sellers and AI buyers — same 3-line SDK, no middleman.
l402({ priceSats: 10, lightning })new L402Client({ wallet, budgetSats: 1000 })l402kit.com hosts the Lightning node for you. Every payment splits automatically: 99.7% goes straight to your address, 0.3% keeps the project alive. Or self-host for 0%.
| Feature | Stripe | PayPal | l402-kit ⚡ | x402 (USDC) |
|---|---|---|---|---|
| Min. fee per call | $0.30 | $0.30 | 1 sat ≈ ... | ~$0.001 USDC |
| Cost: 1,000 calls | $300 | $300 | ≈ ... (live) | ~$1 USDC |
| Cost: 1M calls | $300,000 | $300,000 | ≈ ... (live) | ~$1,000 USDC |
| Settlement | 2–7 days | 3–5 days | < 1 second | ~seconds (Base) |
| Requires account | Yes | Yes | No | No (wallet) |
| AI agent native | No | No | Yes | Yes |
| Countries blocked | ~50 | ~60 | 0 — global | ~few (OFAC) |
| Chargeback risk | Yes | Yes | Impossible | Impossible |
| Currency | Fiat (USD) | Fiat (USD) | Bitcoin ⚡ | USDC (stablecoin) |
| l402-kit compatible | No | No | Native | ✓ Compatible |
⚡ Assuming 100 sats/call at current BTC price — updates live
Watch the full L402 flow: request → 402 → pay → 200.
// npm install l402-kit — AI agent consuming an L402-protected API import { L402Client, AlbyWallet } from "l402-kit"; // Agent has its own Lightning wallet — pays autonomously const client = new L402Client({ wallet: new AlbyWallet(process.env.ALBY_TOKEN!), budgetSats: 1000, }); // Automatic: 402 detected → pays invoice → retries → returns data const res = await client.fetch("https://any-l402-api.com/data"); const data = await res.json(); // → 200 OK — paid in <1s, no human involved, no API key, no subscription
// npm install l402-kit — protect your API (soberano, 0% fee) import express from "express"; import { l402, BlinkProvider } from "l402-kit"; const app = express(); const lightning = new BlinkProvider( process.env.BLINK_API_KEY!, process.env.BLINK_WALLET_ID! ); app.get("/premium", l402({ priceSats: 100, lightning }), (req, res) => { res.json({ data: "Payment confirmed ⚡" }); }); app.listen(3000); // 0% fee. Your node. Every sat goes directly to you.
// npm install l402-kit — managed mode: no node, no wallet setup import express from "express"; import { l402, ManagedProvider } from "l402-kit"; const app = express(); // l402kit.com hosts the Lightning node — no setup needed const lightning = ManagedProvider.fromAddress("you@yourdomain.com"); // ↑ payments go directly to your Lightning address (99.7% of each sat) app.get("/api/data", l402({ priceSats: 10, lightning }), (req, res) => { res.json({ data: "Payment confirmed ⚡" }); }); app.listen(3000); // Fee: 0.3% to l402kit.com · 99.7% to you · TypeScript only
# pip install l402kit — protect your FastAPI endpoint (soberano) from fastapi import FastAPI from l402kit import l402_required, BlinkProvider app = FastAPI() lightning = BlinkProvider( api_key="your_blink_key", # dashboard.blink.sv — free wallet_id="your_wallet_id" ) @app.get("/premium") @l402_required(price_sats=100, lightning=lightning) async def premium(): 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, Provider: l402kit.NewBlinkProvider(os.Getenv("BLINK_KEY"), os.Getenv("BLINK_WALLET")), }, 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@yourdomain.com"), ); 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(); }
Click ▶ Run to simulate · Open live L402 endpoint →
You own the API. You keep 99.7% of every sat.
AI agents already browse the web, write code, and make decisions. The only thing missing: the ability to pay for the APIs they need — without a human in the loop.
client.fetch(url) — drops into any agent loop. Budget control, auto-retry, proof verification — built in. No plumbing required.fetch — if the framework calls HTTP, it works.Give Claude Desktop or Cursor a Lightning wallet. From that moment on, any AI agent running inside those tools can autonomously pay for L402 APIs — no code, no credit card.
{
"mcpServers": {
"l402": {
"command": "npx",
"args": ["l402-kit-mcp"],
"env": {
"BLINK_API_KEY": "blink_xxx",
"BLINK_WALLET_ID": "uuid",
"L402_BUDGET_SATS": "1000"
}
}
}
}
Every API below accepts Lightning micropayments via L402 — no API key, no subscription, no human in the loop.
Loading…
Pague com Bitcoin Lightning. Sem cartao. Sem conta. Instantaneo.
No card. No account. Pay with Bitcoin · Cancel anytime · Your data, your control — delete anytime ↗
Real-time Lightning payment dashboard inside VS Code. See every payment the instant it lands — endpoint hit, amount in sats, USD value, and a live chart.
No account. No Stripe. No middleman. Just
Bitcoin Lightning — instant, global, final.
MIT · Open source · stars