{"uid":"cap_iK6jsUA_3z7ITQ80Np4H9","slug":"gas-cost-in-wei-bb3a8e60","name":"Gas Cost in Wei","description":"Compute gas_used × gas_price as total gas cost in wei. Call when estimating tx cost from known used gas and price without a node. Returns gas cost wei string 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-wei","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-wei/v1","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_ju-dhFbM7kn-Sr_Bl_m8e","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 gas cost in wei by multiplying gas_used by gas_price_wei using pure local arithmetic, no RPC or node required.","exampleAgentPrompt":"What's the total gas cost in wei for a transaction that used 21000 gas at a gas price of 10000000000 wei?","exampleUseCases":[{"title":"Estimate transaction fee offline","prompt":"I sent a transaction that used 52000 gas and the gas price was 15000000000 wei — what was the total cost in wei?"},{"title":"DeFi bot pre-trade cost check","prompt":"Before I submit this swap, calculate the total gas cost in wei if I expect to use 120000 gas at a gas price of 8000000000 wei."},{"title":"Post-execution accounting","prompt":"I need to log the exact gas expenditure in wei for a contract call that used 84000 gas at 12500000000 wei per gas — can you compute that?"}],"resultDescription":"Returns a deterministic JSON response containing the total gas cost as a wei string, computed as gas_used × gas_price_wei. No external calls are made; the result is pure local arithmetic.","failureModes":["Missing or invalid gas_used integer returns a validation error","Missing or non-string gas_price_wei returns a validation error","Overflow for extremely large gas values may produce errors","Non-numeric string in gas_price_wei causes a parse/type error","Payment not processed (x402 protocol failure) results in no response"],"whenToPreferThis":"Use this endpoint when you already know both gas_used and gas_price_wei and need a deterministic, offline wei cost computation without spinning up an RPC node or querying live chain data. Ideal for post-execution accounting, pre-submission cost checks in agents, and any context where a fast, keyless, no-network math result is sufficient.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:51:36.763Z","isFirstParty":false}