x402 is an open payment standard that reuses the existing HTTPDocumentation Index
Fetch the complete documentation index at: https://docs.hedera.com/llms.txt
Use this file to discover all available pages before exploring further.
402 Payment Required status code to let a server ask for payment, and let a client pay, inside an ordinary HTTP request/response cycle. It turns a payment into something a client can satisfy as easily as it follows a redirect — no checkout page, account signup, or API-key dance required.
Hedera contributes its own exact payment scheme and a reference implementation to the official x402 repository, so applications and AI agents can settle payments in HBAR or HTS tokens over x402 with the speed and low, predictable fees of the Hedera network.
For the background story and Hedera’s perspective on why this matters, read the announcement: Hedera and the x402 Payment Standard.
What x402 actually is (and what it is not)
x402 is best understood as the missing payment layer of the web: HTTP can move information instantly, but it has never had a native, standardized way to move money. x402 fills exactly that gap — and nothing more. It is easy to over-read x402 as a magic switch that suddenly lets “agents use crypto” for anything. The real scope is much narrower then that and spans multiple use-cases.What x402 IS
- An HTTP-native standard for a single, discrete request → pay → response handshake
- Stateless and per-request — each payment is self-verifying, with no billing session or subscription
- Settlement-agnostic — works across chains and assets; on Hedera it settles in HBAR or HTS tokens
- A shared rulebook so any wallet or service can negotiate value the same way it negotiates data
What x402 is NOT
- Not a blockchain or a new payment network — it lives on top of existing rails
- Not a custodial processor — facilitators verify and submit, but can never move funds without a signed authorization
- Not for streaming or multi-hop routing — it is optimized for discrete request/response cycles, not continuous value flows
- Not a general “agentic wallet” — it is one well-scoped primitive, not an autonomy framework
Who uses it and what it is useful for
x402 shines whenever value needs to change hands per request, at machine speed, without a human in the loop:- AI agents paying for API calls, context, datasets, inference, or tool use on demand
- Paid APIs and per-request metering — bill for exactly what is consumed instead of selling subscriptions or API keys
- Pay-per-view digital content — articles, reports, research papers, sensor feeds, OCR, translations
- Micropayments at internet scale — amounts too small to justify a checkout flow or a card fee
How it works
x402 adds a short negotiation loop on top of a normal HTTP request. On Hedera, the distinguishing detail is the fee-payer model: the client signs a transfer of value, and the facilitator adds its signature, pays the network fee, and submits the transaction. The merchant never has to run blockchain infrastructure or hold gas.Client requests a protected resource
The client makes an ordinary request to a resource server (for example,
GET /weather).Server responds with 402 Payment Required
The server replies with HTTP
402 and a set of PaymentRequirements describing how much to pay, in which asset, to which account, and which feePayer (the facilitator) will sponsor fees.Client builds and partially signs a transfer
The client constructs a Hedera
TransferTransaction that moves the requested asset to the payTo account, sets the transaction’s payer account to the feePayer, signs it, and Base64-encodes it into a PaymentPayload.Server forwards to the facilitator's /verify
The resource server passes the payload to a facilitator, which validates the transaction structure, asset, amount, and destination before anything is submitted on-chain.
Facilitator settles via /settle
Once verified, the facilitator adds its signature as fee payer, pays the gas, and submits the transaction to Hedera, then returns a settlement result.
Hedera’s exact scheme
Hedera’s contribution to x402 is the exact scheme, which pays a precise amount of HBAR or an HTS fungible token. It is defined in the official spec and ships with a reference TypeScript implementation.
Scheme specification
scheme_exact_hedera.md in the x402 specs — the authoritative definition of the Hedera scheme.Reference implementation
The
@x402/hedera package in the official x402 monorepo.| Property | Detail |
|---|---|
| Protocol version | x402Version: 2 |
| Networks | hedera:mainnet, hedera:testnet (CAIP-2 identifiers) |
| Assets | Native HBAR (entity ID 0.0.0) or any HTS fungible token (by entity ID) |
| Amounts | HBAR in tinybars (1 HBAR = 10⁸ tinybars); HTS tokens in their smallest unit per decimals |
| Fee model | A facilitator acts as feePayer, paying network fees and submitting the transaction |
| Transaction | A direct, partially-signed TransferTransaction (no ScheduleCreate wrapping) |
The payment messages
The server advertisesPaymentRequirements, including the facilitator’s feePayer in extra:
PaymentRequirements
PaymentPayload carrying the Base64-encoded, partially-signed transaction:
PaymentPayload
SettlementResponse
Because the facilitator pays the fee, the spec requires it to verify that the
feePayer is never a net sender of value, that net HBAR/token transfers balance to zero, that the amount credited to payTo matches exactly, and that the transaction has not been submitted before (replay protection). These checks protect the facilitator from being drained while sponsoring fees.Implementing it
The@x402/hedera package implements the scheme for both client and resource server.
Client — register the Hedera scheme with a signer for your account:
client.ts
server.ts
facilitatorClient points at a facilitator that supports Hedera (see below). The resource server uses it to /verify and /settle payments without holding funds or running its own node.
Requirements and limitations
- A facilitator that supports Hedera is required to verify and submit transactions. You can use a hosted one or run your own.
- The client account must be funded with the asset being paid (HBAR or the relevant HTS token), and for HTS tokens it must be associated with that token.
- Settlement is per-request and discrete. x402 is not built for streaming payments or multi-hop routing across ledgers.
- No native privacy — amounts, accounts, and transfers are visible on the public Hedera ledger.
- Facilitator concentration is a real risk. If most traffic flows through a few facilitators, the network starts to look like traditional payment infrastructure — a reason to encourage many independent Hedera facilitators.
- Alias / auto-account-creation policy: when
payTois an alias (EVM address or public key), a transfer can trigger auto-account creation that the facilitator funds. Each facilitator sets and documents its own policy (alloworreject; the reference implementation defaults toreject).
Hedera facilitators
Blocky402
Blocky402 is an open x402 facilitator that supports Hedera, so you can wire up x402 payments on Hedera without standing up your own infrastructure first. Its testnet facilitator is live with open access (no API key required).| Value | |
|---|---|
| Facilitator base URL (testnet) | https://api.testnet.blocky402.com |
| Capability discovery | GET /supported |
| Verify endpoint | POST /verify |
| Settle endpoint | POST /settle |
| Hedera network | hedera:testnet |
| Advertised fee payer | 0.0.7162784 |
| Documentation | blocky402.com/docs (quickstart, API reference, networks) |
hedera:testnet among the supported kinds, along with the fee-payer account the facilitator will sponsor. Mainnet support is rolling out and will require an API key.
Run your own Hedera facilitator
x402 is permissionless: any team can operate a facilitator, and the more independent Hedera facilitators there are, the healthier the network. Below are the steps to follow to stand one up for yourself:Implement the exact Hedera scheme
Use the
@x402/hedera reference implementation and the scheme spec to handle verification and settlement.Fund and configure a fee-payer account
Provision a Hedera account that will act as the
feePayer, sponsoring network fees and submitting transactions on behalf of clients.Expose the standard endpoints
Serve
GET /supported, POST /verify, and POST /settle. Advertise hedera:mainnet and/or hedera:testnet (and your fee-payer account) from /supported so clients can discover you.Get listed as a Hedera facilitator
Once your facilitator is live and supports Hedera:- Be discoverable across the ecosystem by listing in the broader x402 directories such as the x402 ecosystem directory and x402scan facilitators.
- Be listed here as a Hedera facilitator by opening a pull request against the Hedera docs repository that adds your facilitator (base URL, supported Hedera networks, fee-payer account, and documentation link) to this page.
Resources
Hedera and the x402 Payment Standard
Hedera’s announcement blog covering the what and why.
Hedera exact scheme spec
The authoritative definition of the Hedera scheme.
@x402/hedera reference implementation
The official TypeScript package for client and server.
x402 whitepaper
The protocol’s design and rationale.
x402: The Missing Payment Layer of the Web
Blocky Research’s deep-dive report on x402’s scope, users, and limits.
Blocky402 facilitator
An open x402 facilitator with Hedera support.