{
  "name": "L402 Fortune Cookie API ⚡🥠",
  "version": "1.1.0",
  "endpoints": {
    "GET /api/fortune": "Get a fortune for 1 sat (L402 protected)",
    "GET /api/fortune/free": "Get a free fortune (no payment)",
    "GET /api/fortune/status/:payment_hash": "Check whether an invoice has been paid"
  },
  "l402_flow": [
    "1. GET /api/fortune → 402 + WWW-Authenticate header with invoice",
    "2. Pay the Lightning invoice → get preimage",
    "3. Poll GET /api/fortune/status/:payment_hash until paid=true",
    "4. GET /api/fortune with Authorization: L402 <macaroon>:<preimage>",
    "5. Enjoy your fortune 🎉"
  ]
}