x402 and Agent-to-Agent Payments: Protocol Guide and Comparison

Joan Alavedra, Co-Founder at Openfort15 min read
The layers of an agent payment stack — authorization, payment protocol, wallet, and settlement

TL;DR

x402 revives the HTTP 402 status code as a machine-readable payment challenge: a server answers an unpaid request with payment requirements, the client signs a stablecoin authorization, and a facilitator settles it on-chain. Coinbase built it and donated it to the x402 Foundation, which launched under the Linux Foundation on July 14, 2026 with 40 member companies. It is not the only agent-payment protocol — AP2 (Google) standardizes who authorized an agent to spend, MPP (Tempo) carries the same idea over standard HTTP authentication headers, and plain MCP tool-calling with a funded wallet is not a protocol at all. They mostly solve different layers. Adoption is real but small: x402.org reports 75.41M transactions against $24.24M of volume over the trailing 30 days, an average of roughly $0.32 per payment. This page covers the spec, the landscape, what an agent needs underneath any of these protocols, and which wallet vendors have published first-party support.

Last updated: September 13, 2026. Protocol details below were checked against the x402 specification repository, the AP2 repository, the MPP drafts at paymentauth.org, and each vendor's own published code on that date.

Agents that call paid APIs need a way to pay for a single request without a signup, an API key, or an invoice. Four approaches are competing for that job, and they are not really competing — three of them sit at different layers, and the fourth is not a protocol. This page explains x402, compares it honestly with the alternatives, and shows what has to exist underneath any of them before an agent can be trusted to spend.

For the wallet-by-wallet view of this market, see the best agent wallets for developers. For a broader survey that also covers ACP, see agentic payment protocols compared.

What is x402?

x402 is an open payment standard that turns the HTTP 402 Payment Required status code into a working payment challenge for machine clients. When a client requests a resource without paying, the server answers with a machine-readable PaymentRequired object describing what it will accept — the payment scheme, the network, the asset, the amount, and the address to pay. The client signs a payment authorization with its wallet and repeats the request carrying that authorization. A third party called a facilitator verifies the signature and settles the payment on-chain, and the server returns the resource.

The protocol has three participants: a resource server that gates something behind payment, a client (an application or an agent) that wants it, and a facilitator that handles verification and blockchain settlement. Splitting the facilitator out is what lets a resource server accept payment without running blockchain infrastructure or holding keys.

x402 was created by Coinbase and contributed to the x402 Foundation, an open-governance body hosted by the Linux Foundation. The Linux Foundation announced the foundation's operational launch on July 14, 2026, alongside the completion of Coinbase's protocol donation, with 40 member companies from financial services, cloud infrastructure and payments. The specification is published under Apache-2.0 at github.com/x402-foundation/x402.

The protocol is blockchain-agnostic. It is used mainly for stablecoin payments on EVM chains and Solana, and the specification separates the payment scheme (the logic of how value moves) from the transport (how the messages are carried), so the same payment types work over HTTP, MCP, and A2A.

How an x402 payment works

The v2 specification defines a four-step cycle:

  1. Client request. The client requests a protected resource with no payment attached.
  2. Payment required. The server responds with a PaymentRequired object. Over HTTP, this travels in a base64-encoded PAYMENT-REQUIRED response header. It contains x402Version, a resource description, and an accepts array — one entry per payment method the server will take.
  3. Payment authorization. The client picks an entry from accepts, signs an authorization with its wallet, and retries the request with the signed payload in a PAYMENT-SIGNATURE header.
  4. Settlement. The server verifies the authorization — usually by calling a facilitator's /verify — serves the resource, and has the facilitator /settle the payment on-chain.

A PaymentRequired payload looks like this:


_20
{
_20
"x402Version": 2,
_20
"error": "PAYMENT-SIGNATURE header is required",
_20
"resource": {
_20
"url": "https://api.example.com/premium-data",
_20
"description": "Access to premium market data",
_20
"mimeType": "application/json"
_20
},
_20
"accepts": [
_20
{
_20
"scheme": "exact",
_20
"network": "eip155:84532",
_20
"amount": "10000",
_20
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
_20
"payTo": "0x209693Bc6afc0C5328bA36FaF03C514EF312287C",
_20
"maxTimeoutSeconds": 60,
_20
"extra": { "name": "USDC", "version": "2" }
_20
}
_20
]
_20
}

The scheme field is the extension point. Four schemes are specified in the repository today:

SchemeWhat it does
exactPay a known, fixed amount. The common case for metered API calls.
uptoAuthorize a ceiling and settle the actual amount used. Fits metered work whose cost is not known until it runs.
auth-captureAuthorize now, capture later — the card-style two-phase flow.
batch-settlementAggregate many authorizations into one on-chain settlement.

The default flow verifies payment before the resource runs and settles afterwards. Schemes may declare other orderings.

One version caveat. Both v1 and v2 are published in the spec repo, and they do not use the same header names — v1 implementations carry the payment in an X-PAYMENT header, v2 uses PAYMENT-REQUIRED and PAYMENT-SIGNATURE. A client and a server still have to agree on a version. Check which one a given SDK implements before assuming interoperability.

The protocol landscape

x402 is one of several things people mean by "agent payments." They sit at different layers, and the useful question is usually which layer you are missing, not which protocol wins.

x402AP2MPPPlain MCP + funded wallet
What it standardizesRequesting, authorizing and settling a payment over a transportProof that a human authorized an agent to make a specific purchaseRequesting and authorizing a payment via HTTP authenticationNothing. A wallet exposed to an agent as a tool
LayerSettlementAuthorization / liabilitySettlementApplication code
TransportHTTP, MCP, A2A (transport is pluggable)Extension to A2A, MCP and UCPHTTP Payment authentication schemeMCP tool calls
SignallingPAYMENT-REQUIRED / PAYMENT-SIGNATURE headers (v2)Mandates carried as signed credentialsWWW-Authenticate: Payment, Authorization, Payment-ReceiptWhatever the tool schema defines
Settlement assetBlockchain-agnostic; stablecoins in practice, EVM and SolanaPayment-method agnostic, including cardsSOL, SPL and Token-2022 tokens in the Solana charge intent; confidential transfers supportedWhatever the wallet holds
Who is behind itCreated by Coinbase, donated to the x402 Foundation under the Linux FoundationGoogle (google-agentic-commerce/AP2)Specs published by Tempo at paymentauth.org; the Solana charge intent is authored by the Solana FoundationAnthropic's MCP, plus your own code
Licence / statusApache-2.0. v1 and v2 both publishedApache-2.0. Specification and SDK samplesIETF Internet-Drafts. draft-solana-charge-00 published 2026-09-09, expires 2027-03-13n/a
MaturityLive traffic, small average payments. Governance formalized July 2026Specification and reference samples; repository last updated June 2026Drafts actively published; pay.sh treats it as one of two live standards on SolanaWorks today, interoperates with nothing
Where it's deployedMetered APIs, pay-per-call inference, micropayment paywallsDemo scenarios in Python, Go and Android; no broad merchant deployment publishedpay.sh CLI; Solana and Tempo ecosystemsInternal agents where both sides are yours

Three points that the table can obscure:

AP2 is not an alternative to x402. Its own overview describes it as an extension for A2A, MCP and UCP. It answers "what verifiable proof shows the user granted this agent authority to make this purchase," using Mandates — signed credentials with defined types (mandate.checkout.1, mandate.payment.1) that a user approves on a trusted surface and delegates to the agent. A verifier challenges the agent, the agent presents the mandate, and the verifier returns a receipt. An agent can hold an AP2 mandate and settle over x402.

MPP's main design difference from x402 is that it does not invent headers. It is built on a Payment HTTP authentication scheme, so the exchange is an ordinary HTTP auth challenge. That buys compatibility with existing HTTP tooling — proxies, auth middleware, caches — at the cost of expressing payment semantics inside a framework designed for identity. x402 does the opposite. Reasonable engineers disagree about which is better.

Plain MCP tool-calling with a funded wallet is what most agents actually do today, and it is worth naming as the baseline rather than dismissing it. It works, it needs no protocol, and it is entirely adequate when the agent and the service are both yours. It gives you nothing when they are not: no standard challenge, no receipt, no way for an unknown service to charge an unknown agent.

How mature is x402, really?

x402 has the most momentum of the three, and it is still early. Both things are true and it is worth being precise about which.

The x402.org dashboard reported the following for the trailing 30 days, retrieved September 13, 2026:

MetricTrailing 30 days
Transactions75.41M
Volume$24.24M
Buyers94.06K
Sellers22K

That is real usage. It is also an average of roughly $0.32 per transaction — a micropayment profile consistent with API metering and pay-per-call inference, not with commerce. Anyone citing x402 transaction counts next to card-network volume is comparing different things.

Two more honest signals. The v1/v2 header split above is unresolved interop friction. And the vendor field is thinner than the announcement list suggests: several vendor x402 repositories have not been touched in roughly six months, which is a long time in a protocol that shipped a new major spec version in that window.

None of that argues against building on it. It argues for pinning a spec version, testing against the facilitator you will actually use, and not assuming any two implementations interoperate because both say "x402."

What an agent needs underneath a payment protocol

A payment protocol tells an agent how to pay. It says nothing about whether the agent should. Every one of these protocols assumes four things already exist below it, and that layer is where autonomous spending actually goes wrong.

A funded account the agent controls. Not a shared treasury key. One account per agent, so you can attribute, rate-limit and revoke each independently. For the exact scheme on EVM the payer signs off-chain, so the account needs the stablecoin but not gas — though it will need gas or sponsorship for anything that touches the chain directly.

Signing authority scoped to the job. The agent should hold authority to sign a bounded set of operations, not custody of a key that can sign anything. Scope means specific contracts, specific methods, a spend ceiling, and a time window. The practical test: if the agent's process is compromised, what is the worst single transaction it can produce?

A spend policy enforced before the signature exists. Checking spend after the fact is accounting, not control. The policy has to run at the point of signing and refuse to produce the signature. It should be fail-closed — if no rule matches, deny — because an allowlist that defaults to permit is not an allowlist.

An audit trail. Every signature, what it authorized, which policy admitted it, and when. This is what makes an incident investigable and what AP2's mandate-and-receipt model is trying to standardize at the protocol level.

x402 deliberately leaves all four out of scope — its specification excludes client-side budget management and session handling. That is the right call for a wire protocol and it means the wallet layer has to supply them.

Openfort's agentic wallets implement this as backend wallets plus signing policies, where policy evaluation is fail-closed and runs automatically on every operation. See also agent permissions and identity and how to build an agent wallet.

Implementing x402 with Openfort

Openfort does not ship an x402 module in its SDK. It documents x402 as a recipe built on the standard embedded and backend wallet APIs, with source in recipes-hub. That distinction matters if you are comparing vendors: Thirdweb and Privy ship x402 helpers inside their main SDKs, which is a shorter path for the common case.

EVM: signing the payment authorization from a backend wallet

The exact scheme on EVM asks the payer for an EIP-712 TransferWithAuthorization signature (EIP-3009). It is an off-chain signature, so the agent's wallet never needs ETH. Fetch the backend wallet, then sign the authorization the server asked for:


_29
import Openfort from '@openfort/openfort-node'
_29
_29
const openfort = new Openfort(process.env.OPENFORT_SECRET_KEY!, {
_29
walletSecret: process.env.OPENFORT_WALLET_SECRET!,
_29
})
_29
_29
const account = await openfort.accounts.evm.backend.get({
_29
id: process.env.OPENFORT_BACKEND_WALLET_ID!,
_29
})
_29
_29
// `requirements` is one entry from the server's `accepts` array.
_29
const signature = await account.signTypedData({
_29
domain: {
_29
name: requirements.extra?.name ?? 'USD Coin',
_29
version: requirements.extra?.version ?? '2',
_29
chainId: NETWORK_CHAIN_ID[requirements.network],
_29
verifyingContract: getAddress(requirements.asset),
_29
},
_29
types: TRANSFER_WITH_AUTHORIZATION_TYPES,
_29
primaryType: 'TransferWithAuthorization',
_29
message: {
_29
from: account.address,
_29
to: getAddress(requirements.payTo),
_29
value: BigInt(requirements.maxAmountRequired),
_29
validAfter,
_29
validBefore,
_29
nonce,
_29
},
_29
})

The signed payload is base64-encoded into the payment header and sent back with the retried request. Gas is covered one of two ways, and they are mutually exclusive: an Openfort fee sponsorship (the backend wallet is upgraded to an EIP-7702 delegated account and the transaction runs through a paymaster), or the Coinbase CDP facilitator, which verifies the off-chain signature and pays gas to submit transferWithAuthorization itself. The recipe covers USDC on Base and Base Sepolia.

Bound the wallet with a signing policy before it signs anything in production. Openfort policies are account- or project-scoped and fail closed:


_12
const guardrail = await openfort.policies.create({
_12
scope: 'account',
_12
accountId: agentWallet.id,
_12
rules: [
_12
{
_12
action: 'accept',
_12
operation: 'signEvmTypedData',
_12
criteria: [{ type: 'evmNetwork', operator: 'in', chainIds: [8453] }],
_12
},
_12
{ action: 'reject', operation: 'sendEvmTransaction' },
_12
],
_12
})

Solana: the signer Solana Foundation publishes

On Solana the integration is upstream rather than in Openfort's own repo. Solana Foundation's solana-keychain includes an Openfort backend-wallet signer in Rust, TypeScript and Python, published on npm as @solana/keychain-openfort. It calls Openfort's POST /v2/accounts/backend/{accountId}/sign endpoint with an ES256 x-wallet-auth JWT and resolves the wallet's Solana address at initialization:


_10
import { createOpenfortSigner } from '@solana/keychain-openfort'
_10
import { signTransactionMessageWithSigners } from '@solana/transactions'
_10
_10
const signer = await createOpenfortSigner({
_10
accountId: process.env.OPENFORT_ACCOUNT_ID!, // acc_<uuid>
_10
secretKey: process.env.OPENFORT_SECRET_KEY!, // sk_test_* / sk_live_*
_10
walletSecret: process.env.OPENFORT_WALLET_SECRET!,
_10
})
_10
_10
const signed = await signTransactionMessageWithSigners(transactionMessage, [signer])

Because it satisfies the standard signer interface, it works anywhere a Solana signer is accepted — including x402 and MPP client paths.

pay.sh: the CLI path, and an honest status note

pay is Solana Foundation's CLI for agentic payments. It wraps another command, detects a 402 challenge, prepares and signs the stablecoin transaction, and retries — so an agent session gets paid API access without any protocol code of its own:


_10
pay curl https://debugger.pay.sh/mpp/quote/AAPL
_10
pay claude # run an agent session with pay injected

An open pull request, #423, adds Openfort backend wallets as a keystore backend so pay can sign remotely instead of holding a local keypair. It is still open as of September 13, 2026 and has not been merged, so a released pay binary cannot use it. The underlying signer it depends on is merged and published — that is the @solana/keychain-openfort package above — but the CLI wiring is not. Treat the CLI path as pending, not available.

Provider support for agent-payment rails

Verified on September 13, 2026 by inspecting each vendor's published repositories, SDK packages and documentation. A blank cell means no first-party support was found at that date — not that support is impossible, and not that a vendor's wallet cannot be used with the protocol through generic signing. Vendors are listed alphabetically.

Providerx402AP2MPPForm it ships in
AlchemyYesalchemy-x402 repository; last updated March 2026
Coinbase (CDP / AgentKit)YesCreated the protocol; operates a facilitator at api.cdp.coinbase.com/platform/v2/x402
CrossmintPartialDemo and starter repo crossmint-agentic-finance; last updated March 2026
Dynamic
OpenfortYesPartialx402 as a documented recipe (embedded + backend wallets, USDC on Base). MPP/Solana via @solana/keychain-openfort, published by Solana Foundation; pay CLI keystore PR still open
PrivyYesx402 module in the Node SDK, with tests
ThirdwebYesx402 module exported from the main SDK, plus a docs section
TurnkeyNot verified — see note below

Two caveats on reading this table. Turnkey's row is blank because we could not complete the check, not because we confirmed an absence; treat it as unknown. And "Yes" measures published first-party support, not quality or production-readiness — Coinbase's row and Alchemy's row are both "Yes" and are not remotely the same thing.

The AP2 column being empty across every wallet vendor is the real finding here. AP2 targets merchants, issuers and payment processors rather than wallet infrastructure, so its absence from this table is a statement about scope, not about adoption.

Choosing between them

  • Metering an API for machine clients, including agents you do not control. x402. It has the governance, the transports and the facilitator ecosystem, and exact and upto cover most metering shapes.
  • Settling on Solana, or already in the Solana toolchain. Either x402 or MPP; pay supports both. MPP's Token-2022 confidential-transfer support is the differentiator if amounts need to be private.
  • A merchant, bank or processor needs to know who authorized a purchase. AP2, layered over whichever settlement rail you use. This is a liability question, and no settlement protocol answers it.
  • Both ends of the transaction are yours. Plain MCP tool-calling with a policy-bounded wallet. Adopt a protocol when you need to transact with someone you have not integrated with.

Whichever you pick, the wallet controls underneath matter more than the protocol choice — those are the part that stops an agent from spending what it should not, and none of these protocols provide them.

Share this article

Related Articles

  1. Best Mass Payout and Global Payroll Platforms for Stablecoins

    Openfort, Triple-A, NOWPayments, BVNK, and Stripe compared on batch throughput, corridor coverage, fiat off-ramps, gas sponsorship, and compliance reporting.

  2. Wallet policy engines compared: Openfort, Privy, Turnkey, Fireblocks, Crossmint

    Spending limits, allowlists, session keys, enforcement point and audit-trail export compared across five wallet policy engines, on documented evidence.

  3. Key Management Solutions for Crypto Wallets: TEE vs MPC vs Shamir vs HSM

    A vendor-by-vendor comparison of non-custodial key management architectures — TEE, MPC, Shamir secret sharing, device enclaves and HSM — with every claim sourced from the vendor's own docs.

Ship your first wallet in minutes