x402 Payment Protocol Demo
HTTP 402 on Hedera Blockchain
Select a protected API endpoint, then watch the agent discover the price, sign a Hedera transaction for exactly that amount, and settle on-chain.
Choose an API
Each endpoint has a different price. The exact amount is deducted on payment.
Payment Flow — Live
Current Step
Waiting to start
Fetch HTS Identity
Query mirror node for the agent's NFT passport (ERC-8004)
GET /api/protected/
Client sends initial request — no payment header yet
402 Payment Required
Server responds: payTo, amount, network, sponsorAccountId
Parse payment requirements
Extract recipient, amount in tinybars, sponsorship info
Sign HTS Transfer
Build USDC HTS TransferTransaction, sign with ECDSA private key
GET + Payment header
Retry with serialised signed transaction in header
Facilitator verifies payment
Server decodes & validates the Hedera transaction on-chain
Settle on Hedera blockchain
Facilitator broadcasts transaction; Hedera finalises in ~3s
200 OK — Resource delivered
Protected resource returned to the client