{"uid":"cap_i6PT7xSOU7HD_VQFqgWH8","slug":"onchain-gas-price-lookup-base-ethereum-e551619d","name":"Onchain Gas Price Lookup (Base & Ethereum)","description":"Live Base and Ethereum reads for AI agents: balances (ETH + USDC), gas, transaction status, ERC-20 metadata. $0.001 per call via x402 (USDC on Base).","url":"https://onchain.x402utils.workers.dev/v1/gas?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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","properties":{"chain":{"enum":["base","ethereum"],"type":"string","description":"base (default) or ethereum"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"block":23000000,"chain":"ethereum","base_fee_gwei":1.1,"gas_price_gwei":1.2}},"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_hnfFrNQgkT7eQ8TgaJKTf","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":"Returns current gas price and base fee in gwei for Base or Ethereum, along with the latest block number.","exampleAgentPrompt":"What's the current gas price on Ethereum right now — give me the base fee in gwei and the latest block number.","exampleUseCases":[{"title":"Gas-aware transaction timing bot","prompt":"Check the current gas price on Base and tell me if it's below 0.5 gwei — I only want to submit my transaction when gas is cheap."},{"title":"Cross-chain gas comparison","prompt":"What are the gas prices on both Base and Ethereum right now? I want to know which chain is cheaper to use for my next transfer."},{"title":"Real-time block height monitoring","prompt":"What's the latest block number on Ethereum and what's the current base fee in gwei? I'm tracking chain liveness for my dashboard."}],"resultDescription":"Returns a JSON object with the chain name, latest block number, base fee in gwei, and gas price in gwei for the requested network (Base or Ethereum).","failureModes":["Unsupported chain value returns validation error — only 'base' or 'ethereum' are accepted","Payment failure (x402) if USDC balance is insufficient or x402 header is missing/invalid","Upstream RPC node unavailability may cause timeout or 503 error","Stale data if the underlying node is behind on block sync"],"whenToPreferThis":"Use this endpoint when you need real-time, low-latency gas price data for Base or Ethereum and want a simple pay-per-call model without API key management. Ideal for AI agents that need to make gas-aware decisions (e.g. timing transactions, estimating costs) without integrating a full node or subscribing to a gas oracle service.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T18:38:37.506Z","isFirstParty":false,"canonicalSlug":"onchain-gas-price-lookup-base-ethereum-e551619d"}