Discover, verify, and pay for Lightning-gated APIs Services: - Endpoints: - Verified: - Live: -

Service Directory

Service Status Price Categories Trust

Loading services...

🚀 Try It Live

L402

First Channel Suggestion FREE

Where should you open your first Lightning channel? L402-reachability-aware recommendations from our graph node.

optional
Hyperdope

Unlock a Video 10 sats

Experience the L402 protocol end-to-end: hit a real endpoint, see the 402 challenge, pay 10 sats, and watch a video on Hyperdope.

Using L402 Services

Every L402 service follows the same pattern. No accounts, no API keys — just a Lightning payment.

🤖 Using an Agent?

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.

How It Works (Step-by-Step)
1

Request the Resource

Hit the endpoint. If payment is required, you get HTTP 402 with a WWW-Authenticate header.

2

Parse the Challenge

Extract the macaroon (base64) and invoice (bolt11) from the header.

3

Pay the Invoice

Pay via Lightning. Your wallet returns a preimage (hex).

4

Send the Token

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.

List Your Lightning-Gated API

🤖 Using an Agent?

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.

Manual Submission (Step-by-Step)
1

Build Your JSON

Check GET /api/schema for the listing format. Include your endpoints, pricing, and health URL.

2

POST /api/submit

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.

3

Pay the Invoice

Pay via Lightning. Get the preimage back from your wallet.

4

Re-POST with Token

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... }'
Claim a Discovered Listing

If your service was listed by the community (marked as "discovered"), you can prove domain ownership to claim management access — free, no payment required.

1

Initiate Claim

POST /api/claim/{service_id} — returns a challenge_hash and verification_url.

2

Place Verification File

Put the challenge_hash as plain text at https://{your-domain}/.well-known/l402-directory-verify.txt

3

Verify

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

API Reference

🤖 Using an Agent?

Ask your agent to fetch the full protocol spec and endpoint reference from GET /api at https://l402.directory. It's all JSON.

Endpoint Reference (for Human Developers)
FREE GET /api/services
Browse all active listings. Params: ?category=video, ?status=live, ?format=minimal
FREE GET /api/services/:id
Single listing detail with full health history.
FREE GET /api/schema
Returns the JSON schema for valid submissions. Agents use this to build listings.
FREE GET /api/health
Directory health: total services, live count, listing fee.
1,000 SATS POST /api/submit
L402-gated. Pay 1,000 sats once — listed forever. Without auth: validates & returns 402 + invoice. With valid L402: creates listing, returns service_id + management key.
MGMT KEY PUT /api/services/:id
Update mutable fields (name, description, contact, docs_url, categories). Requires Authorization: Bearer {preimage}.
FREE POST /api/claim/:id
Initiate domain claim for a discovered listing. Returns challenge_hash and verification_url. Place the hash at the URL on your domain.
FREE POST /api/claim/:id/verify
Complete domain claim. Directory fetches your .well-known file and verifies the challenge hash. Returns management_key on success.
10 SATS GET /api/report/:id
Detailed health report: uptime %, probe history, response times, incidents. L402-gated.