bolthub Documentation
Monetize any API with Lightning micropayments using the L402 protocol.
Welcome to bolthub
bolthub is a non-custodial payment gateway. It puts any HTTP API behind Lightning Network micropayments using the L402 protocol. Clients pay per request in sats. No API keys, no accounts, no signup.
For API consumers
- MCP Registry: one config, every API; the recommended way to connect AI agents
- MCP Bridge: connect an AI agent to a specific paywalled API via MCP
- CLI: search, explore, and call APIs from the terminal
- Using Paywalled APIs: step-by-step guide to calling L402-gated endpoints
- Wallet Setup: choose and configure a Lightning wallet
- TypeScript SDK:
@bolthub/agentfor automated L402 payments - Python SDK:
bolthubpip package
For API providers
- Publishing Your API: make your API discoverable
- Directory API: JSON discovery API (powers the API Hub)
- Security: how bolthub protects your data and credentials
Key concepts
| Concept | Description |
|---|---|
| L402 | HTTP 402 Payment Required + Lightning invoice + macaroon-based auth |
| Non-custodial | Payments flow directly to the provider's wallet; bolthub never holds funds. Consumers can pay with any Lightning wallet. |
| Gateway | Reverse proxy at {slug}.gw.bolthub.ai that handles payment verification |
| Pricing models | per_request, per_kb, token_bucket, time_pass, metered |