News

What Is pi402? Lightning Labs’ Way for AI Agents to Pay in Bitcoin

pi402 is a Lightning Labs extension, released November 12, 2026, that lets the Pi coding agent pay for its own AI model use in bitcoin. How it works and costs.

pi402 is a new tool that lets an AI agent pay for its own "thinking" with bitcoin. Lightning Labs released it on November 12, 2026, and the name is already showing up in Google and Bing search suggestions.

If you saw "pi402" (or "pi-402", or "Pi 402") in a headline and wondered whether it is a coin, a model, or something you need, here is the plain-English answer: what it is, how the payment works, what it costs, and who it is really for.

TL;DR: pi402 is a free, open-source extension for the Pi coding agent, made by Lightning Labs and released November 12, 2026. It lets the agent buy AI model use (called inference) with bitcoin over the Lightning Network, with no account, no API key and no credit card. It is not a coin and not an AI model. Today it is a tool for developers: there is no hosted seller yet, and a fresh install runs on a test network.

What is pi402?

Every time an AI agent answers you, it uses a model, and someone pays for that. Normally a human signs up with a model company, enters a card, and pastes a secret API key into the agent. The agent cannot do any of that on its own.

pi402 removes those steps. Lightning Labs describes it as a way to "pay for AI inference with bitcoin, from inside your coding agent." You give the agent a small wallet with a little bitcoin in it. When the agent needs a model, it pays for it directly, a tiny amount at a time.

A few basics, all from Lightning Labs’ announcement and code:

  • Who made it: Lightning Labs, the company behind much of the software for Bitcoin’s Lightning Network. The launch post was written by its CTO, Olaoluwa Osuntokun.
  • What it plugs into: Pi, an open-source coding agent (pi.dev). pi402 does not work in ChatGPT, Claude or other agents today.
  • License: MIT, so it is free and open source. The code is on GitHub as lightninglabs/pi-402.
  • The name: "Pi" for the agent, "402" for HTTP 402, the web’s old "Payment Required" code.

How does pi402 work?

Think of a vending machine for AI. The agent asks for a snack, the machine shows a price, the agent pays, the snack drops. In web terms:

  1. Pi sends a normal model request to a seller.
  2. The seller answers with HTTP 402, "Payment Required," plus a Lightning invoice, which is a bitcoin bill.
  3. pi402 checks the price against your spending limits.
  4. The built-in wallet pays the invoice. Payment gives the agent a proof, which works like a receipt and a ticket in one.
  5. The request is sent again with that ticket, and the model’s answer streams back. Pi itself never sees the payment happen.

This pattern is called L402, a protocol Lightning Labs has worked on for years. pi402 also understands a second standard called MPP, and uses it when a seller offers it.

One detail the headlines skipped: the agent does not pay for every single word. One payment buys a prepaid bundle of tokens (tokens are the small chunks of text a model reads and writes). The default bundle is 1,000,000 tokens. Each request draws the bundle down by what it really used. When it runs out, the seller asks for a new payment.

The four parts: pi402, Aperture, Lightmeter and Wavelength

PartWho runs itWhat it does
pi402The buyer (you and your agent)Pays the bill when a model call comes back with a 402
WavelengthThe buyer, inside pi402The wallet. It is built on a system called Ark, so you do not need to run your own Lightning node. Live on the real Bitcoin network since October 23, 2026
ApertureThe sellerThe gate in front of the model. No payment, no answer. It keeps the seller’s real model key hidden
LightmeterThe sellerThe price list. It turns dollar prices into bitcoin prices and keeps a record of sales
Agentic AI, a team of expert AI agents on your iPhone and iPad. No wallet, no API keys, no setup. Your first 3 tasks are free. Get the app free

How much does pi402 cost?

The extension is free. You pay only for the model use your agent buys, and the seller sets that price.

Lightning Labs’ demo rates are 1 millisatoshi per input token and 2 millisatoshis per output token. A millisatoshi is a thousandth of a satoshi, the smallest unit of bitcoin. In dollars, the launch post puts that at about $0.80 per million input tokens and $1.61 per million output tokens, at a bitcoin price of roughly $80,500. Because the price is set in bitcoin, the dollar figure moves when bitcoin moves.

A note on the numbers: several news sites reported the demo input price as about $0.375 per million tokens. Lightning Labs’ own post and the pi402 site say about $0.80, and that is the figure we use here. Either way, these are demo prices, not a public price list.

How to try pi402

You need the Pi coding agent (version 1.5.2 is the one Lightning Labs tested) and Node.js 22.19 or newer. Then:

  1. Install it: pi install npm:@lightninglabs/pi-402
  2. Point it at a seller by setting L402_PROXY_URL to the seller’s address.
  3. Add money: type /fund 20000 inside Pi to get an invoice for 20,000 satoshis, and pay it from a Lightning wallet.
  4. Pick a paid model with /model and work as usual.

Two honest warnings. First, Lightning Labs says "there is no hosted seller to point it at yet," so you need a seller that runs Aperture, or you run one yourself. Second, a fresh install uses a test network with play money. Real bitcoin needs a setting change and a wallet password. Back up the wallet’s seed words, because the file on your computer is the only copy.

Is it safe to let an AI agent spend money?

This is the right question to ask. pi402 has three brakes built in:

  • A per-request ceiling: 1,000 satoshis by default (under a dollar at today’s prices). If a seller asks for more, the agent refuses.
  • A daily cap: 100,000 satoshis by default.
  • The wallet balance: the agent can never spend more than you loaded.

That is a sensible design: the agent holds pocket money, not your bank card. Still, bitcoin payments cannot be reversed, and the software is one day old. Start small.

pi402 vs x402: are they the same thing?

No, but they are cousins. Both bring back HTTP 402 so software can pay for things on the web. x402 is a separate standard that is mostly used with stablecoins, which are digital dollars. L402, which pi402 is built on, settles in bitcoin over Lightning. And pi402 itself is not a protocol at all: it is one extension for one agent. If you want the identity side of the story, see our explainer on the x401 protocol, which lets a website ask who an agent is acting for.

What this means for you

For most people, pi402 is not something to install. It matters as a signal. Agents are starting to get their own wallets, which is one step toward agents that can hire other services without a human typing in a card number. That same shift is why some companies are pushing back, as we covered in United Airlines’ ban on AI agents.

If you just want work done, you do not need any of this plumbing. That is the idea behind agentic AI for normal people: you describe the task, and a team of agents plans it and finishes it. Our app, Agentic AI, does exactly that on iPhone and iPad. There is no account, no wallet and no key to manage. You get 3 free tasks, and you can put up to four experts on one job.

Agentic AI, your AI team in your pocket. Skip the wallets and invoices and hand over the task. Get the app free

Quick answers

What is pi402? pi402 is a free, open-source extension from Lightning Labs, released November 12, 2026, that lets the Pi coding agent pay for AI model use with bitcoin over the Lightning Network.

Is pi402 a cryptocurrency or a coin? No. There is no pi402 token to buy. It is software that pays small bitcoin invoices. It is also not related to Pi Network or the Raspberry Pi.

Is pi402 free? The extension is free under the MIT license. You pay the seller for the model use your agent buys. Lightning Labs’ demo rate works out to about $0.80 per million input tokens and $1.61 per million output tokens.

Does pi402 work with ChatGPT or Claude? Not today. It is built for the Pi coding agent only. The seller side works with any model service that uses the common OpenAI-style API format.

Do I need a Lightning node to use pi402? No. The built-in Wavelength wallet handles payments without a node or payment channels. You do need a little bitcoin to fund it.

What is the difference between L402 and x402? Both use the HTTP 402 "Payment Required" code. L402 pays in bitcoin over Lightning. x402 is a separate standard mostly used with stablecoins. More agent terms are in our glossary.


Sources: Lightning Labs: Announcing pi402 · pi402.tech · GitHub: lightninglabs/pi-402 · Crypto Briefing · Startup Fortune · TokenPost

Stop working alone.

Give any task to a team of AI experts on your iPhone. Start with 3 free tasks, then Agentic AI PRO from $34.99 a year.

Download free on iPhone On your computer?Point your iPhone camera here to install.

3 free tasks · No account · No login