{"uid":"cap_-ebvrMaqqXO3v89hlZgxS","slug":"gas-cost-in-ether-ae1d8844","name":"Gas Cost in Ether","description":"Compute total gas cost in ether from used gas and price wei. Call when budgeting ETH spend for a planned or observed transaction. Returns gas cost in eth as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/gas-cost-eth","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"gas_used":{"type":"integer","description":"Input field: gas used."},"gas_price_wei":{"type":"string","description":"Input field: gas price wei."}}},"responseSchema":{"type":"json","example":{"schema":"delx/util-gas-cost-eth/v1","cost_eth":0.000021,"cost_wei":"21000000000000","gas_used":21000,"gas_price_wei":"1000000000"}},"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_mdmRLH8L7SsTDmN9C3O-y","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":"Computes total Ethereum transaction gas cost in ETH from gas used and gas price in wei using deterministic local math.","exampleAgentPrompt":"What's the total ETH cost for a transaction that uses 21000 gas at a gas price of 15000000000 wei?","exampleUseCases":[{"title":"Pre-flight transaction cost check","prompt":"Before I submit this swap, tell me the total ETH gas cost — it'll use 150000 gas at 12 gwei (12000000000 wei)."},{"title":"DeFi bot gas budget enforcement","prompt":"My bot just observed a transaction that consumed 200000 gas at 8500000000 wei. What was the ETH gas cost so I can log it against my daily budget?"},{"title":"Gas fee transparency for user UI","prompt":"A user is about to sign a contract deployment using 500000 gas at 20000000000 wei gas price — what's the total fee in ETH I should show them?"}],"resultDescription":"A deterministic JSON response containing the computed gas cost in ETH, derived purely from the formula gas_used × gas_price_wei / 1e18. No external data sources or network calls are involved; the result is exact given the inputs.","failureModes":["Missing or invalid gas_used (non-integer) returns an error","Missing or malformed gas_price_wei (non-numeric string) returns an error","Payment not fulfilled (x402 protocol) results in 402 response blocking the computation","Extremely large values may cause precision issues depending on implementation"],"whenToPreferThis":"Choose this endpoint when you need a fast, cheap, self-contained conversion from raw gas parameters (gas used + gas price in wei) to ETH cost, without needing live gas price data, RPC access, or market feeds. Ideal for budgeting pipelines, transaction logging, and UI display layers where the gas values are already known and only the ETH denomination is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:59:54.840Z","isFirstParty":false}