Where should you open your first Lightning channel? L402-reachability-aware recommendations from our graph node.
Experience the L402 protocol end-to-end: hit a real endpoint, see the 402 challenge, pay 10 sats, and watch a video on Hyperdope.
Every L402 service follows the same pattern. No accounts, no API keys — just a Lightning payment.
You can use natural language to ask agents with Bitcoin Lightning wallets to discover and use services on https://l402.directory. They'll handle the payment and protocol automatically.
Hit the endpoint. If payment is required, you get HTTP 402 with a WWW-Authenticate header.
Extract the macaroon (base64) and invoice (bolt11) from the header.
Pay via Lightning. Your wallet returns a preimage (hex).
Re-request with header: Authorization: L402 {macaroon}:{preimage}
# 1. Request a protected resource
curl -s -D - https://example.com/api/resource
# Response:
# HTTP/1.1 402 Payment Required
# WWW-Authenticate: L402 macaroon="AgE...", invoice="lnbc100n1..."
# 2. Pay the invoice, get preimage: a1b2c3...
# 3. Re-request with the L402 token
curl -s https://example.com/api/resource \
-H "Authorization: L402 AgE...:a1b2c3..."
Developer resources: GET /api/services to browse all listings. GET /api for the full protocol spec and quickstart.
The easiest path— point your agent at https://l402.directory and ask it to list your service.
⚠️ Save the preimage—it's your management key to update or renew your listing later.
Check GET /api/schema for the listing format. Include your endpoints, pricing, and health URL.
Submit your listing JSON. Server validates it and returns a 402 with a 1,000-sat Lightning invoice. Pay once — your service is listed forever.
Pay via Lightning. Get the preimage back from your wallet.
Send the same JSON with the L402 token. Your service goes live instantly. Save the preimage — that's your management key.
# Step 1: Submit listing (get 402 + invoice)
curl -X POST https://l402.directory/api/submit \
-H "Content-Type: application/json" \
-d '{
"name": "My API",
"description": "Lightning-gated data service",
"endpoints": [{
"url": "https://api.example.com/v1/data",
"method": "GET",
"pricing": {"amount": 100, "currency": "sats", "model": "per-request"}
}],
"health_url": "https://api.example.com/health",
"categories": ["data"]
}'
# Step 2: Pay the invoice, get preimage
# Step 3: Re-POST with L402 token
curl -X POST https://l402.directory/api/submit \
-H "Content-Type: application/json" \
-H "Authorization: L402 <macaroon>:<preimage>" \
-d '{ ...same JSON... }'
If your service was listed by the community (marked as "discovered"), you can prove domain ownership to claim management access — free, no payment required.
POST /api/claim/{service_id} — returns a challenge_hash and verification_url.
Put the challenge_hash as plain text at https://{your-domain}/.well-known/l402-directory-verify.txt
POST /api/claim/{service_id}/verify — directory fetches the file and confirms the hash. Save the management_key you receive.
# Step 1: Initiate claim
curl -X POST https://l402.directory/api/claim/{service_id}
# Step 2: Place challenge hash at your domain
echo "abc123..." > .well-known/l402-directory-verify.txt
# Step 3: Verify
curl -X POST https://l402.directory/api/claim/{service_id}/verify
Ask your agent to fetch the full protocol spec and endpoint reference from GET /api at https://l402.directory. It's all JSON.
?category=video, ?status=live, ?format=minimalAuthorization: Bearer {preimage}.