How the Agent Pays
According to the project's README, the agent sends an inference request to Aperture, the seller's gateway. If payment is needed, the gateway returns an HTTP 402 'Payment Required' response with a Lightning invoice. The extension checks its spending policy, pays through its embedded Wavelength wallet, caches the payment credential and retries the request. The model's response can then stream back.
With a metered seller, one bitcoin payment can cover multiple prompts. “One payment buys a bundle of tokens,” the README says. The seller's price server debits that prepaid balance based on reported input and output usage, with estimates used for completed streams without usage reports and some interrupted streams. The gateway asks for another payment when the bundle runs out, according to Aperture's metering documentation.
In Lightmeter's documented implementation, bundles are prepaid credit priced at a blended rate, with input and output tokens drawing them down at different rates, so the actual number of tokens covered depends on the mix.
Wavelength uses a swap server to pay Lightning invoices, so the buyer does not have to run a Lightning node or manage payment channels. The installation guide says the spending ceiling is checked against the invoice plus the swap fee; users can also set a daily cap.
The software defaults to a local development network, with mainnet use requiring explicit configuration. The extension registers Kimi, GLM and DeepSeek models, but which ones are actually served depends on the seller. Sellers can put the gateway in front of an OpenAI-compatible API and configure token prices and a markup.
Osuntokun's seller page quotes $0.375 per million input tokens and $1.50 per million output tokens, including a 25% markup on the seller's stated upstream costs. Dollar prices are fixed, while bitcoin amounts follow the spot exchange rate. The seller advertises a 500,000-token bundle usable for 30 days. These are that seller's terms, not network-wide prices; the examples on the pi402 product site use illustrative rates.
Bitcoin Settlement, Not a New 402 Standard
Lightning Labs' earlier L402 protocol already combined HTTP 402 responses with Lightning invoices. A buyer pays an invoice, then presents an authorization token and cryptographic proof of payment to access the service. The Defiant covered the launch of a dedicated L402 website in July; pi402 adds a Pi-specific buyer with an embedded wallet rather than inventing that payment mechanism.
For payment authorization, pi402 also supports MPP's Payment HTTP Authentication Scheme. It prefers an MPP charge offer by default, otherwise using L402 when available; MPP's session mode is not supported by the extension.
The x402 protocol similarly lets services charge without a checkout page, but does not prescribe a single payment rail. Coinbase's documentation describes a flow in which a client signs a payment and a facilitator verifies and settles it. The docs describe USDC as the most common asset, but x402 is network- and asset-flexible, including support for EVM networks and Solana. Its repository also contains a specification for bitcoin payments over Lightning.