
Fare
Pay-per-request APIs on Hedera: lookups and AWS jobs, priced in HBAR via x402.
Demo
About
Fare sells two paid APIs on Hedera. Agents pay HBAR per HTTP request using x402 / Blocky402. Price scales with the ask. Lookups return live Hedera account summaries and recent transactions from the public Mirror Node. One unit is 0.001 HBAR. Asking for more rows costs more (limit=25 is 4 units). Jobs accept a short Node.js script. AWS Lambda runs it and returns stdout, stderr, and exit code. Timeout meters the price. There is no UI. A small client handles 402, signs a Hedera transfer, and retries. After settle we optionally write account, amountTinybars, and txId to HCS topic 0.0.10320508 as a public receipt. Live: https://fare-production.up.railway.app Repo: https://github.com/ducnmm/fare402 Video: https://youtu.be/p7db4KH2slc
How it's made
Resource server is Express plus @x402/express and ExactHederaScheme from @x402/hedera. We do not run a facilitator. Quotes and settlement go through Blocky402 (https://api.testnet.blocky402.com). Amounts are native HBAR (asset 0.0.0) in tinybars, not USDC. Lookups proxy Hedera Mirror Node REST, retry on 502/timeout, and page transaction lists in chunks of 25. Jobs invoke AWS Lambda (Node 22) via @aws-sdk/client-lambda when AWS_SANDBOX_LAMBDA_ARN is set. FARE_JOB_LOCAL=1 is a local child_process fallback for development only. The paying client wraps fetch with @x402/fetch, registers ExactHederaScheme, and sets spend controls to HBAR. HCS audit is fire-and-forget so a hung topic submit cannot block PAYMENT-RESPONSE. Merchant is deployed on Railway. Secrets stay in a gitignored .env. The repo was created during this event and is public at https://github.com/ducnmm/fare402.