{"uid":"cap_QfcnbqsEJqyx6SfhKeeNx","slug":"agenttools-gas-fee-calculator-c171dd93","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://agentstoolshub.com/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.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ehwETLmYuevyNQBoGk4UG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","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 ETH and USD from gas units, gas price in gwei, and current ETH price using exact BigInt math","exampleAgentPrompt":"How much will an Ethereum transaction cost if it uses 21000 gas units at 35 gwei, and ETH is currently priced at $3200?","exampleUseCases":[{"title":"Pre-flight ETH transfer cost check","prompt":"Before I send that ETH transfer, can you tell me what the gas fee will cost in dollars? It's a standard transfer so 21000 gas units, the network is at 42 gwei right now, and ETH is $2800."},{"title":"Smart contract interaction fee estimate","prompt":"I'm about to call a smart contract that uses about 150000 gas units. Gas price is 18 gwei and ETH is trading at $3500 — what will that cost me in ETH and USD?"},{"title":"DeFi swap cost before execution","prompt":"What's the total transaction fee in USD for a Uniswap swap that's estimated at 200000 gas units, gas is 60 gwei, and ETH is $2500?"}],"resultDescription":"Returns the computed gas fee expressed both as an ETH amount (using precise BigInt/wei arithmetic) and as a USD dollar amount, derived from gas units × gas price (gwei) × ETH/USD price","failureModes":["Missing required query parameters (gasUnits, gweiPrice, ethPriceUsd) returns an error","Non-numeric or negative parameter values may cause validation errors","Extremely large gas unit values may cause unexpected computation behavior","API returns HTTP 402 if payment is not provided or the x402 payment flow fails"],"whenToPreferThis":"Use this endpoint when an agent or user needs a precise, arithmetic conversion of Ethereum gas units and gwei price into ETH and USD cost — especially when exact BigInt wei-level accuracy matters rather than a rough estimate. Prefer this over manual calculation or LLM estimation when correctness in financial contexts is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T12:50:46.161Z","isFirstParty":false,"canonicalSlug":"agenttools-gas-fee-calculator-c171dd93"}