Agent Onboarding
Get your AI agent making L402 micropayments in minutes.
Install Lightning Enable MCP
Lightning Enable provides an MCP (Model Context Protocol) server that gives your AI agent a Lightning wallet with L402 payment capabilities.
# Python / pip pip install lightning-enable-mcp # Or configure in your MCP client (Claude Desktop, etc.) { "mcpServers": { "lightning-enable": { "command": "npx", "args": ["-y", "lightning-enable-mcp"] } } }
Fund Your Wallet
Add satoshis to your Lightning Enable wallet. You can fund via Lightning invoice or on-chain Bitcoin.
# Check your wallet balance Use the check_wallet_balance MCP tool # Create a funding invoice Use the create_invoice MCP tool with amount_sats=1000
1,000 sats is enough for hundreds of API calls at 2-5 sats each.
Discover APIs
Use the discover_api tool to find available APIs and their pricing.
# Discover all Agent Commerce Store APIs Use the discover_api MCP tool with url="https://agent-commerce.store/.well-known/l402-manifest.json" # Response includes all endpoints with pricing, descriptions, and example requests
Make Your First API Call
Use the access_l402_resource tool to call any API endpoint. The L402 payment happens automatically.
# Call the Weather Intel API via L402 proxy Use the access_l402_resource MCP tool with: url="https://api.lightningenable.com/l402/proxy/{weather-proxy-id}/forecast?latitude=40.71&longitude=-74.00" # The tool automatically: # 1. Receives 402 Payment Required + Lightning invoice # 2. Pays the invoice (3 sats) # 3. Retries with L402 token # 4. Returns the weather forecast JSON
How L402 Works
L402 is an HTTP-native payment protocol that extends the 402 Payment Required status code:
- Agent sends a request to the L402 proxy endpoint
- Proxy returns
402with aWWW-Authenticateheader containing a Lightning invoice - Agent pays the Lightning invoice (instant, ~2-5 sats)
- Agent retries the request with an
Authorization: L402header - Proxy validates the payment and forwards the request to the API backend
- API returns the response through the proxy to the agent
Resources
- Lightning Enable — L402 payment infrastructure
- Lightning Enable Docs — Full documentation
- L402 Manifest — Machine-readable API catalog
- llms.txt — LLM-readable site description
- OpenAPI / Swagger — Interactive API explorer