Lightning Labs has introduced pi402, an open-source extension designed to enable AI coding agents to purchase compute resources using Bitcoin. The tool, unveiled on November 12, 2026, allows agents to pay for inference services directly over the Lightning Network without requiring human intervention, credit cards, or API keys.
The system utilizes the L402 protocol, which combines the HTTP 402 Payment Required response with Lightning Network invoices. Authentication is managed through macaroons, enabling a pay-per-token billing model. This approach allows agents to pay for exact consumption on a request-by-request basis rather than relying on monthly subscription plans.
To facilitate these transactions, Lightning Labs offers the Aperture reverse proxy and the Lightmeter tool, which together allow providers to charge for access to OpenAI-compatible inference endpoints. Users do not need to manage Lightning nodes or payment channels, as the Wavelength wallet, built on Ark, handles fund transfers automatically.
The demo pricing for the service is set at $0.375 per million input tokens and $1.50 per million output tokens. This release follows a series of developments by Lightning Labs throughout 2026, including the launch of agent payment tools in February and the mainnet deployment of the Wavelength wallet in October.






