How to Monetize Any API in 5 Minutes with Lightning Micropayments
The problem with monetizing APIs
You've built a useful API. Maybe it serves weather data, financial quotes, or AI inference results. You want to charge for it, but the options aren't great:
- •Stripe integration takes days of development, requires account management, and has a $0.50 minimum per transaction, which is too high for per-query pricing.
- •API marketplace platforms often take significant revenue share and require you to use their ecosystem for billing and distribution.
- •Building it yourself means writing auth, billing, subscription management, and payment handling from scratch.
What if you could monetize your API in 5 minutes with zero code changes?
Step 1: Create your bolthub account
Sign up at bolthub.ai/signup. You need an email address and a Lightning wallet. If you don't have a node yet, use the built-in Node Launcher to deploy your own LND node in minutes (from ~$4.50/month). More advanced users can connect their existing node (LND, LNbits) or any NWC-compatible wallet (Alby Hub, CoinOS, and others).
No credit card. No identity verification. You're ready in under a minute.
Step 2: Connect your wallet
In the dashboard, click "Connect Wallet" and choose your wallet provider. bolthub creates invoices on your behalf but never has access to your funds. Your keys, your coins.
Step 3: Add your API endpoint
Enter your API's origin URL (e.g., https://api.yourservice.com/v1/data). bolthub verifies connectivity and sets up an L402 gateway proxy in front of it.
Your API doesn't need any modifications. bolthub handles the 402 challenge, invoice creation, and payment verification transparently.
Step 4: Set your pricing
Choose from five pricing models:
- •Per request: Fixed sats per API call (e.g., 10 sats/query)
- •Token bucket: Sell N requests upfront (e.g., 50 calls for 500 sats)
- •Time pass: Unlimited access for a duration (e.g., 60 min for 1,000 sats)
- •Metered: Prepaid balance, deducted per use
- •Per KB: Price based on response size
Step 5: Share your gateway URL
Your API is now available at https://your-slug.gw.bolthub.ai/v1/data. Share this URL with clients. When they request data:
- They receive a 402 response with a Lightning invoice
- They pay (manually or via an L402-aware client library)
- They retry and get their data
That's it. Five minutes, zero code changes, instant revenue.
What about your clients?
We provide client libraries for TypeScript and Python that handle the 402 flow automatically:
from bolthub import L402Client, LndWallet
wallet = LndWallet(host="https://your-node:8080", macaroon="...")client = L402Client(wallet, budget_sats=10_000)resp = client.get("https://your-slug.gw.bolthub.ai/v1/data")print(resp.json())Your clients don't need a bolthub account. They just need a Lightning wallet.