# ChainRay Gas Optimization

> ChainRay Gas Optimization is a paid API for AI agents from chainray.online, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns gas optimization insights and recommendations for a specified blockchain network to help minimize transaction costs

## Facts

- Endpoint: GET https://chainray.online/gas-optimization
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainray-online-a909e152
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bZTRElKD81NYvc_ldppQg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chainray-online-a909e152
```

Example prompt: What gas optimization strategies does ChainRay recommend for Base right now — I want to minimize my transaction costs on that chain.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "chain": "ethereum"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainray-online-a909e152/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chainray.online](https://www.zero.xyz/host/chainray.online/llms.txt)
