Machine-to-Machine Payments

How AI Agents Pay

Agents that can plan but cannot pay are just expensive chatbots. The new pattern: an agent sends an HTTP request, gets told the price, pays in USDC on-chain, and receives the data. No account. No API key. No human in the loop.

"Agents that can plan but can't pay are just expensive chatbots. No account, no API key, no human in the loop. The agent sends a request, pays in USDC, gets data back. That's actually new."Source post on X, referencing agent-native pay-per-request APIs

Live Payment Flow Simulator

Step through an HTTP 402 payment flow. The agent discovers the price from the server's payment challenge, signs a USDC transfer, attaches proof of payment, and retries the request.

AI Agentwallet: 12.40 USDCData APIprice: 0.05 USDC / callOn-chain settlement (USDC)
1. RequestGET /market-data
2. Challenge402 Payment Required
3. PayUSDC transfer signed
4. Data200 OK + payload
Ready. Press Run full flow or Step to begin.

Why This Is Actually New

Traditional API access assumes a human sets up billing before any software runs. Agent-native payments invert that: the price is discovered and paid at request time by the machine itself.

The old way

Human-provisioned access

  • Sign up for an account with email verification
  • Enter a credit card and pick a monthly plan
  • Generate and store an API key as a secret
  • Agent is blocked until a human finishes setup
  • Overpay for unused quota or hit hard rate caps
The agent-native way

Pay-per-request over HTTP 402

  • Agent calls the endpoint with no credentials
  • Server replies 402 with price and payment address
  • Agent signs a USDC transfer from its own wallet
  • Payment proof rides in a header; request retried
  • Settlement in seconds, cost measured per call

Micropayment Cost Calculator

Per-call pricing changes the economics of agents. Estimate what a working agent actually spends compared to a fixed subscription.

Agent spend per month

$180.00

Questions Worth Asking

Why USDC and not a card on file?
Cards require an account owner, KYC, and chargeback rails built for humans. A stablecoin transfer is a bearer-style, programmable payment an autonomous process can make in one signed message, settling in seconds for fractions of a cent in fees.
What is HTTP 402?
Status code 402 Payment Required has sat unused in the HTTP spec for decades. Emerging protocols repurpose it: the server responds 402 with machine-readable payment terms, the client pays and retries with proof attached. The whole negotiation is two round trips.
What stops an agent from draining its wallet?
Spending policy lives in the harness: per-call price ceilings, daily budgets, allowlisted endpoints, and human approval thresholds for anything unusual. The wallet holds only working capital, not the treasury.
What does this unlock?
Long-tail data markets. Any server can charge five cents per query with no billing department, and any agent anywhere can be a customer instantly. Supply and demand for machine-consumable data can clear at machine speed.

Machine-to-Machine HTTP 402 Settlement Architecture

How do autonomous AI agents discover API pricing and settle micropayments using HTTP 402 challenge-response cycles?

Autonomous AI agents cannot execute credit card checkout forms, solve CAPTCHAs, or wait for manual billing approvals. This explainer models an automated two-round-trip payment architecture: an unauthenticated client requests a resource, receives an HTTP 402 Payment Required status code with machine-readable settlement terms, creates a cryptographically signed payment authorization, and repeats the request with proof attached in an HTTP header. By eliminating persistent pre-provisioned credentials, APIs can price programmatic requests on demand down to fractions of a cent.

The simulator is an illustrative state-machine demonstration: the headers (such as 'X-Payment' and 'X-Payment-Proof') and on-chain settlement timing (~1.2s) are synthetic fixtures rather than an official ratified IETF header standard. Additionally, the micropayment cost calculator assumes linear daily call volume across a fixed 30-day period without factoring in network gas costs, blockchain confirmation latency, or network fee volatility.

Try a worked example

In the Live Payment Flow Simulator, click 'Step' once from the initial state. The client fires an initial unauthenticated request 'GET /market-data', moving the blue packet across wire A. Clicking 'Step' a second time triggers the simulated server to return '402 Payment Required' over wire B along with sample JSON terms (such as an asset of USDC, an amount of 0.05, a destination address, and network details), highlighting the challenge phase.

The Reserved HTTP 402 Status Code

The HTTP status code 402 (Payment Required) was originally defined in early web protocol specifications and remains formally reserved for future digital payment systems under RFC 9110 Section 15.5.3. RFC 9110: HTTP Semantics

Rather than establishing static pre-negotiated subscriptions, web clients and programmatic agents interpret a 402 response as a machine-readable challenge detailing payee destination and required amounts before resubmitting the request. RFC 9110: HTTP Semantics

Cryptographic Bearer Authorization via EIP-3009

To avoid requiring autonomous agents to execute two on-chain transactions (an allowance setup followed by a transfer), modern smart-contract tokens like USDC implement ERC-3009 (Transfer With Authorization). ERC-3009: Transfer With Authorization

EIP-3009 enables meta-transactions where the payer cryptographically signs an EIP-712 typed message containing the recipient address, payment value, validBefore/validAfter timestamps, and a random 32-byte nonce. The recipient or an API relayer can submit this signature directly to the blockchain contract via receiveWithAuthorization, facilitating instant bearer settlement without prior token approval. ERC-3009: Transfer With Authorization

Sources and further reading

Four local payment-flow stages and thirty-day cost arithmetic

Read the explanation

The flow player has four authored actions: request, payment-required response, retry with payment proof and success response. Each animates a packet across a fixed four hundred forty unit horizontal path over nine hundred milliseconds. The displayed wallet changes from twelve point four to twelve point three five USDC in a log string. No wallet balance is updated, signature generated, blockchain contacted or payment verified by this local player. It illustrates supplied labels rather than executing a payment protocol. The separate calculator multiplies price per call, calls per day and thirty days. Default five cents and one hundred twenty calls per day gives six dollars daily and one hundred eighty monthly. Compared with the supplied four hundred ninety nine dollar subscription, the arithmetic difference is three hundred nineteen dollars, around sixty four percent. This assumes equal daily usage and one displayed USDC unit equal to one dollar, without fees, failed calls, refunds or exchange movements. It is an illustrative calculation, not verified current service pricing. The exact equality point is four hundred ninety nine divided by five cents times thirty, about three hundred thirty two point six seven calls daily. At three hundred thirty two, monthly cost is four hundred ninety eight; at three hundred thirty three it is four hundred ninety nine dollars fifty. The more-expensive branch prints the floored count, while equality compares the underlying floating values. Negative or invalid inputs show an error without recalculation. Logs, constants and cost outputs are local examples, not live API access or a financial recommendation.

Super generates helpful tools and automates fact-checking across the internet proactively. If you enjoyed this tool, build your own with Super and share it with a friend.