x402 is an open-source protocol that turns the dormant HTTP 402 Payment Required
status code into a fully-featured, on-chain payment layer for APIs, websites, and autonomous agents.
Traditional rails require credit-card networks, user accounts, and multi-step UI flows.
x402 removes those dependencies, enabling programmatic, HTTP-native payments (perfect for AI agents) while dropping fees to near-zero and settling in ~1 second.
No. Any web API or content provider—crypto or web2—can integrate x402 if it wants a lower-cost, friction-free payment path for small or usage-based transactions.
TypeScript and Python (coming soon) are the reference implementations, but x402 is an open protocol.
Nothing prevents you from implementing the spec in Go, Rust, etc. If you’re interested in building support for your favorite language, please open an issue and let us know, we’d be happy to help!
Coinbase Developer Platform operates the first production facilitator. The protocol, however, is permissionless—anyone can run a facilitator. Expect:
Every x402PaymentPayload
is signed by the buyer and settles directly on-chain.
A facilitator that tampers with the transaction will fail signature checks.
There is no single answer, but common patterns are:
$0.001
per request)/basic
vs /pro
endpoints with different prices)Yes. x402 handles the payment execution. You can still meter usage, aggregate calls, or issue prepaid credits in Metronome and only charge when limits are exceeded. Example glue code is coming soon.
Network | Asset | Fees* | Status |
---|---|---|---|
Base | USDC | fee-free | Mainnet |
Base Sepolia | USDC | fee-free | Testnet |
No. The recommended pattern is:
The current exact
scheme is a push payment—irreversible once executed. Two options:
Agents follow the same flow as humans:
402 JSON (accepts array)
.X-PAYMENT
.Yes. Programmatic wallets (e.g., CDP Wallet API, viem
, ethers-v6
HD wallets) let agents sign EIP-712
payloads without exposing seed phrases.
Tracked in public GitHub issues + community RFCs. Major themes:
upto
, stream
, permit2
)We acknowledge that the repo is primarily under Coinbase ownership today. This is primarily to leverage our best-in-house security and auditing team to ensure the spec is safe and nobody accidentally creates legally ambiguous payment flows. We intend to eventually transfer ownership of the repo to a steering group or open-source committee.
402 Payment Required
, even after attaching X-PAYMENT
. Why?maxAmountRequired
.error
field in the server’s JSON response for details.network: "base"
(not "base-sepolia"
).