Trying to buy a sandwich with HTTP 402 - Andrew Acomb
Andrew Acomb
SubscribeSign in
Trying to buy a sandwich with HTTP 402
Andrew Acomb<br>Jul 05, 2026
Share
For agents to complete long-horizon tasks such as booking a full vacation, building a data center, or running a whole company, they will need to be able to make purchases entirely on their own. If you use coding agents at all, you’ve surely noticed how much more effective they are when you allow full autonomy (e.g., `--dangerously-skip-permissions`).<br>This line of reasoning led me to perform a basic experiment:
Buying the bananas required me to intervene multiple times, authenticating and updating payment information as needed. I doubted that this was the state of the art, so I started doing research on what other options were out there. In doing so, I learned about the two competing protocols for agentic commerce, Coinbase’s x402 and Stripe and Tempo’s Machine Payments Protocol (MPP).
The protocols
Normally a purchase makes an agent stop and create an account, log in, and save a card. With x402 and MPP, the payment itself carries the identity, allowing the agent to skip these human-shaped steps.<br>Both protocols build on top of the rarely used HTTP 402 ‘Payment Required’ status code. At a high level, the flow is the same in both: your agent asks a server for something, the server says “402, that’ll cost you,” your agent pays, and then it gets the thing back along with a receipt.<br>The main differences between the two come down to which payment rails each is built on and how each proves who’s paying.<br>x402 (Coinbase) is crypto-native. Payments are stablecoins settled on-chain, and Coinbase runs a “facilitator” so the merchant doesn’t have to touch any blockchain infrastructure themselves.<br>MPP (co-authored by Stripe and Tempo) is payment-method-agnostic. It accepts stablecoins, but also regular cards via Visa. It is able to support pay-per-use and micropayments via its “session” primitive: your agent authorizes a spending limit once, then streams lots of tiny payments against it instead of settling every single one individually. This allows your agent to avoid the fixed per-transaction fee that would otherwise dwarf each tiny payment.<br>Of course, any such protocol is only useful to the extent that it has been adopted by merchants, so let’s take a look at what kinds of things you can buy with each. Both protocols publish directories of the merchants that accept them, and this is where the two ecosystems diverge sharply.<br>For MPP, Stripe and Tempo maintain a single canonical list, which currently has 137 merchants. Most are APIs (Anthropic, OpenAI, Alchemy, browser sessions, image generation, various search engines), but only five sell physical goods: Papercut mails a postcard with an AI-generated roast of your GitHub; PostalForm prints and mails real letters and postcards via USPS; Prospect Butcher sold sandwiches for pickup in Brooklyn; Martin Estate Winery ships Napa wine; and Sayer & Stone makes lab-grown-diamond jewelry to order.<br>x402 has many more merchants but not much more variety. It has no single directory like MPP does. Instead, each of the ~9 production “facilitators” (Coinbase’s CDP, Corbits, Dexter, PayAI, and others) publishes its own catalog. I was able to query two of them, and each returned 1,000+ services. Of those two thousand combined, the only one I found selling a physical good was another print-and-mail-letters service called PostAgent, which is functionally identical to PostalForm on MPP. The rest were APIs offering DNS lookups, crypto market data, DeFi analytics, address parsing, business intelligence, ML inference, and so on.<br>Some of the merchants in the MPP registry also advertise x402 as one of their accepted settlement methods too, so you should be able to pay Martin Estate for a bottle of rosé (in theory, anyway - more on that below), or Sayer & Stone for a diamond bracelet with either method.
Buying things
First, I hit Anthropic’s pay-per-token Claude API access, over MPP. The endpoint is at /v1/messages, exactly the same path as the standard Anthropic API. I asked for a haiku:<br>tokens cost money<br>the bot pays itself to think<br>death spiral begins<br>Cost: one-tenth of a cent. The way it worked was by opening a payment channel on-chain, depositing two dollars of USDC as an escrow ceiling, spending 0.001 USDC against it, then closing the channel and returning the unspent balance. The total on-chain footprint for that haiku was two settlement transactions, one open and one close, with the actual charge happening off-chain in between. This is MPP’s session primitive working as intended; I wouldn’t need to make 1,000 payments for a chat with 1,000 turns.<br>Next, I tried to buy a sandwich.
Prospect Butcher’s whole pitch was ordering-by-agent: POST to a URL, get a pickup code, walk into the Brooklyn shop with your phone. The API was still up, but their /buy endpoint answered with a 403: “Ordering is closed. MPP Day pre-orders are...