Skip to main content
Live on Mainnet

L402 API

Pay-per-use APIs powered by Lightning Network. Perfect for testing AI agent payments or building micropayment-powered applications.

$ curl https://lightningfaucet.com/api/l402/fortune

How L402 Works

L402 (formerly LSAT) is an HTTP-native payment protocol. Request a resource, pay a Lightning invoice, and get instant access. No API keys needed — just pay and access.

1
Request
GET /api/l402/*
2
402 Response
Invoice + Macaroon
3
Pay Invoice
Any LN Wallet
4
Access
L402 Auth Header

Available Endpoints

Three L402-protected APIs with standard and premium tiers. Pay only for what you use.

Fortune

/api/l402/fortune

AI-generated Bitcoin-themed fortunes and prophecies. Premium includes lucky numbers and extended readings.

10
sats / standard
100
sats / premium
wisdom bitcoin luck humor

Joke

/api/l402/joke

Tech, Bitcoin, and dad jokes. Premium tier includes AI-generated variations and explanations.

21
sats / standard
50
sats / premium
bitcoin tech dad

Quote

/api/l402/quote

Inspirational quotes from tech leaders, philosophers, and Bitcoin pioneers with context.

10
sats / standard
30
sats / premium
bitcoin tech philosophy

API Usage

Request an Invoice

terminal
curl https://lightningfaucet.com/api/l402/fortune?category=bitcoin

402 Response

response.json
{ "error": "payment_required", "price_sats": 10, "tier": "standard", "invoice": "lnbc100n1pj...", "macaroon": "AgELbGln...", "payment_url": "https://lightningfaucet.com/pay/aBcDeFgH" }

Retry with Payment Proof

terminal
# After paying and receiving preimage... curl -H "Authorization: L402 <macaroon>:<preimage>" \ https://lightningfaucet.com/api/l402/fortune

Try It Live

Select an endpoint and pay with Lightning. Pay per request — no API keys needed.

response.json

Pay to Continue

Tap QR or open payment page

Waiting for payment...

Building AI Agents?

Use our Agent Wallet API to fund your agents and let them pay L402 APIs automatically.

Pre-fund with sats
Automatic L402 payments
Budget controls
Transaction logs
Learn More