
Lnget
Download files with automatic Lightning micropayment handling via L402
What You Can Do
Use lnget to fetch files and data from HTTP endpoints that require L402 Lightning micropayments. The tool automatically detects payment requirements (HTTP 402 responses), processes Lightning payments through your connected LND node, and retries requests—all without manual intervention. You can preview costs before paying, manage authentication tokens, and output results in machine-readable JSON or raw format.
Features
detects HTTP 402 challenges and pays Lightning invoices automatically
preview payment amounts and costs before executing transactions
JSON metadata, raw body content, or piped responses for scripting
list, inspect, and clear cached authentication tokens per domain
supports both LND (macaroon auth) and LNC (pairing phrase) connections
set maximum payment limits to prevent unexpected charges
use via command line or as Claude's Machine Control Protocol tool
check Lightning node status and review command schemas
Example Output
$ lnget --json --print-body https://api.example.com/data.json
{
"status": 200,
"headers": {"content-type": "application/json"},
"body": {"data": "fetched content"},
"payment": {"amount_sat": 250, "status": "paid"}
}
$ lnget tokens list --json
[{"domain": "api.example.com", "amount_sat": 500}, {"domain": "data.provider.io", "amount_sat": 1000}]
$ lnget --dry-run https://paid-endpoint.example.com
{"estimated_cost_sat": 150, "preview": true}
What's Included
- SKILL.md: Complete lnget reference guide with CLI commands and usage patterns
- Quick Reference Cheat Sheet: Essential flags and common command patterns for HTTP downloads and token management
- L402 Payment Workflow Examples: Copy-paste command templates for automatic payment handling
- Lightning Backend Setup Guide: Configuration instructions for LND macaroon and LNC pairing authentication
- Schema Introspection Toolkit: Commands to explore available parameters and verify Lightning node connectivity
Who It's For
- API developers and data engineers integrating L402-protected endpoints
- DevOps engineers automating downloads from paid content sources
- Bitcoin/Lightning developers building payment-integrated workflows
- Research teams accessing paid datasets with micropayment billing
- SREs managing infrastructure that consumes metered API services
Best For
- Fetching data from L402-protected APIs and endpoints
- Automating file downloads with embedded micropayment handling
- Previewing payment costs before executing transactions
- Managing and rotating Lightning authentication tokens
- Building agent-driven workflows that handle paid content access







