Lampo

Give your AI agent a Lightning wallet

An autonomous agent can't open an account or type a card number, and sharing your API key with it is risky. A Lightning wallet with a spending limit lets it buy exactly the compute it needs, and nothing more.

How it works

  1. The agent sends a normal OpenAI-style request.
  2. Lampo answers 402 Payment Required with a Lightning invoice for a bundle of tokens.
  3. The agent's wallet pays it, if it is within the limits you set, and retries with the proof of payment.
  4. The answer streams back. The same credential keeps working until the bundle is used up.

Option A: pi402 (Pi coding agent)

pi402 has a built-in wallet and two limits: PI402_MAX_SAT_PER_REQUEST (per payment; the default is 1,000 sats, enough for the DeepSeek V4 Flash bundle) and PI402_DAILY_CAP_SAT (per day).

Option B: any agent, with Alby's tools

Create a Nostr Wallet Connect connection with a budget in your wallet. The budget is the agent's hard limit. Then use Alby's CLI (fetch with --max-amount) or its MCP server (fetch_l402).

Safety tips

Live prices: lampo.run shows every model and bundle, updated every 10 minutes. The cheapest bundle is 1,000 sats (about $0.60) for about 2.5 million tokens of DeepSeek V4 Flash.
See models and prices