Live on Bitcoin mainnet

Agents should only pay when the API delivers.

Pay-on-delivery for L402. The agent's payment is held, not taken. If the paid call succeeds, it settles. If it fails, the sats go back to the agent automatically. No custodian, no refund requests.

Watch the 30-Second Demo Try It Live
40 of 40
Failed Calls Refunded
~0.65s
Added to a Paid Call
Mainnet
Real Lightning Payments
No Custodian
Funds Never Held by a Third Party

How pay-on-delivery works.

Built on L402 and Lightning hold invoices. The agent uses a normal L402 client. The seller's server settles or refunds based on one thing: whether the API delivered.

01

The agent pays the invoice

The API answers with HTTP 402 and a Lightning invoice. The agent pays it like any other L402 call. No accounts, no API keys.

02

The payment is held, not taken

The seller's Lightning node holds the payment while the API does the work. Nothing has settled yet, and nobody else holds the funds.

03

Delivered, or refunded

If the call succeeds, the payment settles and the agent gets its result plus a receipt it can verify. If the call fails or runs out of time, the payment is canceled and the sats return to the agent within seconds.

See it on mainnet.

One paid call succeeds and is charged. One fails, and the agent's sats come back automatically. Real Lightning payments, recorded November 3, 2026.

27 seconds. Agent paying a 10-sat L402 API from a standard Lightning wallet.

Try it yourself.

A live pay-on-delivery API running on my own Lightning node. Each call costs 10 sats. Use any Lightning wallet and a terminal.

/demo/ok

The API works. Your payment settles and you get the result plus a receipt you can check.

/demo/fail

The API fails on purpose. Your payment is canceled and the sats go back to your wallet. You are not charged.

1. Ask for the API

The server answers with HTTP 402, a 10‑sat Lightning invoice (payment_request) and a token (macaroon).

curl -s https://pod.btcaioracle.com/demo/ok

Use /demo/fail instead to see a refund.

2. Pay the invoice

Pay the payment_request from any Lightning wallet within 2 minutes. On /demo/ok the payment completes and your wallet shows a preimage. On /demo/fail your wallet briefly holds the sats, then reports the payment as failed (often incorrect_or_unknown_payment_details). That is the refund: nothing is charged.

3. Get your result, or check your refund

After a successful payment, retry with the token and the preimage:

curl -s -H "Authorization: L402 MACAROON:PREIMAGE" https://pod.btcaioracle.com/demo/ok

To check any call, including a refund, use the token alone:

curl -s -H "Authorization: L402 MACAROON" https://pod.btcaioracle.com/status

Replace MACAROON and PREIMAGE with your own values. Limited to a few open invoices per visitor.

Tested on the real network.

Live tests on Bitcoin mainnet from my own Lightning node, October 2026. Every payment was real.

40 / 40
Failed or too-slow paid calls refunded automatically. Nothing charged.
20 / 20
Successful paid calls settled and returned the result.
~0.65s
Added to a successful call compared with an ordinary invoice, using a standard Lightning wallet.
Same day
Testing with Lightning Labs' Wavelength agent wallet found a bug in how it handled canceled payments. Lightning Labs fixed it the same day.

The Route.

A weekly newsletter covering Bitcoin, Lightning, and the emerging agent economy. Honest perspective from someone building in the middle of it. No hype. No noise.

Read The Route →
The Route Newsletter

Why this exists.

I found Bitcoin the way most people do, curiosity first, then conviction. The deeper I went, the more I saw something that matched what I already believed. Honest money. A ledger nobody can quietly edit. A system that does not require you to trust the person running it. That is not just a financial idea. It is a moral one.

When AI agents started paying for APIs over Lightning, I saw a gap. An agent can pay in seconds, but if the service fails after taking payment, the money is simply gone. People have refunds and chargebacks. Agents have nothing.

Pay-on-delivery closes that gap with what Lightning already does well. The payment is held until the work is done, and it only settles if the agent got what it paid for. No custodian and no trust required, just the network doing what it was built to do.

Forest Elander, Founder

Let's talk.

Connect directly

Building in public on X. Following the Lightning and AI agent space closely. Always open to genuine conversations about what I'm building.