SatBotly

pay 21 test sats for an api call

this is a real HTTP 402 paywall with fake money. one click mints 21 test sats from testnut, sends them in an X-Cashu header, and shows every request on the way. no wallet, no signup, nothing to install.

test sats only. testnut is a fake-wallet mint. no real bitcoin moves. never send real sats to a test mint.
NUT-24 · HTTP 402 · testnut fake wallet

waiting for a click

request log
waiting for a click
receipt
no receipt yet

now do it for real

the sandbox stops at test sats. this is the same flow with money you would actually miss if it went wrong.

  1. 1get a wallet

    software that holds Cashu ecash, on your phone or in your terminal.

    cashu.me · Minibits · Numo (repo) · bitchat

  2. 2pick a mint you trust

    the mint holds the bitcoin behind your ecash, so you are trusting the operator. read the custody notes before you deposit anything.

    the mints we checked, with custody notes. small amounts only.

  3. 3add NUT-24 to your own API

    put a 402 in front of a route and accept an X-Cashu token. these are libraries, not hosted services.

    express-cashu · xcashu · toll-booth

custody warning. Every Cashu mint is custodial: the operator can lose, freeze or shut down the bitcoin behind your ecash. Use small amounts only.

testnut is for testing only, never send real sats to it.

sketch only
// sketch, not tested here. see the libraries above for their real APIs.
app.get('/paid', async (req, res) => {
  const token = req.header('X-Cashu')
  if (!token) return res.status(402).set('X-Cashu', paymentRequest).json({ error: 'payment_required' })
  if (!await redeemAtYourMint(token)) return res.status(400).json({ error: 'bad_token' })
  res.json({ ok: true })
})