L402 API Catalog › Premium Services
Memory Bank L402 API
Persistent key-value storage for AI agents across sessions.
5-50 sats per call, paid over the Lightning Network. No API key and no signup: the request returns 402 Payment Required, the caller pays the invoice, and retries with the proof of payment.
l402_memory
5-50 sats
Parameters
agent_id Required integer
mode store/retrieve/query/delete/list
key Storage key
value Value (store mode)
Call it with curl
The first call answers 402 with a Lightning invoice in the WWW-Authenticate header. Pay it from any Lightning wallet, then repeat the call with the L402 token and preimage.
curl -X POST https://lightningfaucet.com/api/ \
-H "Content-Type: application/json" \
-H "Authorization: L402 $MACAROON:$PREIMAGE" \
-d '{"action":"l402_memory","agent_id":42,"mode":"store","key":"last_run","value":"2026-08-23T18:00:00Z"}'
Call it from an AI agent
With lightning-wallet-mcp the payment is handled for you. From the CLI:
lw pay-api "https://lightningfaucet.com/api/l402/memory?agent_id=42&mode=store&key=last_run&value=2026-08-23T18%3A00%3A00Z"
In Claude Code, Cursor or any MCP host, ask the agent to call pay_l402_api with that URL. The fee is 1% of the price, rounded down, so calls under 100 sats carry no platform fee.
All Premium Services endpoints · How L402 authentication works · List your own API on the gateway