{"uid":"cap_4vvDd40EjPwTY1lUnIBXR","slug":"phantom-api-zksync-gas-estimator-e4309d4a","name":"Phantom API — zkSync Gas Estimator","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/zksync/gas/estimate","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_mqzJFZ9uldde94hnakfMn","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 gas fees for transactions on the zkSync Layer 2 network given transaction parameters","exampleAgentPrompt":"Estimate the gas cost for a zkSync transaction from 0xAbCd...1234 to 0x5678...EfGh with calldata 0xa9059cbb...000064 and a value of 0.01 ETH.","exampleUseCases":[{"title":"Pre-flight check before token transfer","prompt":"Before I send 100 USDC on zkSync to 0x4A2b...8F3c from my wallet 0x1D9e...7A12, can you estimate the gas cost so I know how much ETH I need to cover fees?"},{"title":"Smart contract interaction cost estimate","prompt":"I want to call a smart contract on zkSync — the contract is at 0xDEAD...BEEF, my address is 0xCAFE...BABE, and the encoded calldata is 0x095ea7b3...ffffffff. What's the estimated gas for this call?"},{"title":"DApp transaction budgeting","prompt":"I'm building a zkSync dapp and need to know how much gas it costs to execute this swap transaction with calldata 0x38ed1739...0000 from 0xUser...1111 to the DEX at 0xDex...2222 with 0.5 ETH value — can you run a gas estimate?"}],"resultDescription":"Returns an estimated gas amount (in gas units) and likely fee details for the described zkSync transaction, without actually broadcasting the transaction to the network.","failureModes":["Invalid address format for 'to' or 'from' fields returns a validation error","Malformed or non-hex calldata string causes a parse error","zkSync RPC node unavailable or rate-limited returns a 503 or timeout","Transactions that would revert on-chain may return an execution revert error rather than a gas estimate","Missing required fields returns a 400 bad request","Value field not formatted as a hex or decimal string may cause parsing failures"],"whenToPreferThis":"Use this endpoint when you need gas estimation specifically on the zkSync Layer 2 network (Era or Lite). It is distinct from Ethereum mainnet gas estimation and other L2s. Prefer this over generic EVM gas estimators when your transaction is destined for zkSync, as zkSync has unique fee mechanics (L1 security fee + L2 execution fee) that generic estimators don't capture correctly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T13:06:35.628Z","isFirstParty":false}