AI agents, bots, and automated software make API calls continuously. They pull data feeds, run model inference, process datasets, and trigger downstream workflows without a human ever pressing a button. But when it comes to paying for that access, they hit a wall. Traditional payment systems require a card number, an account, and a human to complete a checkout form. Machines cannot do any of that, so most API providers default to either free access or a flat monthly subscription that does not reflect actual machine usage.
Speed, the Bitcoin and stablecoin payment infrastructure company, launched a product to address this directly. Speed Agentic Payments is an SDK that lets developers add per-request billing to any Node.js/Express API, with payments collected automatically from AI agents over the Lightning Network, no invoices, no subscriptions, and no human in the loop.
Subscription pricing works when customers have predictable usage, manage their own accounts, and make deliberate decisions about whether to stay on a plan. Those conditions apply reasonably well to human developers accessing an API on a regular cadence.
They break almost completely for agentic traffic. An AI agent's consumption is driven by task load, not user intent. The same agent might make five API calls on a slow day and fifty thousand on a day it is processing a large dataset. Charging that traffic on a fixed monthly tier means either leaving revenue on the table during high-volume periods or overcharging during quiet ones.
Pay-per-use is the natural fit for machine consumption patterns — but building that billing layer from scratch requires payment infrastructure that most API providers do not have the time or resources to build internally.
Speed's solution runs on the L402 protocol, an open standard that combines the HTTP 402 status code with Lightning Network invoices to create machine-readable API paywalls.
Agent sends a request. An AI agent sends a standard HTTP request to the protected API endpoint, exactly like any normal call with no special setup on the agent's side.
Speed returns a payment request. Speed intercepts the call and responds with an HTTP 402 Payment Required, along with a Lightning invoice specifying the amount and a macaroon (a bearer token that becomes valid once payment is confirmed).
Agent pays the invoice. The agent pays the Lightning invoice autonomously in milliseconds, then receives a payment preimage, cryptographic proof that the payment is complete.
Agent resubmits and gets access. The agent resubmits the original request with the payment proof in the Authorization header. Speed verifies it and grants access to the data or service.
The full cycle, from request to access, takes roughly three to four seconds. Because Lightning payments are cryptographically final, there are no chargebacks, no disputes, and no reversals.
For teams that want to go deeper on the protocol, Speed's guide on how to monetize APIs for AI agents walks through the full L402 exchange end to end, including how macaroons and payment preimages work together.
Speed is built to layer onto existing infrastructure, not replace it. Setup takes three steps.
Install the @speeddev/l402-express SDK via a single npm command. It works on top of an existing Node.js/Express API with no redesign required. Then configure which routes to protect and set a price per request in USD, EUR, INR, or other supported currencies; Speed converts to equivalent Bitcoin at live rates automatically. After that, the API starts earning. Payments from AI agents arrive in the developer's Speed dashboard in real time, settled in under three seconds.
Pricing can go as low as $0.0001 per API call. At that rate, a workflow making 10,000 calls costs $1 total. Wallet controls let developers set per-agent spend limits, which prevents runaway consumption from automated clients operating outside expected parameters.
Cloudflare reports processing over a billion HTTP 402 requests daily. The infrastructure for machine-to-machine payments is already operating at scale. What has been missing is a product layer that makes it practical for individual API developers to deploy without having to run their own Lightning nodes, write invoice logic, or maintain custom payment infrastructure.
That is what Speed Agentic Payments is positioned to be.
Most APIs powering AI workflows today are either free or locked behind a monthly subscription that doesn't reflect actual usage. Neither model works for the machine economy forming right now. With Agentic Payments, any developer can charge for exactly what their API delivers, collected automatically, without building billing infrastructure from scratch.
The machine economy isn't coming — it's already running at scale. Speed built Agentic Payments so developers can participate in that economy from day one, not retrofit into it later.
Speed Agentic Payments is now generally available. The SDK is published at @speeddev/l402-express on npm, and the product page is at tryspeed.com/agentic-payments.