Skip to main content

Agentic Commerce

Producer Account Required (free options available)

Creating L402-protected API endpoints requires a Lightning Enable producer account. Start free with the Free Producer Sandbox (3 endpoints, 200 challenges/month, 1,000 sats max per challenge, 1 proxy — no card), or activate a 30-day Agentic Commerce trial by paying a ~100-sat L402 challenge — no card. Full production use is Agentic Commerce ($49/month) or Business (contact us). Using the MCP server to access L402 APIs is completely free — no account needed. View pricing

L402 enables pay-per-request API monetization using the Lightning Network. Your callers pay a Lightning invoice to access your API: no accounts, no subscriptions, no credit cards.

Pick a payment provider

Strike (recommended): create a Strike account and generate an API key. Strike returns preimages, which L402 needs.

OpenNode: use a production key (KYB takes 2-4 business days).

Nostr Wallet Connect: receive straight into your own Lightning wallet.

Strike Setup → | OpenNode Setup → | NWC Setup →

Zero Infrastructure Required​

Unlike other L402 implementations, Lightning Enable is a fully hosted SaaS:

  • No Lightning node — your payment provider (Strike or OpenNode) handles payment routing and liquidity
  • No liquidity management — no channel balancing, no inbound capacity planning
  • No custom servers to run — no Docker, no Kubernetes; we host the L402 protocol layer for you
  • No protocol expertise — configure via dashboard in minutes

What you need:

  1. A Lightning Enable producer account — the free Producer Sandbox or no-card L402 Fast Lane trial, or an Agentic Commerce ($49/month) / Business (contact us) subscription
  2. A payment provider — Strike (recommended), OpenNode, or an NWC wallet
  3. 5 minutes to configure your first proxy in the dashboard

What is L402?​

L402 (formerly LSAT) combines:

  • HTTP 402 Payment Required - The web's native payment status code
  • Lightning Network - Instant Bitcoin micropayments
  • Macaroons - Cryptographic bearer tokens with permissions

The Problem​

Traditional API monetization requires:

  • User accounts and passwords
  • Credit cards on file
  • Monthly subscriptions (even for light usage)
  • Complex billing infrastructure
  • Fraud prevention systems

The Solution​

With L402:

  • No accounts - Pay and access immediately
  • No credit cards - Bitcoin only
  • Pay-per-use - Only pay for what you consume
  • Instant access - Payment confirms in ~1 second
  • Global - Anyone with Bitcoin can access

How It Works​

1. Client requests API                    2. Server returns 402
─────────────────────────────> <─────────────────────
GET /api/premium/data HTTP 402 Payment Required
Invoice: lnbc100n1p...
Macaroon: AgEL...

3. Client pays invoice 4. Client retries with proof
─────────────────────> ─────────────────────────>
Via Lightning wallet Authorization: L402 mac:preimage
(~1 second)
5. Server verifies, grants access
<─────────────────────────
HTTP 200 OK
{ "data": "..." }

Key Benefits​

Traditional APIL402 API
Account requiredNo account needed
Credit card on fileNo payment method stored
Monthly subscriptionPay per request
Minimum $5–$20 chargeAs low as 1 sat (~$0.0004)
Chargeback riskImpossible to reverse
KYC for usersPermissionless access

Agent-to-Agent Commerce (Producer API)​

New: Agents That Earn

With the L402 Producer API, your AI agents can charge for their services — not just pay for others'. Your agent creates L402 payment challenges, other agents pay them, and your agent verifies payment before granting access. This is the missing piece for true agentic commerce.

One producer MCP tool, l402_producer, action-based:

  • action="create" — Create a 402 challenge with Lightning invoice + macaroon
  • action="verify" — Verify an L402 token to confirm payment before granting access
  • Plus action="configure_receive", "status", "create_proxy", "add_endpoint", "publish", and "list_challenges" — enough to take an API from unconfigured to live and discoverable without the dashboard. See Sell With Your Agent for the walkthrough.

Beyond this, the MCP server also ships the agent-to-agent marketplace (agent_services) tool, create_lightning_enable_account (self-serve signup over Lightning), and renew_lightning_enable_subscription (pay for Agentic Commerce in sats, MCP 2.1.0 or later) — see the MCP Complete Guide for the full tool list.

Read the full L402 Producer API guide

Use Cases​

  • API monetization — charge per call, with a different price per endpoint (for example 100 sats for a transcription, 1,000 for an image).
  • Premium content — unlock articles, reports, or media per request.
  • Data APIs — pay-per-query market or analytics data.
  • Proxy monetization — put a paywall in front of any HTTP API, with no code changes. See Proxy Configuration.

Quick Example​

Request Without Payment​

curl https://api.yourservice.com/api/premium/data

Response: 402 Payment Required

{
"error": "Payment Required",
"l402": {
"macaroon": "AgELbGlnaHRuaW5nLWVuYWJsZQ...",
"invoice": "lnbc100n1p3...",
"amount_sats": 100,
"payment_hash": "abc123..."
}
}

Pay the Invoice​

Use any Lightning wallet (Phoenix, Muun, Zeus, etc.) to pay. Get the preimage.

Request With Payment Proof​

curl https://api.yourservice.com/api/premium/data \
-H "Authorization: L402 AgELbGlnaHRuaW5nLWVuYWJsZQ...:abc123def456..."

Response: 200 OK

{
"data": "Premium content here..."
}

Pricing​

Agentic Commerce: $49/month | Agentic Commerce — Business: Contact us

Agentic Commerce includes:

  • Unlimited L402 endpoints
  • Strike as settlement provider
  • Per-endpoint pricing
  • Live dashboard + per-request payment feed

Agentic Commerce — Business includes everything in Agentic Commerce, plus:

  • White-glove onboarding
  • Direct founder access (no ticket queues)

Not sure where to start? The Free Producer Sandbox (3 endpoints, 200 challenges/month, 1,000 sats max per challenge, no card) is the risk-free way to prove L402 works before you subscribe.

Lightning Enable charges no per-transaction fees. Your payment provider may charge its own processing fees; check its fee schedule.

Architecture​

Lightning Enable handles the complexity:

+-----------------+
| Your API |
| (Protected) |
+--------+--------+
|
v
+--------+--------+ +------------------+ +-----------------+
| L402 Middleware |----->| Lightning Enable |----->| Strike/OpenNode |
| (Auth Check) | | (Invoice/Verify) | | (Payment) |
+-----------------+ +------------------+ +-----------------+
|
| If valid L402 credential
v
+-----------------+
| Your API Logic |
| (Execute) |
+-----------------+
Hosted Service

Lightning Enable runs as a hosted service at api.lightningenable.com. You configure it via the dashboard or REST API — you don't deploy or manage it.

Getting Started​

  1. Get a producer account — start free with the Producer Sandbox or the ~100-sat L402 Fast Lane trial, or subscribe to Agentic Commerce ($49/month) / Business (contact us)
  2. Set up a payment provider:
    • Strike (recommended): Create account → generate API key → ready immediately
    • OpenNode: complete KYB (2-4 business days) and generate a production key
    • NWC: create a connection in your wallet app
  3. Log in to the dashboard — enter your email for a magic link, open it, then type the same email to confirm
  4. Add your provider credential in Dashboard → Settings → Payment Provider
  5. Create your first proxy — point it at any API you want to monetize, or add the native middleware to your app
  6. Test a payment — verify your integration end to end

Next Steps​

Resources​