# EVM Chain Gas Price API

> EVM Chain Gas Price API is a paid API for AI agents from x402-seller-0ay3.onrender.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns the current gas price (in wei and gwei) for a specified EVM blockchain (Base or Ethereum), read live from a public RPC endpoint using viem

## Facts

- Endpoint: GET https://x402-seller-0ay3.onrender.com/api/chain/gas
- 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/evm-chain-gas-price-api-d946077d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1jICEONxbgwyaDDorCv9l

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 evm-chain-gas-price-api-d946077d
```

Example prompt: What's the current gas price on Base right now — give me the live gwei reading directly from the network?

## When to prefer this

Choose this endpoint when you need a quick, no-API-key live gas price for Base or Ethereum directly from a public RPC node via viem. It is ideal for lightweight agents that need a real-time gwei reading without setting up an Infura/Alchemy key or calling a gas aggregator. Prefer alternatives like Etherscan Gas Tracker or Blocknative if you need historical gas data, priority fee breakdowns, or EIP-1559 base/priority fee separation.

## Known failure modes

- Unsupported chain value (not 'base' or 'ethereum') returns a 400 or validation error
- Public RPC endpoint unavailable or rate-limited causing a timeout or 503
- Stale or delayed data if the RPC node is lagging behind the chain tip
- Network connectivity issues from the Render-hosted service

## How this service works

Current gas price on an EVM blockchain, read live via a public RPC endpoint (viem) — no API key, no aggregator. Also available as dedicated routes: GET /api/gas/base, GET /api/gas/ethereum. Parameter: ?chain=<base|ethereum>.

## Output

A JSON object containing the chain name, the live gas price expressed in both wei (as a string) and gwei (as a float), and a timestamp of when the data was fetched — e.g. {chain: 'base', gas_price_wei: '6000000', gas_price_gwei: 0.006, fetched_at: '2026-09-01T12:00:00.000Z'}.

## 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",
     "required": [
      "chain"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "description": "EVM chain to query."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "fetched_at": "2026-09-01T12:00:00.000Z",
  "gas_price_wei": "6000000",
  "gas_price_gwei": 0.006
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-chain-gas-price-api-d946077d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-seller-0ay3.onrender.com](https://www.zero.xyz/host/x402-seller-0ay3.onrender.com/llms.txt)
