{"uid":"cap_3KYPq6JG0A9_5nrGeAYIV","slug":"gas-cost-comparison-across-evm-chains-5ba25e62","name":"Gas Cost Comparison Across EVM Chains","description":"Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.","url":"https://kr-x402-mvp.kgy5612.workers.dev/api/gas-compare?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"gas":{"type":"integer","maximum":30000000,"minimum":21000,"examples":[200000],"description":"Optional custom gas units; result sorted by custom_usd"},"chains":{"type":"string","examples":["base,ethereum,arbitrum"],"description":"Comma list subset of base,ethereum,arbitrum,optimism,polygon,bsc (default all)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"chains":[{"chain":"base","native":"ETH","chain_id":8453,"swap_usd":0.0011,"upstream":"https://base.drpc.org","latency_ms":80,"native_usd":3850.1,"transfer_usd":0.000154,"gas_price_gwei":0.0019,"erc20_transfer_usd":0.000476,"rollup_l1_fee_extra":true}],"cheapest":"base","gas_units":{"swap":150000,"transfer":21000,"erc20_transfer":65000},"sorted_by":"swap_usd","updated_at":"2026-10-30T01:30:00Z","recommendation":"Execute on base (~180x cheaper than Ethereum L1); ...","cheapest_swap_usd":0.0011,"ethereum_vs_cheapest_x":180}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8rZ3t0aumgtEh-QO7uYzi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns real-time gas prices and USD transaction costs for common EVM operations (transfer, ERC-20, swap) across major chains, with a cheapest-chain recommendation.","exampleAgentPrompt":"What's the cheapest chain to do a token swap on right now — compare Base, Ethereum, and Arbitrum and tell me the gas cost in USD for a 200,000-gas swap.","exampleUseCases":[{"title":"Cheapest chain routing for DeFi bot","prompt":"Before I execute this swap, check which chain — Base, Arbitrum, or Optimism — has the lowest gas cost for a 150,000-gas swap right now and tell me the USD cost."},{"title":"Gas budget estimation for agent wallet","prompt":"How much will it cost in USD to do an ERC-20 transfer on Base versus Ethereum today? I need to know before I move tokens."},{"title":"Multi-chain cost dashboard for trading agent","prompt":"Pull the current gas prices across all supported EVM chains and tell me which one is cheapest for swaps, and how many times cheaper it is than Ethereum mainnet."}],"resultDescription":"A JSON object containing per-chain gas prices (in gwei and USD) for standard operations (ETH transfer, ERC-20 transfer, swap), the cheapest chain, a multiplier showing how much cheaper it is than Ethereum L1, the ETH/USD price used, upstream RPC latency, an L1 rollup fee flag, and a plain-English recommendation string. Updated in near real-time.","failureModes":["Upstream RPC timeout causing stale or missing chain data","Invalid chain name in 'chains' query param returns 400 or ignores unknown chains","Gas units outside allowed range (21000–30000000) rejected","Payment failure via x402 (insufficient USDC balance) blocks the request","Single-chain outage causes that chain to be omitted from results"],"whenToPreferThis":"Use this endpoint when an AI agent needs to make real-time chain-routing decisions based on gas cost — e.g. before executing a swap, transfer, or contract call across multiple EVM networks. Prefer this over static fee estimates when freshness matters. It requires no API key, charges micro-payments via x402 USDC, and is purpose-built for autonomous agents needing machine-readable gas cost comparisons with built-in recommendations.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:41:39.927Z","isFirstParty":false,"canonicalSlug":"gas-cost-comparison-across-evm-chains-5ba25e62"}