⚡ MIT Open Source · TypeScript · Python · Go · Rust · AI-native

Cobre sua API em sats.
Qualquer wallet paga. Instantâneo.

3 linhas de código. Sem Stripe. Sem cadastro. Agentes de IA pagam nativo — máquinas pagam máquinas.

Sovereign
BTCPay · Alby Hub · LNbits
0% fee · your node · your keys
Plug & Play
Hosted Lightning endpoint
0.3% · no node needed
AI Agents
L402Client · autonomous pay
Claude · GPT · any agent
Ler docs →
Or scaffold a full server in one command:
4
Languages
<1s
Settlement
0%
Fee (own wallet)
1 sat
min. price
Without l402-kit
Stripe minimum: $0.30 per call
Requires account signup — friction
AI agents can't pay autonomously
~60 countries blocked by processors
2–7 day settlement window
With l402-kit ⚡
1 sat minimum ≈ $0.0006 per call
No account — any Lightning wallet pays
AI agents pay natively, autonomously
0 countries blocked — global by default
<1 second settlement, final
Live
BTC / USD
$78.464
1 sat
$0.000785
current value
100 sats
$0.0785
~1 API call
1,000 sats
$0.7846
~10 calls
0.01 BTC
$785
1,000,000 sats
▶ Interactive Demo

The full L402 flow, live

Real HTTP headers. Real Lightning invoice. Watch request → 402 → pay → 200.

l402-kit · HTTP 402 Payment Required
$

Click ▶ Run to simulate  ·  Try with a real Lightning wallet →

⚡ AI Agent
TypeScript
Python
Go
Rust
// npm install l402-kit  — AI agent consuming an L402-protected API
import { L402Client } from "l402-kit";
import { AlbyProvider } from "l402-kit";

// Agent has its own Lightning wallet — pays autonomously
const client = new L402Client({
  wallet: new AlbyProvider(process.env.ALBY_TOKEN!, process.env.ALBY_URL!),
});

// 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 (sovereign, 0% fee)
import express from "express";
import { l402, AlbyProvider } from "l402-kit";

const app = express();
const lightning = new AlbyProvider(
  process.env.ALBY_TOKEN!,   // hub.getalby.com — self-custodial
  process.env.ALBY_URL!
);

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.
# pip install l402kit  — protect your FastAPI endpoint (sovereign)
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();
}
MIT
Pagamentos registrados
Stars no GitHub
4k+
Total installs
<1s
Tempo de liquidacao
0
Paises bloqueados

Como funciona

📡
Cliente chama a API
GET /premium
402 + Fatura
Retorna invoice Lightning BOLT11
💸
Cliente paga
Qualquer wallet Lightning, <1 segundo
🔐
Prova verificada
Verified in &lt;1ms — no DB, pure crypto
200 OK + dados
Voce recebe 99.7% de cada sat

Por que cartões falham para APIs

Stripe foi construído para humanos comprando produtos. APIs cobram por chamada — e isso quebra tudo.

💸
Taxa mínima de $0,30
Uma chamada de 1 centavo custa $0,30 em taxas de cartão. Você perde dinheiro em cada requisição abaixo desse limite.
🤖
Agentes de IA não têm cartão
Agentes autônomos não têm endereço de cobrança, CVV ou humano para clicar "confirmar". O pagamento falha.
↩️
APIs não podem ser "devolvidas"
Você já entregou os dados. Um chargeback permite que o chamador os pegue de graça — e você paga a taxa.
🌍
50+ países bloqueados
Stripe e PayPal não operam em todo lugar. Sua API é global — seu processador não deveria decidir quem tem acesso.

Por que nao pagamentos tradicionais?

Processadores de cartaoPayPal / 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%

Tudo o que voce precisa

Configuracao zero
Defina seu Lightning Address. Sem node, sem setup de wallet, sem arquivos de config.
🌍
4 linguagens
TypeScript, Python, Go, Rust. Express, FastAPI, Flask, Axum. Mesmo protocolo em qualquer stack.
🤖
Nativo para agentes de IA
Maquinas pagando maquinas. Sem humano no meio. Perfeito para agentes autonomos.
🔐
Prova criptografica
SHA256(preimage) == paymentHash. Matematicamente infalsificavel. Sem chargeback.
📊
Logs de pagamento
Cada pagamento e registrado no Supabase automaticamente. Veja quem pagou, quando e quanto.
🧩
Provider-agnostic
Blink, OpenNode, LNbits ou o seu provider. Implemente LightningProvider em poucas linhas.

Who is this for?

You own the API. You keep 99.7% of every sat.

🛠️
API Owner
You sell data or compute
You built an API — weather, AI inference, market data, media — and want to monetize it per call without Stripe, subscriptions, or billing dashboards.
  • Add 3 lines of middleware
  • Set your price in sats
  • Receive Bitcoin instantly
🤖
AI Builder
Your agent needs to pay for tools
You're building autonomous AI agents that call external APIs. L402 is the native payment protocol for agents — no OAuth, no card on file, no human approval loop.
  • Agent gets 402 → pays invoice
  • Retries with proof → gets data
  • Works with any LLM framework
📦
OSS Developer
You want sustainable open source
Your library or tool is free and open source, but you want paid tiers — premium endpoints, higher rate limits — without the overhead of a payment SaaS.
  • Free endpoints stay free
  • Paid tiers in 10 minutes
  • No Stripe account needed

O que voce vai construir?

IA / Agentes
Monetize sua ferramenta de IA
Cobre por chamada de inferencia. Wrappers de LLM, geracao de imagem, OCR APIs. Funciona com agentes LangChain e AutoGPT.
priceSats: 50 // ~$0.05/call
APIs de Dados
Dados por consulta
Clima, financas, esportes, mapas. Sem assinatura: usuarios pagam so pelo uso.
priceSats: 10 // ~$0.01/query
Conteudo
Endpoints com paywall
Artigos, pesquisas, PDFs, audio. Sem exigir criacao de conta do usuario.
priceSats: 500 // ~$0.50/read
Computacao
Billing serverless
Cobre por tarefas pesadas: render, transcricao, compressao. 100% por uso.
priceSats: 1000 // ~$1/task
EXTENSAO VS CODE

Veja os sats entrando sem sair do editor

Dashboard de pagamentos Lightning em tempo real dentro do VS Code. Veja cada pagamento no instante em que cai.

  • ✓ Feed de pagamentos ao vivo com valor e endpoint
  • ✓ Grafico de barras — 1D / 7D (free) · 30D / 1Y / ALL (Pro)
  • ✓ 11 idiomas (EN, PT, ES, ZH, JA, FR, DE, RU, HI, AR, IT)
  • ✓ Tema claro / escuro / automatico
  • ✓ Zero config — so definir seu Lightning address
Instalar gratis no Marketplace Documentacao →
Lang English (EN)
BTC $78.464 · 1 sat = 0.000785
⚡ ShinyDapps Payments
0
Total Payments
0
Total Sats
LIGHTNING ADDRESS
you@yourdomain.com
⚡ ShinyDapps Pro
Full history · CSV · Pay in Bitcoin
~11.471 sats/mo

Precos simples

Pague com Bitcoin Lightning. Sem cartao. Sem conta. Instantaneo.

Gratis
$0 forever
0 sats — always free
0% com sua wallet · 0.3% gerenciado
  • TypeScript, Python, Go, Rust
  • Plug & play or bring your wallet
  • Unlimited API calls
  • Payment history (last 7 days)
  • 1D / 7D charts
  • Open source — self-host anytime
Comecar →
Builder
$99 /month
≈ 126k sats today/mo
Para times e APIs de alto volume
  • 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
≈ 1.27M sats — one-time
Pague uma vez. Use para sempre.
  • Everything in Builder — forever
  • Early access to DCA agent
  • Listed as founding supporter
  • Input on the roadmap
  • No renewal. Ever.

No card. No account. Pay with Bitcoin · Cancel anytime · Your data, your control — delete anytime ↗

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

Open source · MIT · Star on GitHub ⭐

Perguntas comuns

Meus usuarios precisam de wallet Lightning?
Sim. Eles precisam de uma wallet Lightning para pagar. Para agentes de IA, a wallet pode ser controlada por codigo.
E se a Lightning ficar fora do ar?
A Lightning e descentralizada e muito resiliente. Se um provider cair, voce troca por outro em uma linha.
Ja esta pronto para producao?
Sim. Prova criptografica, protecao anti-replay e logs no Supabase ja estao incluidos.
Como funciona a taxa de 0.3%?
No modo managed, a taxa de 0.3% e deduzida automaticamente. Em self-host, a taxa e 0%.
Posso usar sem Blink?
Sim. OpenNode, LNbits ou qualquer provider que implemente a interface LightningProvider.
Why Lightning and not on-chain Bitcoin?
On-chain Bitcoin takes 10+ minutes to confirm and costs $1–5 per transaction. Lightning settles in under a second for fractions of a cent — making $0.001 micropayments economically viable. If you bring your own wallet, your keys never leave your control. The payment proof (SHA256 preimage) is verified locally on your server — no third party involved.
How is this different from Coinbase's x402?
x402 is a protocol specification — it defines how HTTP 402 payments should work. l402-kit is a production-ready SDK that implements that same standard today, in TypeScript, Python, Go, and Rust. Coinbase's x402 targets USDC and stablecoins. l402-kit targets Bitcoin Lightning. They're complementary, not competing — and we're shipping code while they're publishing specs.
Is the 0.3% fee always charged?
No. The fee only applies if you use our managed infrastructure (add your Lightning address, we handle invoice creation). If you connect your own wallet — Blink account, OpenNode, LNbits, BTCPay, any provider — the fee is zero. You can switch at any time with one line of code. The open-source MIT license means you can self-host everything with no fees ever.

Comece em 2 minutos

Sem conta. Sem cartao. So Bitcoin.

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

ou leia a documentacao →

Privacy-first architecture

Your wallet is your identity.
Nothing else required.

Most payment APIs need your email, credit card, and account. l402-kit needs none of that — your Lightning wallet is cryptographic proof of who you are.

🔑

No account. No password.

Your Lightning Address is your identity. Authentication is a secp256k1 signature from your wallet — mathematically unforgeable, no server involved.

🗄️

Zero PII stored.

No email. No name. No IP. We store payment_hash — already public in the BOLT11 invoice. A database breach exposes nothing personal.

🔐

Keys never centralized.

Payment logic runs inside the database (Supabase Edge Functions). The API server holds only the invoice key — not your data, not your identity, not your history.

🗑️

Delete with cryptographic proof.

Only your wallet can authorize deletion of your data. No support ticket. No email verification. Sign the challenge — data is gone. Single-use token prevents replay.

💸

Payments are private by default.

Lightning payments don't identify the payer on-chain. The preimage is never stored. Your users pay anonymously — you just know the invoice was settled.

📊

Dashboard auth by wallet, not password.

Your analytics dashboard authenticates via LNURL-auth — the same secp256k1 flow. No password to phish, no session to hijack, no Vercel holding your admin secret.

vs. Stripe / LemonSqueezy / Paddle
They require email, KYC, account creation, and centralize all keys. A single breach exposes every customer's identity and payment history.
No email collected
No account required
No KYC, no compliance overhead
Cryptographic delete (LNURL-auth)
LGPD/GDPR compliant by design

Stay in the loop

Follow releases on GitHub — star the repo and enable notifications. No email required, no account, no tracking.

⭐ Star on GitHub

No email · No tracking · Bitcoin-native