{"uid":"cap_-bRXvYnlI3JTGCuPFo-X5","slug":"x402-crosschain-gas-2856a74e","name":"x402-crosschain-gas","description":"Stop opening five explorers to price one transaction: one GET returns what each chain is charging for gas right now — for base, eth, arbitrum, optimism and polygon: the current gas price in gwei (with the raw wei the RPC returned), the latest block's base fee, the priority fee a 50th-percentile transaction actually paid across the last five blocks, the next block's base fee under the EIP-1559 formula, the block number and timestamp those numbers came from, and the public RPC that answered. curl: GET /gas?chains=base,eth (omit chains for all five; aliases like ethereum or arb work). Response: {gas:[{chain,chain_id,gas_price_gwei,base_fee_gwei,priority_fee_gwei,block:{number,timestamp},source_rpc,fetched_at}]}. Every value is a measurement from a public RPC, never an estimate: a chain no RPC answered for is listed in chains_unavailable with the reason, and a figure that could not be measured is null. Values are cached for 15 seconds, and each one carries the fetched_at of the measurement (not of this response). No keys, no account, read-only, one GET, one delivery — 0.001 USDC. A purchase is two calls by design: this first call returns 402 with the price and the payment terms, and you then repeat the same request with the PAYMENT-SIGNATURE header to receive the 200 delivery.","url":"https://x402-catalog-history.ai-business-surface.workers.dev/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":{"chains":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"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_l_F4_zugi106W1srUCBmd","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 real-time gas prices (in gwei and wei) for up to five EVM chains — Base, Ethereum, Arbitrum, Optimism, and Polygon — including base fee, priority fee, next block base fee, and block metadata, sourced directly from public RPCs.","exampleAgentPrompt":"What are the current gas prices on Base and Ethereum right now — give me the base fee, priority fee, and what the next block base fee is expected to be on each chain?","exampleUseCases":[{"title":"Pre-transaction gas cost check","prompt":"Before I submit this Ethereum transaction, what's the current base fee and priority fee in gwei, and what should I expect the next block's base fee to be?"},{"title":"Cheapest chain selection for DeFi","prompt":"I need to make a token swap and want to pay as little as possible in gas — can you pull current gas prices across Base, Arbitrum, Optimism, and Polygon and tell me which one is cheapest right now?"},{"title":"Cross-chain gas monitoring dashboard","prompt":"Every minute, check gas prices on all five chains — Ethereum, Base, Arbitrum, Optimism, and Polygon — and alert me if any of them drop below 5 gwei."}],"resultDescription":"A JSON object with a `gas` array, where each entry contains: chain name and chain ID, gas price in gwei (and raw wei), base fee in gwei, 50th-percentile priority fee in gwei, estimated next block base fee under EIP-1559, block number and timestamp of the measurement, the public RPC that answered, and a fetched_at timestamp. Chains that could not be reached are listed in a `chains_unavailable` field with the reason. Values are cached for up to 15 seconds; individual unmeasurable fields are null rather than omitted.","failureModes":["A chain's public RPC is unreachable — that chain appears in chains_unavailable with an error reason rather than in the gas array","A specific metric (e.g. priority fee) could not be measured — that field is null in the response","Invalid chain alias provided — may be ignored or cause an error response","Network timeout on the Cloudflare Worker — HTTP 5xx returned","Payment not received or x402 payment flow fails — request is rejected with 402"],"whenToPreferThis":"Choose this endpoint when you need fresh, RPC-sourced gas data across multiple EVM chains in a single call — especially when you need EIP-1559 breakdown (base fee + priority fee + next block estimate) rather than just a legacy gas price. It's ideal for agents making cross-chain routing decisions, DeFi bots sizing transaction fees, or dashboards monitoring gas in real time. Prefer it over manually querying five separate RPC endpoints or scraping block explorers.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T00:35:25.222Z","isFirstParty":false,"canonicalSlug":"x402-crosschain-gas-2856a74e"}