{"uid":"cap_bZTRElKD81NYvc_ldppQg","slug":"chainray-online-a909e152","name":"ChainRay Gas Optimization","description":"The most complete blockchain data and intelligence service for AI agents. 93 endpoints across 46 chains, from gas fees to DeFi analytics, with real-time streams, intent routing, and verifiable proofs. Pay-per-request via x402.","url":"https://chainray.online/gas-optimization","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"],"type":"string"},"queryParams":{"type":"object","properties":{"chain":{"type":"string","description":"Blockchain network (e.g., base, ethereum, polygon)"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"chain":"ethereum"}}},"response":{"chain":"ethereum","stats":{"max":1.22,"min":0.776,"mean":1.047,"volatility":"9.561%","sampledBlocks":50,"avgUtilization":"50.401%"},"_proof":{"chain":"ethereum","dataHash":"fc3354138635b1584a649219afb86c6e6ee1081a245f86737c758482dcf5babb","blockHash":"0xe052b27940d66e4ee28a17ab99ee8601b3f75c267d99782f6714b2b2532a149d","chainName":"Ethereum","blockNumber":25203117,"proofVersion":"3.0","blockTimestamp":1780082927,"proofTimestamp":1780082931940},"current":{"unit":"Gwei","baseFee":0.925,"verdict":"CHEAP","vsAverage":"-11.69%"},"windows":[{"avgGas":0.934,"blocksAgo":"0-5","avgUtilization":"49.456%","relativeToMean":-10.829},{"avgGas":0.895,"blocksAgo":"5-10","avgUtilization":"59.898%","relativeToMean":-14.55},{"avgGas":0.958,"blocksAgo":"10-15","avgUtilization":"38.763%","relativeToMean":-8.473},{"avgGas":1.034,"blocksAgo":"15-20","avgUtilization":"50.415%","relativeToMean":-1.275},{"avgGas":1.033,"blocksAgo":"20-25","avgUtilization":"57.585%","relativeToMean":-1.291},{"avgGas":1.096,"blocksAgo":"25-30","avgUtilization":"36.278%","relativeToMean":4.672},{"avgGas":1.114,"blocksAgo":"30-35","avgUtilization":"48.453%","relativeToMean":6.416},{"avgGas":1.161,"blocksAgo":"35-40","avgUtilization":"52.934%","relativeToMean":10.929},{"avgGas":1.132,"blocksAgo":"40-45","avgUtilization":"54.459%","relativeToMean":8.138}],"timestamp":1780082931861,"optimization":{"cheapestWindow":{"avgGas":0.895,"blocksAgo":"5-10","avgUtilization":"59.898%","relativeToMean":-14.55},"potentialSavings":"16.029%","estimatedWaitTime":"~1 minutes","mostExpensiveWindow":{"avgGas":1.161,"blocksAgo":"35-40","avgUtilization":"52.934%","relativeToMean":10.929}},"recommendations":["✅ NOW is a good time — gas is 11.69% below average"]}},"exampleRequest":{"chain":"ethereum"},"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Fq1d1UjSAHhfyw-KNSk90","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns gas optimization insights and recommendations for a specified blockchain network to help minimize transaction costs","exampleAgentPrompt":"What gas optimization strategies does ChainRay recommend for Base right now — I want to minimize my transaction costs on that chain.","exampleUseCases":null,"resultDescription":"Returns gas optimization guidance for the specified blockchain network, including recommended strategies, optimal transaction timing, and fee-reduction techniques tailored to the chain's current gas conditions.","failureModes":["Unsupported chain identifier returns error or empty result","Missing chain parameter may default to a specific network or return an error","Network timeout if blockchain data source is temporarily unavailable","Rate limiting or payment failure if the x402 micropayment is not properly handled"],"whenToPreferThis":"Use this endpoint when you need actionable gas optimization recommendations for a specific blockchain (e.g., Base, Ethereum, Polygon) rather than raw historical gas data or predictions. Prefer this over sibling endpoints like /gas-history or /gas-prediction when you want prescriptive guidance on minimizing transaction costs rather than just data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:40:50.934Z","isFirstParty":false}