{"uid":"cap_QGIql5g15PYzdt3ViYuol","slug":"phantom-api-xlayer-gas-estimate-5de1f038","name":"Phantom API — XLayer Gas Estimate","description":"Lightning-fast access to blockchain data, smart contract insights, and Web3 infrastructure across 57+ networks. Pay-per-call via x402.","url":"https://phantom-api-omega.vercel.app/api/xlayer/gas/estimate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"to":{"type":"string"},"data":{"type":"string"},"from":{"type":"string"},"value":{"type":"string"}}},"responseSchema":null,"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_FdirANsPIT_tlSn29quEJ","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":"Estimates the gas cost for a transaction on the X Layer (OKX Layer 2) blockchain network","exampleAgentPrompt":"Before I send 0.5 ETH to 0xRecipientAddress from 0xMyWalletAddress on X Layer, can you estimate how much gas that transaction will cost?","exampleUseCases":[{"title":"Pre-flight gas check for token transfer","prompt":"I want to send some tokens on X Layer — can you estimate the gas cost first? The sender is 0xABC123, recipient is 0xDEF456, and the transfer data is 0xa9059cbb..."},{"title":"Smart contract deployment cost estimation","prompt":"Before I deploy my smart contract on X Layer, estimate the gas it'll take — here's the bytecode as the data field, and my deployer wallet is 0xMYDEPLOYER."},{"title":"DeFi transaction fee check before swap","prompt":"I'm about to do a swap on an X Layer DEX — can you estimate the gas for this calldata 0xswapData... being sent to contract 0xDEXContract from my wallet 0xMYWALLET with value 0?"}],"resultDescription":"Returns a gas estimate (in gas units) for the described transaction on the X Layer network, enabling the caller to anticipate transaction costs before broadcasting. May include a gas limit figure and optionally a fee estimate in native currency.","failureModes":["Invalid or malformed address in 'to' or 'from' fields — returns 400 error","Transaction would revert on-chain — estimation may fail or return a revert error","Network congestion or RPC node unavailability — may return 503 or timeout","Missing required fields — returns validation error","X Layer network downtime — endpoint unavailable"],"whenToPreferThis":"Use this endpoint specifically when you need gas estimates for transactions on the X Layer (OKX EVM-compatible Layer 2) network. Prefer it over generic gas estimators when targeting XLayer-specific contracts or infrastructure, and when you need a pay-per-call model without subscription overhead via x402 micropayment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:46:39.572Z","isFirstParty":false,"canonicalSlug":"phantom-api-xlayer-gas-estimate-5de1f038"}