Lightning Labs launches pi402 for AI agents to pay for inference in bitcoin

The open-source extension lets Pi coding agents pay per token over Lightning, without an account, API key or credit card.

Close-up of a smartphone with a cryptocurrency graph placed on an open business magazine, highlighting economic trends. Leeloo The First

Lightning Labs released pi402 on November 12, an open-source extension that lets AI coding agents pay for inference in bitcoin over the Lightning Network. Built for the Pi coding agent, it is designed to let software buy computing services without an account signup, API key or credit card.

The tool addresses a practical hurdle as software agents take on more tasks that require paid computing: many services still expect a person to manage the payment. With pi402 configured, an agent can receive a price, pay an invoice and continue working. Lightning Labs’ release makes the agent—not a human operator—handle each purchase.

How agent payments work

Pi402 uses L402, a protocol that connects the HTTP 402 “Payment Required” response with a Lightning invoice. When an agent requests access to a paid service, the server returns the payment requirement and invoice. The agent pays, and the payment settles; authentication uses macaroons, a type of credential token.

The design enables pay-per-token billing rather than a monthly subscription or prepaid balance: the agent pays for the tokens it uses, request by request. Demo pricing is approximately $0.375 per million input tokens and $1.50 per million output tokens, according to the release coverage.

What providers and users need

Providers can use Lightning Labs’ Aperture reverse proxy and Lightmeter to place payment checks in front of a service, meter usage and accept payments for an OpenAI-compatible inference endpoint. Buyers and sellers do not need to run a Lightning node or manage payment channels, according to the company’s setup description.

The Wavelength wallet handles payments and is built on Ark, automatically moving funds between Ark and Lightning. Lightning Labs launched agent-focused Lightning tooling in February and brought Wavelength to mainnet in October, before releasing pi402. The company has not announced broader adoption figures or how many inference providers currently support the system.

This report draws on information from Crypto Briefing and cryptonews.net.

Editorial checks passed Facts, figures and quotes checked against 2 sources Drafted with AI assistance · How it works

Spotted an error? Tell us

Add BCoinTalk as a preferred source on Google

Related stories