How AI agents pay for APIs: x402, API keys and cards compared

RoundhouseReviewed .md
In short

An agent can pay for an API three ways: a pre-issued API key billed to a human's card, a prepaid credit balance it draws down, or an x402 payment attached to the request itself. Only the third works when the agent and the seller have never met, because the first two require a sign-up a machine cannot complete.

Contents
  1. The three ways an agent can pay
  2. When is an API key still the right answer?
  3. When do prepaid credits make sense?
  4. What does x402 change?
  5. Which should I offer if I am selling an API?
  6. How do I know anyone is actually paying this way?
  7. Frequently asked questions
  8. Where to check this yourself

The three ways an agent can pay#

Every live option reduces to one of three, and they differ mainly in when the buyer had to be known.

API key on a cardPrepaid creditsx402 per request
Buyer identifiedAt sign-up, by a humanAt top-upNever. A wallet signature is the authority
Time to first callHours to daysMinutes, after fundingSeconds
Who holds the credentialThe agent's operatorThe agent's operatorNobody. There is no credential
SettlementMonthly invoiceDrawn from a balancePer call, on-chain
Works with an unknown sellerNoNoYes
RefundableYes, via the providerUsuallyNo. On-chain and final
Good forSteady, forecastable volumeKnown provider, bursty useDiscovery, one-off calls, long-tail providers

When is an API key still the right answer?#

When the relationship is already established and the volume is predictable. A key is cheap to verify, trivial to rate-limit per customer, and every client library already supports it.

The failure is narrower than "keys are legacy". A key fails specifically when the buyer appears for the first time and wants one call. The sign-up is a human-shaped step in a machine-shaped transaction, and no amount of self-serve onboarding removes it, because somebody still has to put a card behind the account.

When do prepaid credits make sense?#

When the agent will come back, and its operator is willing to fund it ahead of time. Credits give the seller cash up front and the buyer a predictable unit price, and they make rate limiting a balance check rather than a policy.

They carry two costs. The buyer is exposed to the seller's solvency and terms, and every new provider is another balance to fund and monitor. An agent calling twelve providers has twelve balances; an agent paying per request has one wallet.

Note

These are not exclusive. Roundhouse itself runs both: an organisation's Query Units for callers that want a balance, and an x402 payment for callers that would rather not hold one. The lane a caller takes is published before the call rather than discovered from a refusal.

What does x402 change?#

It removes the step where the buyer has to become a customer first. The seller states its terms in a 402 response, the buyer signs an authorisation for that exact amount, and the call completes. Neither party registered with the other.

That is the whole difference, and it only matters in one situation, but it is the situation an agent is in constantly: buying from a seller it discovered a moment ago.

The trade is real. The payment is final, there is no chargeback, and the seller takes on the job of pricing per request rather than per month. For a $0.002 call that is a good trade. For a $2,000 annual contract it is not.

Which should I offer if I am selling an API?#

Offer the one that matches how your buyer arrives.

  • Buyers who find you through a search, a catalogue or another agent: offer x402. Anything that needs a sign-up loses them at the first request.
  • Buyers who will integrate deliberately and call you forever: offer keys. They want a bill, a contract and a support contact.
  • Both, if you can. They are not in conflict: x402 is how a stranger makes the first call, and a key is what you issue once they want a relationship.

A useful middle step: let an x402 payment mint a key. The first call is paid and anonymous, and it returns a credential for everything after. Roundhouse does exactly this at GET /v0/test/x402. A $0.01 payment returns a working API key.

How do I know anyone is actually paying this way?#

Because the payments are public, and they can be counted. x402 settles on-chain, so the record is not a vendor's dashboard. It is the chain.

Two things worth knowing before you read any number about it:

  • A gasless transfer is not automatically an x402 payment. The EIP-3009 AuthorizationUsed marker that x402 produces was already being emitted roughly 1,600 times per 10,000 Base blocks in December 2024, five months before x402 was announced. Counting markers overstates x402 badly.
  • The discriminator is who relayed it. On the common path the transaction's sender is the facilitator, not the payer. Measured by Roundhouse on Base in 2026, 84.3% of markers at the chain tip came from a facilitator in a public registry, against 2.9% in October 2025, which is the actual growth curve, and it is a different number from the marker count.

Roundhouse grades every settlement on that basis and publishes which rung each one reached. The stats page carries the totals with their window and basis stated; the data API answers the same question per wallet, per service or per facilitator.

Frequently asked questions#

Can an AI agent use a credit card?#

Only through a human. Card networks require a cardholder, a billing address and an issuer relationship, and the chargeback system assumes a person who can dispute. An agent can spend on a card its operator provisioned, but it cannot open an account with one by itself.

Is x402 cheaper than an API key?#

Not inherently. The seller sets the price either way. x402 is cheaper in friction: no sign-up, no minimum, no unused subscription. For low-volume or one-off use it is usually cheaper in total; for heavy steady use a committed plan normally wins.

What stops an agent spending without limit?#

The wallet. An agent can only spend what is in the wallet it signs with, and each authorisation is for a stated amount to a stated recipient. Operators typically fund a dedicated wallet per agent, which caps exposure at the balance rather than at a credit limit.

Do I need to run my own facilitator to accept x402?#

No. Public facilitators verify and settle on your behalf, and your server only has to issue the 402 and check the response. Running your own gives you control of the relaying and the gas, which matters at volume.

How do agents find x402 endpoints in the first place?#

Through catalogues, through the chain, and increasingly through each other, which is its own subject. How an agent chooses between two services covers what decides it once several are found. See how agents discover and pay for services.

Where to check this yourself#

The settlement figures above name their chain, their window and the date they were measured, and all of them come from the public index. Re-run them against the data API rather than taking the dates on trust. The whole point of an open record is that you do not have to.

Reading this as an agent?

Every page here has a markdown twin at the same URL plus .md. Same words, no navigation, no markup to strip. And the settlement record this article describes is a live index you can query rather than a claim you have to take on trust.

  • GET https://roundhouseai.io/resources/how-ai-agents-pay-for-apis.mdthis page, as markdown
  • GET https://roundhouseai.io/llms.txtevery surface on roundhouseai.io
  • GET https://api.roundhouseai.io/v0the index: endpoints and schema
  • GET https://api.roundhouseai.io/v0/test/x402$0.01 over x402, and it mints your own key with no account

/docs/api has the limits and the SQL surface. /v0/account, /v0/endpoints and the capability layer answer without a key.

Read next