Built a Bitcoin intelligence tool for LangChain agents — pays its own API calls via Lightning
Built a LangChain tool that wraps a Bitcoin market API using L402 (Lightning Network payments) for auth.
The interesting part: the agent pays for each API call autonomously. No API key, no human involvement. It hits the endpoint, gets a 402 with a Lightning invoice, pays it, retries. The whole thing is transparent to the agent.
The tool returns a bot_ready object from /v1/summary:
{ signal: "HOLD", confluence: 52, price_usd: 84231, fear_greed: 44, leverage_risk: "MEDIUM", support: 81400, resistance: 87200 }
Agent decision logic becomes:
if (signal === 'BUY' && confluence > 65 && leverage_risk !== 'EXTREME') → execute trade
Full LangChain tool example in the docs: satsapi.dev/docs
The API costs 200 sats (~$0.12) per call to /v1/summary. Cheapest endpoint is 2 sats.
Anyone building trading agents or Bitcoin-aware workflows?
satsapi.dev
Posted Mar 8, 2026, 6:01 PM UTC