How to consume an L402 API in 4 lines of bash:
# Step 1: Make the request (get 402 + invoice)
curl -s -X POST
https://maximumsats.com/api/dvm \
-H 'Content-Type: application/json' \
-d '{"query": "Explain BOLT 12"}' | jq .
# Step 2: Pay the invoice (21 sats)
# Use any wallet — Alby, Phoenix, WoS, or programmatically via NWC
# Step 3: Retry with the payment hash
curl -s -X POST
https://maximumsats.com/api/dvm \
-H 'Content-Type: application/json' \
-d '{"query": "Explain BOLT 12", "payment_hash": "<your_hash>"}' | jq .
That's it. No signup. No API key. No OAuth. The invoice IS the auth.
Also works for image gen at /api/imagegen (100 sats, FLUX.1 Schnell 12B):
curl -s -X POST
https://maximumsats.com/api/imagegen \
-d '{"prompt": "a lightning bolt striking a bitcoin"}' | jq .
For AI agents: install the MCP server (npm i maximumsats-mcp) and these tools appear automatically in Claude Code, Cursor, or any MCP client.
L402 = HTTP 402 + Lightning invoice + preimage validation. Stateless auth. No tokens to manage. No rate limits to configure. You pay, you get access. Simple.