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.

Loading APIs…

Payment Flow — Live

Current Step

Waiting to start

clientstep 1

Fetch HTS Identity

Query mirror node for the agent's NFT passport (ERC-8004)

clientstep 2

GET /api/protected/

Client sends initial request — no payment header yet

serverstep 3

402 Payment Required

Server responds: payTo, amount, network, sponsorAccountId

clientstep 4

Parse payment requirements

Extract recipient, amount in tinybars, sponsorship info

clientstep 5

Sign HTS Transfer

Build USDC HTS TransferTransaction, sign with ECDSA private key

clientstep 6

GET + Payment header

Retry with serialised signed transaction in header

serverstep 7

Facilitator verifies payment

Server decodes & validates the Hedera transaction on-chain

serverstep 8

Settle on Hedera blockchain

Facilitator broadcasts transaction; Hedera finalises in ~3s

clientstep 9

200 OK — Resource delivered

Protected resource returned to the client