L402 Proof Replay Generator

Generate paid retry templates for flaky L402 endpoints — 7 sats

About

Generate robust retry plans for paid L402 endpoints. Returns query/header/auth variants plus copy-paste curl commands so you can confirm which auth shape the target accepts.

Fast path: request invoice, pay, then rerun with payment_hash.

Try It

7 sats via L402.

3-step flow: request invoice, pay it, then click generate again with payment_hash.
'; } html+='

Accepted payment_hash locations: body, query string, X-Payment-Hash, Authorization header.

'; res.innerHTML=html; }else if(r.ok){ var order=(d.replay_order||[]).join(' -> '); res.innerHTML=(order?'

Try order: '+escapeHtml(order)+'

':'')+'
'+escapeHtml(JSON.stringify(d,null,2))+'
'; }else{ res.innerHTML='

Error: '+(d.error||r.status)+'

'+(d.detail?escapeHtml(String(d.detail)):'')+'
'; } res.style.display='block'; }catch(e){res.innerHTML='

Network error

';res.style.display='block'} btn.disabled=false;btn.textContent='Generate replay plan'; })()">Generate replay plan

API Usage

# 1) Request invoice + payment_hash
REQ=$(curl -sS -X POST https://maximumsats.com/api/proof-replay \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/api/paid","method":"POST","headers":{"Content-Type":"application/json"},"body":{"prompt":"hello"}}')
echo "$REQ" | jq .
PAYMENT_HASH=$(echo "$REQ" | jq -r '.payment_hash')

# 2) Pay invoice, then retry with payment_hash
curl -X POST "https://maximumsats.com/api/proof-replay?payment_hash=${PAYMENT_HASH}" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/api/paid","method":"POST","headers":{"Content-Type":"application/json"},"body":{"prompt":"hello"}}'

Sample Response

{
  "status": "payment_required",
  "price_sats": 7,
  "payment_request": "lnbc...",
  "payment_hash": "<hash>"
}
# after payment:
{
  "ok": true,
  "payment_hash": "<hash>",
  "replay_order": [
    "query_payment_hash",
    "x_payment_hash_header",
    "authorization_l402_hash",
    "authorization_l402_macaroon_proof"
  ],
  "variants": [
    {
      "name": "query_payment_hash",
      "curl": "curl -X POST 'https://example.com/api/paid?payment_hash=<hash>' ..."
    }
  ]
}
Also available via MCP as proof_replay_generate at maximumsats.com/mcp. Quickstart: /blog/l402-proof-replay-quickstart