{"uid":"cap_xNR0-0fwXExg20J7Wb3VM","slug":"agenttools-gas-fee-calculator-76979770","name":"AgentTools Gas Fee Calculator","description":"Calculate a transaction's gas fee: gas units × gas price (gwei) gives the ETH cost, multiplied by the ETH price for USD. Exact BigInt math for the wei amounts. Use this when an agent needs to transaction cost in ETH and USD from gas × gwei.","url":"https://agenttools-hub.vercel.app/api/v1/crypto/gas-fee-calculator?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","required":["gasUnits","gweiPrice","ethPriceUsd"],"properties":{"gasUnits":{"type":"number","description":"Gas units"},"gweiPrice":{"type":"number","description":"Gas price (gwei)"},"ethPriceUsd":{"type":"number","description":"ETH price (USD)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JXxhn4UrwkW-j3t2XWt4L","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates Ethereum transaction cost in both ETH and USD from gas units, gas price in gwei, and current ETH price using exact BigInt arithmetic.","exampleAgentPrompt":"What will this Ethereum transaction cost me? It uses 21000 gas units at a gas price of 30 gwei, and ETH is currently trading at $3200.","exampleUseCases":[{"title":"Estimating ETH transfer cost","prompt":"I'm about to send some ETH to a friend — the wallet says it needs 21000 gas units at 25 gwei and ETH is $3500 right now. What will that transaction cost me in dollars?"},{"title":"Smart contract interaction cost check","prompt":"Before I call this smart contract, can you tell me how much it'll cost? It's going to use 150000 gas units at 40 gwei, and ETH is currently at $2800."},{"title":"DeFi swap fee estimation","prompt":"I want to know the total fee for a Uniswap token swap — the swap uses 200000 gas units, the network gas price is 50 gwei, and ETH is at $3100 right now. Give me the cost in both ETH and USD."}],"resultDescription":"Returns the transaction gas fee expressed in ETH and USD, computed using exact BigInt arithmetic on the wei-level amounts (gasUnits × gweiPrice × 1e9 for wei, converted to ETH and then to USD via the provided ETH price).","failureModes":["Missing required query parameters (gasUnits, gweiPrice, or ethPriceUsd) returns a 400 error","Non-numeric or negative values for gas parameters may return validation errors","Extremely large gas unit values may cause unexpected precision issues depending on the server's BigInt implementation","Network or server errors on the Vercel host return 500-level responses"],"whenToPreferThis":"Use this endpoint when you need a precise, BigInt-accurate gas fee calculation in both ETH and USD and you already have the gas units, gwei price, and ETH/USD price on hand. It is ideal for AI agents that need to display transaction cost estimates to users before they approve a blockchain transaction, especially when precision at the wei level matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:41:32.680Z","isFirstParty":false,"canonicalSlug":"agenttools-gas-fee-calculator-76979770"}