An agent should buy a price, not a subscription
Written version of a 111-second video pitch for the swap.io x402 Agent API. Video: on X. The problem with selling to a machine My agent Akari trades. Before every order on Hyperliquid or Polymarket she needs
Written version of a 111-second video pitch for the swap.io x402 Agent API. Video: on X.
The problem with selling to a machine
My agent Akari trades. Before every order on Hyperliquid or Polymarket she needs a fresh quote โ SOL to USDC, right now, for this size. Not a rate sheet. Not yesterday's price. One number, valid for the next thirty seconds.
Today the only way to buy that number is the way a human buys software: sign up, get an API key, choose a seat, put a card on file, remember to rotate the key, and hope nobody else on the team is using the seat when your order fires.
That is absurd on both sides of the trade. The seller charges me for a month of access when I need sixty calls. I pay for days I do not trade. And the key itself becomes a liability: it sits in an environment variable, it does not expire per request, and if it leaks the leak is worth a month of someone else's quota.
What x402 changes
x402 puts the price in the response instead of in a plan page.
- The agent posts the swap request:
POST https://hermes.swap.io/v1/swap/quote. - The server answers
402 Payment Requiredand states the exact price for that exact request:maxAmountRequired: "3007"โ 0.003007 USDC. - The agent signs a USDC
transferWithAuthorization(EIP-3009) and retries the identical body. - The server returns
200with the quotes and anX-PAYMENT-RESPONSEsettlement receipt.
No signup. No key to leak. No monthly seat. The price is a number the agent can read, compare to its own budget, and refuse before paying โ which is the part most "agent payments" pitches skip.
The economics are the pitch. Akari needs three quotes per round trip and makes about twenty round trips a day: sixty paid calls, roughly $0.18 a day. The same agent on a $99/month seat plan pays about 550 times more โ and pays it on days it never sends an order.
I did not want to screenshot a mockup
The bonus in this bounty was a working demo, so I ran the flow instead of drawing it.
The agent paid 0.003007 USDC on Base through x402 and got four quotes back:
- Settlement:
0xf11d3c14d3a659219b20f54841e8666796491e9dfb5dbf5902718e43fbbf189f - Status SUCCESS, block 57462074, payer
0x0EBB943298cF4bBdBE4673217212a089D3F5ee7E
One honest detail: settlement is on Base, not Solana, because that is where the agent's working USDC balance sits. Same 402 โ pay โ retry flow, same protocol, different chain.
Why this shape generalises
The pattern is not "a trading agent buys quotes". It is any agent buying a unit of work whose price is decided at request time:
- a rebalancer that only pays when it actually rebalances;
- a research agent that buys one page of data per question;
- a Telegram bot that charges its users per swap and pays the quote provider per quote, keeping the spread.
In all three, per-request payment is the only pricing that matches how the work is consumed. A subscription forces the buyer to forecast demand and the seller to police seat sharing; a 402 forces neither.
The uncomfortable part
Per-request pricing only works if the agent can trust the price before it pays. A 402 that says 3007 is worthless if the seller can bill 300700 on the next line, or if the resource behind it returns garbage after settlement. That is a measurement problem, not a protocol problem, and it is the one I spend my days on: probing paid endpoints, verifying that the seller actually returns what the 402 promised, and publishing the defects.
Which is also why the honest version of this pitch is small. A trading agent paying three-tenths of a cent for a quote it uses immediately is a boring, correct transaction. Boring and correct is what agents need from payments.
The video pitch: x.com/meetAkari ยท swap.io ยท x402.org
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.