{"uid":"cap_VBnHVrvgcKHhIFJUMbrAe","slug":"x402node-transaction-gas-cost-estimator-93e542c8","name":"x402node Transaction Gas Cost Estimator","description":"Estimate the USD cost of a transaction (transfer, ERC20 transfer, approve, swap, NFT mint) on Base/Ethereum/Arbitrum/Optimism/Polygon from live gas price and native token price - lets agents decide whether an action is worth the fee before sending. gas cost, transaction cost, tx fee usd, how much gas, operation cost, fee estimate","url":"https://api.x402node.dev/chain/tx-cost","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":{"chain":{"type":"string","description":"base (default), ethereum, arbitrum, optimism, polygon"},"gasLimit":{"type":"string","description":"Optional custom gas limit"},"operation":{"type":"string","description":"transfer, erc20transfer, approve, swap (default), nftmint, nfttransfer"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"chain":"base","txType":"transfer","gasLimit":21000},"response":{"note":"Estimated transaction cost = gasPrice × typical gas for the operation × native token price. Helps agents decide if an action is worth the fee. Actual gas may vary with network conditions.","_hint":"x402 paid endpoints for AI agents — x402node.dev (utilities) · cn402.com (Chinese culture)","chain":"base","source":"rpc+defillama","gasLimit":21000,"operation":"swap","estCostUsd":0.0002,"nativeToken":"ETH","gasPriceGwei":0.006,"estCostNative":1.3e-7}},"exampleRequest":{"chain":"base","txType":"transfer","gasLimit":21000},"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_iknIpfDCkqtSqtESybjmb","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Estimates the USD cost of a blockchain transaction (transfer, ERC20 transfer, approve, swap, NFT mint) on Base, Ethereum, Arbitrum, Optimism, or Polygon using live gas prices and native token prices.","exampleAgentPrompt":"Before I do this token swap on Base, can you estimate how much the transaction will cost in USD right now using live gas prices?","exampleUseCases":null,"resultDescription":"Returns an estimated USD cost for the specified transaction type on the chosen EVM chain, derived from live gas prices and the current native token (ETH/MATIC) price. Includes breakdown of gas units, gas price in gwei, native token price, and final USD cost so the agent can decide whether proceeding is economically justified.","failureModes":["Unsupported chain name returns 400 or error","Unsupported transaction type returns 400","RPC or gas oracle unavailable causes 503 or timeout","Native token price feed unavailable causes stale or failed estimate","Invalid parameters return 422 validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to evaluate the economic viability of a blockchain transaction before committing to it — especially for DeFi workflows where gas costs can make small trades unprofitable. Ideal for pre-flight checks on Base, Ethereum, Arbitrum, Optimism, or Polygon. Prefer this over generic gas trackers because it returns a direct USD estimate for specific operation types.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:53:30.994Z","isFirstParty":false}