# Onchain Query API – Gas Market Data

> Onchain Query API – Gas Market Data is a paid API for AI agents from chain.cyberwarex.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Returns current gas market data for a specified EVM chain, including gas price, base fee, priority fee percentiles, and estimated transaction costs in native token and USD.

## Facts

- Endpoint: GET https://chain.cyberwarex.com/gas
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-query-api-gas-market-data-cc95c58b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hRUY8ZY8QHoddXB6kyz7F

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 onchain-query-api-gas-market-data-cc95c58b
```

Example prompt: What are the current gas prices on Ethereum right now — including base fee, priority fee percentiles, and estimated cost for a token swap?

## When to prefer this

Use this endpoint when you need real-time gas market data for EVM chains (Base, Ethereum, Arbitrum, Optimism, Polygon) without managing your own RPC infrastructure or API keys. Ideal for agents making gas-aware transaction decisions, cost estimation before submitting transactions, or monitoring gas conditions across multiple chains. Prefer this over raw RPC calls for simplicity, and over general blockchain explorers when you need structured, deterministic JSON responses with USD cost estimates.

## Known failure modes

- Unsupported chain name returns validation error
- Chain RPC temporarily unavailable returns error or null fields
- Native USD price unavailable returns null for native_usd and USD cost estimates
- Malformed query parameters return 400-level error

## How this service works

Live gas market on any major EVM chain: current gas price, base fee and priority-fee percentiles (p25/p50/p75) in gwei, plus the estimated cost in native token and USD for a plain transfer (21k gas) and a typical DEX swap (200k gas). Lets an agent decide whether a transaction is worth sending right now or should wait for cheaper gas, and budget the fee before signing.

## Output

Returns a JSON object with: chain name, native token symbol, current gas price in gwei, base fee in gwei (if EIP-1559), priority fee percentiles (p25/p50/p75 in gwei), native token USD price, and estimated transaction costs (in native token and USD) for a standard transfer (~21k gas) and a token swap (~200k gas).

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string",
       "default": "base",
       "description": "EVM chain to query."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "chain": {
       "type": "string"
      },
      "native": {
       "type": "string"
      },
      "est_cost": {
       "type": "object",
       "description": "Estimated native + USD cost for transfer_21k and swap_200k."
      },
      "native_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "base_fee_gwei": {
       "type": [
        "number",
        "null"
       ]
      },
      "gas_price_gwei": {
       "type": "number"
      },
      "priority_fee_gwei": {
       "type": [
        "object",
        "null"
       ],
       "description": "Priority fee percentiles p25/p50/p75 in gwei."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-query-api-gas-market-data-cc95c58b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain.cyberwarex.com](https://www.zero.xyz/host/chain.cyberwarex.com/llms.txt)
