{"uid":"cap_i7ImrzBBsJbXsD3RcN_rT","slug":"base-gas-fee-oracle-live-on-chain-0f876b73","name":"Base Gas & Fee Oracle (Live On-Chain)","description":"Self-computed Base onchain toolkit for AI agents: ERC-20 safety scan, manipulation-resistant TWAP price oracle, gas/fee oracle, calldata decoder, token/address/contract intel, wallet approval-risk audit, and batch token triage — all computed live from raw Base chain, no third-party data.","url":"https://x402-data-api.bodhinindustries.workers.dev/gas","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"gasLimit":{"type":"integer","description":"Gas units to price the tx for (default 21000 = a plain ETH transfer)."},"rewardPercentiles":{"type":"string","description":"Three ascending priority-fee percentiles (0–100) mapped to slow,avg,fast. Default '25,50,90'."}}},"responseSchema":{"type":"object","properties":{"block":{"type":"integer","description":"Base block height"},"chain":{"type":"string","description":"base"},"tiers":{"type":"object","properties":{"avg":{"type":"object","properties":{"estCostUsd":{"type":"number","description":"estimated cost in USD"},"maxFeePerGasGwei":{"type":"number","description":"max fee (gwei)"},"maxPriorityFeePerGasGwei":{"type":"number","description":"priority fee (gwei)"}}},"fast":{"type":"object","properties":{"estCostUsd":{"type":"number","description":"estimated cost in USD"},"maxFeePerGasGwei":{"type":"number","description":"max fee (gwei)"},"maxPriorityFeePerGasGwei":{"type":"number","description":"priority fee (gwei)"}}},"slow":{"type":"object","properties":{"estCostUsd":{"type":"number","description":"estimated cost in USD"},"maxFeePerGasGwei":{"type":"number","description":"max fee (gwei)"},"maxPriorityFeePerGasGwei":{"type":"number","description":"priority fee (gwei)"}}}}},"ethUsd":{"type":"number","description":"self-computed ETH/USD from Uniswap v3 WETH/USDC"},"method":{"type":"string","description":"self_computed_eth_feeHistory"},"chainId":{"type":"integer","description":"8453"},"gasLimit":{"type":"integer","description":"gas units priced"},"computedAt":{"type":"string","description":"ISO-8601 timestamp"},"baseFeeTrend":{"type":"object","properties":{"direction":{"type":"string","description":"rising|falling|flat"},"congestion":{"type":"string","description":"low|medium|high"},"changePctOver10Blocks":{"type":"number","description":"base-fee change %"}}},"baseFeePerGasGwei":{"type":"number","description":"current base fee (gwei)"},"thirdPartyDataUsed":{"type":"boolean","description":"always false"},"nextBlockBaseFeePerGasGwei":{"type":"number","description":"predicted next-block base fee (gwei)"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_eGR6O43_LzfcUTmKAcEQY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns live Base network gas prices, fee tiers (slow/avg/fast), next-block base fee prediction, congestion status, and self-computed ETH/USD price — all derived directly from the Base blockchain with no third-party data.","exampleAgentPrompt":"What are the current gas fees on Base right now — give me slow, average, and fast tiers in gwei and estimated USD cost for a standard ETH transfer (21000 gas), and tell me if the network is congested or if fees are trending up or down?","exampleUseCases":[{"title":"Time a transaction for cheapest fees","prompt":"I need to send some tokens on Base but I want to pay the least amount possible in gas — is the network congested right now, is the base fee going up or down, and what would a slow-tier transaction cost me in USD if I wait a bit?"},{"title":"Get ETH price from on-chain data","prompt":"What is the current ETH/USD price pulled directly from on-chain data on Base — no CoinGecko or external oracles — and what block height is that price derived from?"},{"title":"Pick the right fee for fast confirmation","prompt":"I have a time-sensitive transaction I need confirmed in the next block on Base — what maxFeePerGas and maxPriorityFeePerGas should I set for the fast tier, and roughly what will that cost in USD for a 21000 gas transfer?"}],"resultDescription":"Returns current Base block height, base fee and predicted next-block base fee in gwei, three fee tiers (slow/avg/fast) each with maxFeePerGas, maxPriorityFeePerGas, and estimated USD cost, a self-computed ETH/USD spot price from Uniswap v3 on-chain, and a congestion/trend summary (direction: rising|falling|flat, congestion: low|medium|high, % change over last 10 blocks). No third-party oracle data is used.","failureModes":["Base RPC node unavailable — returns 5xx with no gas data","Invalid rewardPercentiles format (e.g. non-ascending or out-of-range values) — likely returns 400 or malformed response","gasLimit of 0 or negative may produce nonsensical USD estimates","ETH/USD price unavailable if Uniswap v3 WETH/USDC pool cannot be read — thirdPartyDataUsed remains false but ethUsd may be null","Payment not included or invalid x402 payment header — returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need live, self-computed Base network gas fees with no dependency on third-party oracles like Etherscan or CoinGecko. Ideal for AI agents that need to price transactions, decide when to submit a tx (congestion awareness), or display current ETH/USD pricing — all sourced trustlessly from raw Base chain data. Prefer this over general Ethereum gas APIs when operating specifically on Base (chainId 8453).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:36:48.179Z","isFirstParty":false}