SI Agent News
DevelopingOpen modelsAgents

Lightning Labs launches pi402 for AI agents to pay for compute

A new open-source extension allows AI coding agents to pay for inference in Bitcoin without human intervention or credit cards.

$0.375cost per million input tokens in demo

The short version

Why it matters

This technology addresses a major hurdle for autonomous software: the ability to pay for its own resources. By automating payments, AI agents can operate more independently without requiring a human to manually top up credits or manage billing details.

Automating AI spending

Lightning Labs recently unveiled pi402, an open-source extension designed to let AI coding agents pay for their own inference. Inference refers to the process of a model generating a response from an input. This tool allows agents to purchase the compute power they need to function using Bitcoin over the Lightning Network.

The primary goal of pi402 is to solve a growing problem in the software industry. As software agents become more capable, they increasingly need to buy compute power from various vendors. However, most current compute providers assume that a human being is the one holding the wallet and managing the subscription.

By removing the human from the loop, pi402 allows for a more seamless interaction between machines. The agent can see a price, pay the invoice, and immediately return to its task. This setup eliminates the need for traditional account signups, API keys, or credit cards during the transaction process.

How the L402 protocol works

The technology powering pi402 is a protocol called L402, which Lightning Labs has been developing for some time. This protocol works by pairing two different pieces of digital plumbing that were not originally designed to work together. These components are the HTTP 402 "Payment Required" response and the Lightning invoice.

When an AI agent hits a paid endpoint, the server responds with a 402 error and attaches a Lightning invoice to the message. This invoice serves as a demand for a set quantity of Bitcoin that can be settled via the Lightning Network. The agent then pays that invoice, and the payment settles almost instantly, allowing the request to proceed.

Authentication for these transactions is handled through macaroons, which are a specific type of credential token. This combination enables a pay-per-token billing model. Instead of relying on a monthly subscription or a prepaid credit balance, the agent pays for exactly what it consumes on a request-by-request basis.

The seller and wallet side

For this system to work, there must be a way for sellers to accept these automated payments. Lightning Labs points providers toward two of its own tools to facilitate this. Aperture acts as a reverse proxy that sits in front of a service to handle the logic of "pay first, then get access" before the request reaches the backend.

Lightmeter works alongside Aperture to meter the usage and accept the payments. Together, these tools allow a provider to charge for access to an OpenAI-compatible inference endpoint. This means that neither the buyer nor the seller has to run their own Lightning node or manually manage complex payment channels.

The Wavelength wallet handles the actual movement of funds for the agent. Wavelength is built on Ark and works to shift capital between Ark and the Lightning Network automatically. This automation ensures that once the initial setup is configured, no human needs to step in to manage the agent's finances.

A year of development

The launch of pi402 is the result of a year-long development cycle by Lightning Labs. It represents the final piece of a series of releases throughout 2026 aimed at making software more interactive with Lightning payments. The company has been systematically filling technical gaps to allow for machine-to-machine commerce.

In February 2026, the company launched agent tooling to let software interact with Lightning payments. This was followed in October by the launch of Wavelength on the mainnet, which removed the burden of node management. Each release served as a building block for the current capabilities of pi402.

By combining these tools, Lightning Labs has created a path for a coding agent to perform a concrete purchase. The agent tools provide the way for machines to transact, Wavelength handles the funds, and pi402 packages it all into a usable format for inference. This progression allows for a fully autonomous purchase loop for AI agents.

What to watch

Try it

Check out the Lightning Labs website to see the documentation for the pi402 extension and the L402 protocol.

Sources and links

Liked it? Say why

Add a line for other readers.

No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.

Listen to the AI Wire headlines

Listen to the AI Wire

Listen to our daily AI shows every morning: on your commute, in the shower, wherever you are

Listen to the daily shows

First reported by Crypto Briefing · Read the original. Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.

More AI news