Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
Aperture is a reverse proxy implementing the L402 protocol, which gates HTTP access to backend services behind Lightning Network micropayments. It handles the full challenge-response flow: issuing macaroons and invoices on first request, then validating payment proofs before proxying to your backend.
Aperture is the reference L402 implementation from Lightning Labs, so it handles the full macaroon-and-invoice challenge flow without requiring custom auth logic in each backend service.
When to use it
- Protecting a REST API so callers pay per request in satoshis
- Hosting paid data endpoints that other agents fetch using lnget
- Testing L402 authentication flows against a local backend
- Setting per-path prices and rate limits on an existing HTTP service
- Running a payment-gated proxy on testnet before mainnet deployment
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: set up a paid endpoint at /api/data that charges 100 satoshis per request
- 1Run install.sh to install the aperture binary via go install
- 2Run setup.sh to generate ~/.aperture/aperture.yaml pointing to the local lnd node
- 3Edit the config to add a service entry for /api/data with price: 100
- 4Run start.sh to launch aperture as a background process
- 5Test with lnget -k --no-pay to confirm the 402 challenge and invoice are returned
Aperture is running on localhost:8081, returning HTTP 402 with a Lightning invoice for any request to /api/data
Requirements
Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.