⚡ Bitcoin Lightning · AI-native · 0.3% fee · Open Source

AI agents pay your API.
Instantly. No humans. Lightning.

3 lines of code. AI agents pay your API — instantly, autonomously, 0.3% fee.

AI agent native machines can pay machines. No human in the loop.
Read the docs →
4
Languages
<1s
Settlement
0.3%
Fee only
0
Chargebacks
Live
BTC / USD
1 sat
current value
100 sats
~1 API call
1,000 sats
~10 calls
0.01 BTC
1,000,000 sats
▶ Live Demo

From install to first paid call

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 →

TypeScript
Python
Go
Rust
// 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();
}
Payments logged
GitHub Stars
npm downloads
PyPI downloads
<1s
Settlement
0
Countries blocked

How it works

📡
Client calls API
GET /premium
402 + Invoice
BOLT11 Lightning invoice returned
💸
Client pays
Any Lightning wallet, <1 second
🔐
Proof verified
SHA256(preimage) == hash
200 OK + data
You get 99.7% of every sat

Why not legacy payments?

Card processorsPayPal / legacyl402-kit ⚡
Minimum fee$0.30$0.30< 1 sat
Settlement2–7 days3–5 days< 1 second
ChargebacksYesYesImpossible
Requires accountYesYesNo
AI agent nativeNoNoYes
Countries blocked~50~600 — global
Open sourceNoNo100%

Why developers ⚡ l402-kit

Zero setup
Just set your Lightning Address. No node, no wallet setup, no config files.
🌍
4 languages
TypeScript, Python, Go, Rust. Express, FastAPI, Flask, Axum. Same protocol, any stack.
🤖
AI agent native
Machines can pay machines. No human in the loop. Perfect for autonomous AI agents.
🔐
Cryptographic proof
SHA256(preimage) == paymentHash. Mathematically unforgeable. No chargebacks ever.
📊
Payment logging
Every payment logged to Supabase automatically. See who paid, when, and how much.
🧩
Provider agnostic
Blink, OpenNode, LNbits — or bring your own. Implement LightningProvider in 5 lines.

What will you build?

AI / Agents
Monetize your AI tool
Charge per inference call. LLM wrappers, image gen, OCR APIs. Works natively with LangChain and AutoGPT agents.
priceSats: 50 // ~$0.05/call
Data APIs
Pay-per-query data
Weather, finance, sports, maps. No subscription needed — users pay exactly for what they use.
priceSats: 10 // ~$0.01/query
Content
Paywalled endpoints
Articles, research papers, PDFs, audio. No account creation required from your users.
priceSats: 500 // ~$0.50/read
Compute
Serverless billing
Charge for CPU-heavy tasks: rendering, transcription, compression. Pure usage-based, no monthly fee.
priceSats: 1000 // ~$1/task
Editor Extension

Track your Lightning payments — right in your editor

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.

  • Real-time payment feed
  • Bar chart — 1D / 7D (free) · 30D / 1Y / ALL (Pro)
  • Multi-language support
  • Light & dark mode
  • No account or permissions needed
Install Free on Marketplace Documentation →
Lang English (EN)
BTC $ · 1 sat = $—
⚡ ShinyDapps Payments
Total Payments
Total Sats
LIGHTNING ADDRESS
you@blink.sv
⚡ ShinyDapps Pro
Full history · CSV · Pay in Bitcoin
~9k sats/mo

Simple pricing

Pay with Bitcoin Lightning. No credit card. No account. Instant.

Free
$0 forever
0 sats — always free
0.3% fee on payments received
  • TypeScript, Python, Go, Rust
  • Managed Lightning — no node needed
  • Unlimited API calls
  • Payment history (last 7 days)
  • 1D / 7D charts
  • Open source — self-host anytime
Get started free →
Builder
$99 /month
calculating…
For devs shipping production APIs
  • Everything in Pro
  • Monitor up to 5 Lightning addresses
  • Webhook on every payment received
  • Programmatic API access to your data
  • 0% fee — bring your own provider
Founder
$999 one-time
calculating…
Pay once in Bitcoin. Yours forever.
  • Everything in Builder — forever
  • Early access to DCA agent
  • Listed as founding supporter
  • Input on the roadmap
  • No renewal. Ever.

Trusted by developers building on Bitcoin

"Finally, a payments lib that treats Bitcoin as first-class. 3 lines and it just works."

A
Early adopter
API developer

"My AI agent now pays for its own API calls. No wallets, no keys, no human approval."

B
AI engineer
LLM tooling

Be among the first. Join the early access list ⚡

Common questions

Does my API require users to have a Lightning wallet?
Yes — they need a Lightning wallet to pay. Apps like Strike, Cash App, Blink, and Phoenix take under 60 seconds to set up. For AI agents, they hold their own wallet programmatically.
What happens if the Lightning network is down?
Lightning is a decentralized network with near-100% uptime. If your provider (Blink, OpenNode, etc.) has downtime, you can swap to another in one line of code.
Is this production-ready?
Yes. Cryptographic proof (SHA256), replay-attack protection, and Supabase payment logging are built in. See the security guide in the docs.
How does the 0.3% fee work?
When using the managed mode (ownerLightningAddress), a 0.3% routing fee is deducted automatically. If you self-host with your own Lightning node, there is no fee.
Can I use it without Blink?
Yes. OpenNode, LNbits, or any provider implementing the LightningProvider interface. You can even use your own Lightning node.

Start in 2 minutes ⚡

No account. No credit card. Just Bitcoin Lightning.

npm install l402-kit pip install l402kit Go SDK → cargo add l402kit

or read the docs →

Early access list

New providers, protocol upgrades, and the DCA agent when it launches. One email per milestone — no noise.

No spam · Only major releases