Skip to content
Ai And Automation 7 min read

x402 for Paid APIs: The Payment Can Succeed While the Response Fails

How the x402 paid-API exchange works, why verification is not settlement, and which retry and reconciliation controls an operator must add.

PB
By Shaun Toh
TL;DR

x402 puts a payment challenge and proof into an HTTP request. Coinbase's documented flow separates verification, resource execution, settlement and response delivery. The gaps between them determine retries and reconciliation.

Operator Summary

x402 lets a server quote a price for an HTTP resource and lets a client or agent retry with a signed payment. In Coinbase's documented flow, the facilitator verifies the proof, the server performs the work, the facilitator settles, and the server returns the resource. Verification, settlement and successful delivery are distinct states. Operators must define idempotency, retry, refund and reconciliation behavior for their own endpoint rather than assume the protocol supplies it universally.

The interesting x402 failure is not always “payment declined.” It is payment settled, response lost. The agent sees a timeout and may try again. The seller may already have been paid and may already have performed the work. Without a request-level recovery rule, both sides can disagree about what happened.

The documented exchange

Coinbase's x402 flow describes a client requesting a resource, a server quoting payment requirements, and the client retrying with a signed payment. In its CDP Facilitator example, the server asks the facilitator to verify the payload, performs the work, asks it to settle, and returns the resource with payment confirmation. x402 is useful for an agent purchasing an API call mid-task, but the exchange does not depend on the client being an agent.

BoundaryWhat the implementation learnsWhat is still open
Price challengeAsset, network, recipient and amount offered by the serverWhether the client can or will pay.
Signed retryA payload was presented for that requirementWhether it passes verification.
VerificationThe facilitator accepts or rejects the payload for the requirementsWhether settlement succeeds.
Resource executionThe server has run the requested operationWhether it will be paid and whether the client will receive the result.
SettlementThe facilitator reports the payment outcomeWhether the HTTP response reaches the client.
Response deliveryThe client receives the resource or an errorWhether a retry represents a new purchase or recovery of the old one.

That last column is an operator checklist, not a set of guarantees in x402. Coinbase's Facilitator page says its hosted service verifies signed payments, screens transactions, submits settlement onchain and reports the result. Its API exposes verification separately from settlement. Do not count a successful verify response as a collected payment.

Design for the failure between steps

FailureBuyer or seller symptomControl to design and test
Verification rejects the payloadClient paid nothing usable for this requestReturn a clear failure and avoid running the paid operation.
Work fails before settlementNo useful resource was producedDefine whether the payment is submitted, cancelled or retried; the answer depends on the chosen scheme and implementation.
Settlement fails after workSeller performed work without confirmed receiptRetain a correlation record and reconcile before treating it as paid.
Settlement succeeds; response is lostClient times out while seller has a receiptOffer a way to retrieve the prior result without silently charging for a second identical request.
Agent retries with a new payloadTwo payment attempts may exist for one taskDetect duplicate intent and show which attempt paid for which resource.

These are PaymentBrief's suggested controls. They are not claims that the protocol automatically supplies deduplication, refunds or replay behavior for every endpoint. Keep a seller-side operation ID, the priced resource and version, payload or transaction reference, facilitator verification and settlement results, and final delivery status together. Define the retry key and retention period in your own API contract. Test a timeout after settlement deliberately in a non-production environment; a happy-path response is not enough.

Scope and money boundaries

The x402 standard is described as network-agnostic, but a particular facilitator supports a particular set of assets, networks and schemes. Coinbase's current CDP page lists x402 v2 support for named EVM networks and Solana and describes different handling for exact, upto and batch-settlement. Check its live supported-schemes endpoint before integration; the documented network list can change. Do not infer that a feature present in the wider protocol works on every CDP network. Nor does accepting a stablecoin remove wallet funding, custody, screening, conversion or off-ramp questions. Coinbase describes screening and hosted settlement for its Facilitator; your organization still needs to determine who controls the receiving wallet and how value reaches its books or bank.

Before allowing an agent to purchase paid API calls, put a per-call and total budget around its signer, decide which counterparties and networks it may use, and reconcile its signed requests against settled payments and delivered resources. The agent payment-controls guide covers the delegation boundary; the agentic protocol map covers retail commerce and agent identity, which are different from paid API access.

Sources & methodology (3)

Coinbase's x402 documentation describes a paid HTTP resource and a client-server-facilitator flow with separate verification, resource execution, settlement and response steps

Checked:

Source types explained in our Methodology.

Shaun Toh By Shaun Toh · Director, Digital Payments · Razer

More Ai And Automation briefings