402.pub

The open marketplace for Lightning-paid APIs. Discover services on Nostr. Pay with sats.

0 services
0 rails
0 relays
Monetise Your API

Gate any API behind Lightning in 5 lines

  • toll-booth — L402 paywall middleware for Express, Hono, or any HTTP framework
  • 402-announce — publish your service on Nostr for decentralised discovery
  • toll-booth-announce — one-line bridge from your toll-booth config to Nostr
npm i @thecryptodonkey/toll-booth
Build an Agent

Give your agent a wallet. It handles the rest.

  • Discovers paid APIs on Nostr via kind 31402 — no hardcoded URLs
  • Pays with Lightning (NWC) or Cashu — autonomous, no human approval needed
  • Caches credentials and tracks spend with configurable safety limits
npx 402-mcp
0 services 0 relays
Connecting to relays...

Announce Your Own API

Get your API listed here. Announce it on Nostr in 10 lines of code.

import { announceService } from '402-announce'

await announceService({
  secretKey: process.env.NOSTR_SK,
  relays: ['wss://relay.damus.io'],
  identifier: 'my-api',
  name: 'My Paid API',
  url: 'https://api.example.com',
  about: 'Pay-per-request API with Lightning',
  pricing: [{ capability: 'query', price: 10, currency: 'sats' }],
  paymentMethods: ['bitcoin-lightning-bolt11'],
})