Quickstart
Market intelligence, one paid call
The same sourced forecasts, API and payments you see in the dashboard.
Same forecast. Same price.
$0.05 per forecast in USDC or fUSD. Trading runs have a $0.10 cap. Open trading dashboard →
- 01
Ask for the price
Call any endpoint without payment. You get402with aPAYMENT-REQUIREDheader: amount, USDC token, payee. - 02
Sign the USDC transfer
Your client signs a Hedera transfer for exactly that amount and retries withPAYMENT-SIGNATURE. Blocky402 pays the network fee. - 03
Read data + receipt
Sourced JSON and aPAYMENT-RESPONSEreceipt. Paid data is returned only after settlement.
Call it
The same request in three clients. @x402/fetch does steps 1–3 for you.
import { x402Client } from '@x402/core/client'
import { wrapFetchWithPayment, decodePaymentResponseHeader } from '@x402/fetch'
import { ExactHederaScheme } from '@x402/hedera/exact/client'
import { createClientHederaSigner } from '@x402/hedera'
import { PrivateKey } from '@hiero-ledger/sdk'
// Your Hedera account pays USDC (0.0.429274 on testnet); Blocky402 pays the network fee.
const signer = createClientHederaSigner(process.env.HEDERA_ACCOUNT_ID!, PrivateKey.fromStringECDSA(process.env.HEDERA_PRIVATE_KEY!), { network: 'hedera:testnet' })
const client = x402Client.fromConfig({ schemes: [{ network: 'hedera:testnet', client: new ExactHederaScheme(signer) }] })
const paidFetch = wrapFetchWithPayment((input, init) => globalThis.fetch(input, init), client)
const res = await paidFetch('https://finality.accuracy.wtf/api/x402/v1/quant/forecast', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({"symbol":"HBAR","horizonMinutes":30,"riskProfile":"balanced"}),
})
const { data, meta } = await res.json() // $0.05 USDC, paid only if the call succeeds
const receipt = decodePaymentResponseHeader(res.headers.get('PAYMENT-RESPONSE')!)
console.log(data, meta.sources, receipt.transaction)Get testnet USDC
Create a Hedera testnet account (HashPack or the portal faucet), associate the USDC token 0.0.429274, and fund it with testnet USDC. HBAR is only needed if you submit your own transactions; the facilitator pays x402 fees.
Use your wallet
HashPack pays USDC; MetaMask and email wallets pay fUSD on Hedera EVM. The price is the same.
Built for agents too
Ask GET https://finality.accuracy.wtf/api/x402/v1/suggest?need=… for free to find the cheapest endpoint that answers a need, add ?format=compact for numbers-only responses, and read x-finality-latency-ms to budget for speed. See Discovery & A2A.
Errors and retries
| Status | Meaning | Charged? |
|---|---|---|
| 402 | Payment required: read the terms and sign | No |
| 400 | Invalid input; the body explains which field | No |
| 503 | Service unavailable. If settlement is uncertain, reconcile before retrying payment. | Check receipt |
| 200 | Data + PAYMENT-RESPONSE receipt | Yes, once |