{"uid":"cap_zSWxqozTdrQ9apKeKlSEL","slug":"phantom-api-optimism-gas-estimate-8b943a9b","name":"Phantom API — Optimism 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/optimism/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_CkYHZFgtLC2bsOkqy0KHf","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 Optimism network given transaction parameters","exampleAgentPrompt":"Can you estimate how much gas it will cost to call this contract on Optimism — from address 0xABCD...1234 to 0x5678...EFGH with calldata 0xa9059cbb... and no ETH value?","exampleUseCases":[{"title":"Pre-flight check before DeFi swap","prompt":"Before I submit this Uniswap swap on Optimism, can you estimate the gas cost? The transaction is from my wallet 0xABCD...1234 to the Uniswap router at 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45, with this calldata 0x5ae401dc... and no ETH value attached."},{"title":"Smart contract deployment cost estimate","prompt":"I'm about to deploy a new ERC-20 contract on Optimism — can you estimate the gas it'll need? Sender is 0xDEAD...BEEF, recipient is the zero address, and here's the deployment bytecode: 0x608060405234801561001057600080fd..."},{"title":"NFT mint gas budgeting","prompt":"Can you tell me how much gas minting an NFT on Optimism will use? My wallet is 0x1111...2222, the NFT contract is at 0x3333...4444, and the mint calldata is 0x1249c58b with 0.01 ETH attached as value."}],"resultDescription":"Returns an estimated gas amount (in gas units) for the specified Optimism transaction, allowing the caller to gauge transaction costs and set appropriate gas limits before broadcasting to the network.","failureModes":["Invalid or malformed address in 'to' or 'from' fields returns an error","Malformed or non-hex calldata causes a parse error","Transactions that would revert on-chain may return an execution revert error","Network connectivity issues to Optimism RPC may cause timeouts","Missing required fields may result in a 400 bad request","Insufficient value for a payable function may trigger a revert simulation error"],"whenToPreferThis":"Use this endpoint when you need a gas estimate specifically for the Optimism (OP Mainnet) Layer 2 network. Prefer this over Ethereum mainnet gas estimators when your transaction targets OP, and over general-purpose Web3 SDKs when you want a pay-per-call API without managing your own RPC node. Ideal for agents that need to pre-check transaction costs before submitting or for budgeting gas in automated workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:49:39.038Z","isFirstParty":false}