chaincost — pay-per-call primitives for agents (x402 / HTTP 402, USDC on Base) PRICED ROUTES (no account, no API key: the payment is the key) $0.002 GET https://chaincost-x402-production.up.railway.app/v1/gas Cross-chain gas quote: live gas price and USD cost of one native transfer across Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain and Avalanche, plus the cheapest chain right now. $0.001 GET https://chaincost-x402-production.up.railway.app/v1/random Verifiable randomness: the latest drand League of Entropy beacon round, plus a sha256 value derived from it and an optional nonce, with the exact formula so any third party can recompute it. $0.002 GET https://chaincost-x402-production.up.railway.app/v1/btc-fees Bitcoin fee tiers (sat/vB) for the next block, half hour, hour and economy, mempool depth, and the satoshi cost of a standard 1-in/1-out segwit spend. $0.01 POST https://chaincost-x402-production.up.railway.app/v1/extract POST {"url":"https://..."} and get the page back as clean Markdown (title + text, tags and scripts stripped), capped at 2MB download and a caller-set character limit. $0.005 GET https://chaincost-x402-production.up.railway.app/v1/token-risk GET /v1/token-risk?token=0x...&chain=base — token market & contract risk facts: live DEX liquidity, price, FDV, 24h volume, pool count and pair age (DexScreener) plus holder count, verification status and spam labelling (Blockscout), with a low/medium/high/extreme risk rating. Tax and honeypot simulation are deliberately not performed — those fields are returned as null rather than guessed. $0.003 GET https://chaincost-x402-production.up.railway.app/v1/portfolio-risk GET /v1/portfolio-risk?wallet=0x... — wallet holdings & risk profile: real ERC-20 balances per chain from public Blockscout indexes, USD values from explorer rates, DEX liquidity checks on the largest holdings, concentration, and an overall risk level (low/medium/high/extreme). Covers Ethereum, Base, Arbitrum, Optimism and Polygon. FREE ROUTES GET https://chaincost-x402-production.up.railway.app/health liveness GET https://chaincost-x402-production.up.railway.app/pricing machine-readable price list GET https://chaincost-x402-production.up.railway.app/.well-known/x402 x402 discovery manifest (v2) GET https://chaincost-x402-production.up.railway.app/openapi.json OpenAPI 3.1 description GET https://chaincost-x402-production.up.railway.app/llms.txt this document HOW TO PAY (any x402 client; curl plus a wallet works) 1. Call a priced route. You get HTTP 402 with the offer: scheme "exact", network eip155:8453, asset USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0x3893efb327fd381e85d70c29021b7a1901221fd2, amount in atomic units (6 decimals), and a maxTimeoutSeconds window. 2. Sign an EIP-3009 TransferWithAuthorization for that offer. No gas; you broadcast nothing. EIP-712 domain: name "USD Coin", version "2", chainId 8453, verifyingContract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. 3. Retry the same request with the signed payload base64-encoded in "X-PAYMENT" (protocol v1) or "PAYMENT-SIGNATURE" (protocol v2). 4. Settlement is submitted by the facilitator https://facilitator.ultravioletadao.xyz, the resource is returned, and the tx hash comes back in "X-PAYMENT-RESPONSE" (v1) or "PAYMENT-RESPONSE" (v2). SETTLEMENT AND TRUST Funds move buyer -> 0x3893efb327fd381e85d70c29021b7a1901221fd2 in one on-chain USDC transfer on Base. This server holds no keys, no gas and no custody, and it never serves a paid route before the facilitator reports success. A rejected payment gets another 402 carrying the reason; a facilitator that cannot decide gets you a 503, and you are not charged. Answers are computed before settlement, so an upstream failure costs the buyer nothing.