{"uid":"cap_BPoFcUDviVLQMwLgzx36i","slug":"saylor-innovations-gas-estimator-optimism-9ed93d84","name":"Saylor Innovations Gas Estimator (Optimism)","description":"Gas Estimate (optimism) — On-Chain Data","url":"https://saylorinnovations.com/api/evm/optimism/estimate-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","POST","PUT","PATCH","DELETE","HEAD"],"type":"string"},"queryParams":{"type":"object","properties":{"to":{"type":"string","description":"0x target (query)"},"data":{"type":"string","description":"optional 0x calldata (query)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["chain","reverted"],"properties":{"gas":{"type":["number","null"]},"chain":{"type":"string"},"error":{"type":["string","null"]},"native":{"type":"string"},"reverted":{"type":"boolean"},"est_fee_native":{"type":["string","null"]},"gas_price_gwei":{"type":["number","null"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-84MIxPQz_ylXNIaZd-up","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Estimates gas cost for a transaction on the Optimism EVM network, returning gas units, gas price, and estimated fee in native token","exampleAgentPrompt":"Estimate the gas cost for calling this contract on Optimism — the target address is 0x4200000000000000000000000000000000000006 and the calldata is 0xd0e30db0. Tell me the gas units, gas price in gwei, and the estimated fee in ETH.","exampleUseCases":[{"title":"Pre-flight check before DeFi swap","prompt":"Before I submit this swap transaction on Optimism, estimate the gas cost — the contract is 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45 and the calldata is 0x5ae401dc000000000000000000000000000000000000000000000000000000006488b4ef. What will it cost me in ETH?"},{"title":"Detect reverting transaction on Optimism","prompt":"I want to know if this Optimism transaction will revert before I send it — target is 0x0000000000000000000000000000000000000000 and the calldata is 0xabcdef12. Does it look like it'll succeed, and what's the gas estimate?"},{"title":"Compare gas costs across chains","prompt":"Estimate the gas for this exact calldata on Optimism — target address 0x4200000000000000000000000000000000000042, calldata 0x06fdde03 — I'm comparing gas costs across different L2 networks to decide where to deploy."}],"resultDescription":"Returns a JSON object with the chain name ('optimism'), estimated gas in units, gas price in gwei, estimated transaction fee in native ETH, a boolean indicating whether the transaction would revert, and an optional error message if simulation failed or gas could not be estimated.","failureModes":["Invalid or missing 'to' address returns an error field with description","Transaction simulation reverts — reverted field is true and gas may be null","Malformed calldata causes estimation failure with error string","Network connectivity issues to Optimism RPC result in error response","No calldata provided for contract interactions that require it may return inaccurate estimate"],"whenToPreferThis":"Use this endpoint when you need gas estimates specifically on the Optimism L2 network. Prefer it over generic gas estimators when you need Optimism-specific gas pricing (which uses a two-component fee model), want to detect potential reverts before submission, or are building cost-comparison tooling across EVM chains. Sibling endpoints cover Arbitrum, Polygon, Base, and Ethereum mainnet for cross-chain comparisons.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-03T00:48:44.448Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-gas-estimator-optimism-9ed93d84"}