- Home
- Skills
- APIs & Backend
- agent to merchant l402 payment
agent to merchant l402 payment
Pay an Aperture-style 402 challenge and fetch the resource.
$9
agent to merchant l402 payment
Example session with this skill installed
Pay the gated merchant endpoint at http://localhost:8081/protected and show me the status.
- Read your context and instructions
- Compiled the agent to merchant
I have initiated the L402 payment flow using the agent-bitcoin SDK. The challenge was successfully negotiated with the local LND node, the invoice was paid, and the protected resource has been retrieved.
L402 Payment Result
| Field | Value |
|---|---|
| Target URL | http://localhost:8081/protected |
| Status Code | 200 |
| Payment Status | Paid |
| Network | Regtest |
| Resource Preview | {"data": "This is a premium resource accessible via L402."} |
Next steps
- Verify the retrieved data in your local environment.
- To use this on Mainnet, explicitly set the
AGENT_BITCOIN_ALLOW_MAINNET=1environment variable. - Configure
AGENT_BITCOIN_ALLOW_AUTOPAY=1if you want future payments to proceed without manual confirmation.
Connects securely to your tools. The creator never sees your data.
About this skill
Handling 402 Payment Required status codes often stalls automated agents that lack a native way to negotiate Lightning Network payments. This skill enables an agent to detect L402-gated endpoints, pay the requested invoice using the Lightning Network, and retrieve the protected resource.
What it does
- L402 negotiation automatically handles the HTTP 402 challenge-response flow.
- Lightning payments pays BOLT11 invoices via an unlocked LND node to satisfy the gate.
- Resource retrieval fetches the content from the merchant endpoint after successful payment.
- State reporting provides clear feedback on the HTTP status code and payment confirmation.
- Safety controls enforces strict opt-in for mainnet spends and automated payments.
How it works
- Identify target the user provides a URL that requires an L402 payment.
- Environment setup the agent ensures the
agent-bitcoinSDK is installed and the LND node is reachable. - Execute payment the
L402Clientfetches the URL, intercepts the 402 error, and pays the invoice. - Deliver resource the agent returns the final status and the content of the paid resource.
Frameworks & tools
Python 3.10+, agent-bitcoin SDK, LND (Lightning Network Daemon), and Aperture-style merchant gateways.
Why this beats prompting it yourself
Standard prompts cannot handle the multi-step cryptographic handshake and wallet interaction required for L402. This skill provides the specific logic needed to bridge the gap between HTTP requests and Lightning wallet RPCs.
Use cases
- Access paid API endpoints that charge per-request via Lightning.
- Download gated documentation or datasets from L402-enabled merchants.
- Automate micro-payments for agent-to-agent service consumption.
Known limitations
Requires a locally accessible, unlocked LND node. Defaulted to Regtest; Mainnet and Autopay require explicit user permission.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 11 days ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.