A developer running an autonomous research agent with no human in the loop
An AI agent that discovers and pays for APIs on its own
The agent needs live data that sits behind paywalls, but there is nobody to sign up, enter card details, or rotate API keys for it.
The agent finds paid APIs on Nostr, pays per call in satoshis under a hard budget cap, and caches its credentials — fully unattended.
Workflow
- The agent calls l402-search to find APIs by keyword from kind 31402 announcements on Nostr — it needs no URLs in advance.
- It probes a candidate with l402-discover to read pricing and payment rails without spending anything.
- On an HTTP 402 it auto-pays the Lightning invoice from its NWC wallet, bounded by MAX_AUTO_PAY_SATS and a rolling spend window.
- The returned macaroon is cached encrypted on disk and replayed on later calls; for volume it buys a discounted credit bundle.
- Every request can be routed over Tor so the agent's data sources stay unlinkable.
Built with
L402
x402
NWC
kind 31402
Lightning
An indie developer with a useful HTTP API and no billing stack
Turn an existing API into a Lightning toll booth in an afternoon
Stripe means accounts, KYC, chargebacks, and minimum charges that make per-call micropayments impossible.
Any route is gated behind a few satoshis per request, announced for discovery, and observable from an AI client — no user accounts at all.
Workflow
- Wrap the existing Express, Hono, or Workers handler with toll-booth middleware and set per-route pricing.
- Point it at a Lightning backend (Phoenixd, LND, CLN, LNbits, or NWC) and switch on a daily free tier for casual users.
- Call announce once at startup so a signed kind 31402 event publishes the service, pricing, and endpoints to relays.
- The listing appears live on the 402.pub directory and in any agent's l402-search within seconds.
- Attach the toll-booth-mcp read-only to the SQLite ledger and ask an AI client 'how much did I earn this week?' without exposing the database.
Built with
L402
kind 31402
Lightning
Cashu
Someone self-hosting an open model on their own GPU
Sell access to your own LLM, paid per token
They want to rent out spare inference capacity without running a SaaS, holding customer funds, or trusting a payment processor.
Clients stream tokens and pay only for what they consume, with one deposit funding a whole session.
Workflow
- Front the Ollama or vLLM endpoint with toll-booth configured for streaming, metered access.
- Use the Session payment method so a single Lightning deposit opens a balance that debits per request and refunds the remainder on close.
- For an LND-free setup, wire the aperture-phoenixd adapter into Aperture so Phoenixd replaces LND as the Lightning backend.
- Announce the inference service on Nostr so agents and apps can find it by capability and price.
- Settlement is atomic on the Lightning Network — no invoices to reconcile, no custody of customer money.
Built with
L402
IETF Payment
Lightning
BOLT-11
A data provider whose customers are Nostr bots and have no HTTP client
Serve a paid API to clients that only speak Nostr
Some consumers live entirely on Nostr — they have a key and a wallet but no way to make authenticated HTTP calls.
Clients send a Nostr event, pay an invoice, and get results back as a Nostr event — the bridge never touches their funds.
Workflow
- Run toll-booth-dvm in front of the existing toll-booth-gated API as a NIP-90 Data Vending Machine.
- A client publishes a kind 5800 job request with the method, path, and a bid cap.
- The DVM proxies upstream, gets a 402, and replies with a kind 7000 'payment-required' event carrying the bolt11 invoice.
- The client pays; the DVM polls for settlement, retries with the L402 credential, and returns the result as a kind 6800 event.
- Funds flow peer to peer over Lightning — the DVM only relays invoice strings and discards them after settlement.
Built with
NIP-90
L402
kind 5800/6800/7000
Lightning
An operator in a hostile jurisdiction or fighting payment-rail censorship
Run a paid API no single party can deplatform
Card networks and cloud billing can freeze an account on a complaint; a clearnet-only endpoint can be blocked.
The service is reachable over Tor, paid in sats, and discoverable without any central registry that can be pressured.
Workflow
- Host toll-booth behind both a clearnet URL and a Tor hidden service; the same macaroon validates on either.
- Announce both URLs in a single kind 31402 event so clients can choose their transport.
- 402-mcp already defaults to onion-first transport, so with a Tor proxy it pays and fetches over the onion URL before trying clearnet.
- Because discovery is a self-signed Nostr event, no domain registrar or app store sits in the path to revoke.
- Go-native shops can run the same pattern with Aperture and aperture-announce instead of the TypeScript stack.
Built with
L402
Tor
kind 31402
Lightning
An ecosystem builder mapping every Lightning-paid API
Bootstrap a live directory of the machine-payable web
Paid APIs are scattered across GitHub, npm, and relays with no canonical list, so agents can't find what exists.
A continuously refreshed, trust-tiered directory that any human or agent can browse or query — with no backend to run.
Workflow
- Run 402-indexer to crawl GitHub and npm for L402/x402 code, probe live endpoints, and aggregate existing relay events.
- It republishes each discovered service as a signed kind 31402 event tagged with source, verified time, and health status.
- 402.pub streams those events straight from relays over WebSocket and renders a filterable directory -- with no backend of its own.
- Stale services are dimmed and, after 30 days unreachable, retired with a NIP-09 deletion.
- When an operator self-announces, the indexer steps back and deletes its own copy so the authoritative listing wins.
Built with
kind 31402
NIP-09
Lightning
An operator of a fleet of specialised agents that need to delegate
Let one AI agent hire another and pay on completion
A generalist agent hits a task it can't do well and has no safe way to find, vet, and pay a specialist agent.
Agents advertise capabilities, dispatch work to each other, settle in sats, and check trust before committing.
Workflow
- Specialist agents publish their capabilities with bray's dispatch tools so others can discover them via NIP-89.
- The hiring agent checks the specialist's Signet verification tier and trust score before sending work.
- It sends an encrypted dispatch request describing the task and an agreed price.
- The specialist exposes its paid output as a toll-booth-DVM job, so payment and delivery happen atomically over Nostr.
- On success, the hiring agent acknowledges the job; both can leave portable attestations that feed future trust decisions.
Built with
NIP-89
NIP-17
NIP-90
kind 31000
Lightning