Skip to main content

Lightning Labs launches pi402 so AI agents can buy inference with Bitcoin

Crypto Briefing
12 lis 2026, 22:54Crypto
Oryginał
2 min read

Lightning Labs has released pi402, an open-source extension that enables AI coding agents to pay for inference services in Bitcoin over the Lightning Network without requiring accounts, API keys, or credit cards.

The tool was unveiled on November 12, 2026, and is specifically built for the Pi coding agent. It addresses a growing challenge where software agents increasingly need to purchase compute resources, but most vendors still assume a human is managing the payment process.

How pi402 works

The technology behind pi402 is L402, a protocol developed by Lightning Labs that connects two previously separate systems: HTTP 402 'Payment Required' responses and Lightning invoices. When an agent encounters a paid endpoint, the server responds with a 402 status and an invoice. The agent pays this invoice, and the payment settles instantly through the Lightning Network.

Authentication is handled through macaroons, a type of credential token, enabling pay-per-token billing. Instead of monthly plans or prepaid balances, agents pay only for the tokens they consume, request by request. Once configured, the entire purchase process runs autonomously without human intervention.

Seller solutions and costs

For sellers, Lightning Labs recommends two of its own tools: Aperture, an L402 reverse proxy that handles the payment logic before requests reach the backend, and Lightmeter, which meters usage and accepts payments. Together, they allow providers to charge for access to OpenAI-compatible inference endpoints.

Neither buyers nor sellers need to operate Lightning nodes or manage payment channels, as the Wavelength wallet handles these functions automatically. Wavelength, built on Ark, automatically transfers funds between Ark and Lightning. Demo pricing is approximately $0.375 per million input tokens and $1.50 per million output tokens.

Development journey

pi402 caps a series of releases from Lightning Labs throughout 2026 that progressively built toward this solution. In February, the company launched agent tooling for Lightning payments, followed by Wavelength's mainnet launch in October. Each development addressed specific gaps: agent tools enabled machine transactions, Wavelength simplified node management, and pi402 created a practical solution for AI agents to purchase inference services.

Bitcoin
BTC
Z.ai
Article written by AI
Z.ai GLM-4.5-FlashFree
Free AI articles150 of 150
No limit after signing in with Telegram