L402 API Catalog
25 pay-per-use endpoints for AI agents. No API key needed — payment is the auth.
How L402 Works
Request
Call any endpoint without auth. Get back 402 Payment Required with a Lightning invoice.
Pay
Pay the Lightning invoice (milliseconds). Receive the preimage as proof of payment.
Access
Retry with Authorization: L402 header containing macaroon + preimage. Get your data.
HTTP Status Codes
402 Payment Required — includes WWW-Authenticate header with invoice200 OK — payment verified, content delivered429 Too Many Requests — rate limited# All endpoints use POST with action in the JSON body
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-d '{"action": "l402_uuid"}'
# Returns 402 + Lightning invoice in WWW-Authenticate header
# Pay the invoice, get preimage, then retry:
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 ${MACAROON}:${PREIMAGE}" \
-d '{"action": "l402_uuid"}'
# Returns 200 with your data
Bitcoin & Lightning Data
On-chain fees, node stats, invoice decoding, and price data.
l402_onchain_fee
50 sats
Fee Estimate
Bitcoin on-chain fee estimates from mempool.space.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_onchain_fee" }'
l402_node_info
30 sats
Node Info
Our LND node stats: channels, peers, capacity.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_node_info" }'
l402_invoice_decode
30 sats
Invoice Decode
Decode any BOLT11 Lightning invoice into structured data.
invoice
BOLT11 string
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_invoice_decode", "invoice": "lnbc..." }'
l402_lnurl_metadata
30 sats
LNURL Metadata
Parse any LNURL or Lightning address into metadata.
lnurl
LNURL or Lightning address
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_lnurl_metadata", "lnurl": "user@domain.com" }'
l402_price_oracle
200 sats
Price Oracle
BTC price from CoinGecko + Coinbase in USD, EUR, GBP, JPY.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_price_oracle" }'
l402_lightning_stats
200 sats
Lightning Stats
Lightning Network stats: nodes, channels, total capacity.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_lightning_stats" }'
AI/LLM Utilities
LLM prompts, sentiment analysis, keyword extraction, and summarization.
l402_llm_prompt
100 sats
LLM Prompt
GPT-4o-mini access with 128 token limit. Quick AI completions.
prompt
Your prompt text
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_llm_prompt", "prompt": "Hello world" }'
l402_sentiment
30 sats
Sentiment
Classify text sentiment: positive, negative, or neutral.
text
Text to analyze
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_sentiment", "text": "Hello world" }'
l402_keywords
30 sats
Keywords
Extract keywords from any text passage.
text
Source text
count
Number of keywords
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_keywords", "text": "Hello world" }'
l402_summarize_title
30 sats
Summarize
Ultra-short summary of any text. Great for titles and snippets.
text
Text to summarize
max_words
Word limit
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_summarize_title", "text": "Hello world" }'
Fun & Content
AI-generated fortunes, jokes, quotes, and content moderation.
l402_fortune
10/100 sats
Fortune
AI-generated Bitcoin fortune. Standard or premium quality.
category
Optional topic
premium
true for premium
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_fortune", "category": "Optional topic" }'
l402_joke
21/50 sats
Joke
AI-generated joke. Standard or premium quality.
category
Optional topic
premium
true for premium
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_joke", "category": "Optional topic" }'
l402_quote
10/50 sats
Quote
Inspirational quote. Standard or premium quality.
category
Optional topic
premium
true for premium
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_quote", "category": "Optional topic" }'
l402_dad_joke
21/50 sats
Dad Joke
AI-generated dad joke. Groan-worthy guaranteed.
premium
true for premium
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_dad_joke", "premium": true }'
l402_satoshi_quote
10 sats
Satoshi Quote
Real Satoshi Nakamoto quotes from forums and emails.
topic
Optional topic filter
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_satoshi_quote", "topic": "Optional topic filter" }'
l402_profanity_filter
10 sats
Profanity Filter
Text profanity analysis and content moderation.
text
Text to analyze
mode
check/censor
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_profanity_filter", "text": "Hello world" }'
l402_mempool_heatmap
30 sats
Mempool Heatmap
ASCII art visualization of the Bitcoin mempool.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_mempool_heatmap" }'
Utility APIs
Cryptographic randomness, time, and developer utilities.
l402_uuid
5 sats
UUID Generator
Generate UUID v7 (time-ordered). Perfect for distributed ID generation.
count
1-10
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_uuid", "count": "1" }'
l402_entropy
5-10 sats
Entropy
Cryptographic random bytes from hardware RNG.
bytes
32-256
format
hex/base64
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_entropy", "bytes": "32" }'
l402_headers
5 sats
Request Echo
Echo back your IP, user agent, headers, and timestamp.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_headers" }'
l402_time
10 sats
Precise Time
High-precision time plus Bitcoin block height and timestamp.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_time" }'
l402_random_sats
50 sats
Random Sats
Pay 50, reveal random 1-80 sats (EV ~40). Entertainment endpoint.
Example
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action": "l402_random_sats" }'
Quick Start: MCP Server
Give your AI agent access to all 25 endpoints. One command, zero API keys.
npx lightning-wallet-mcp
Self-registers on first run. Works with Claude Code, Cursor, and any MCP client.
{
"mcpServers": {
"lightning-wallet": {
"command": "npx",
"args": ["lightning-wallet-mcp"]
}
}
}
Add to ~/.claude/settings.json
Ready to build?
Create an operator account and start calling APIs in minutes.