# AgentIndex x402 Gas Price

> AgentIndex x402 Gas Price is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-29).

Returns current gas price, base fee, and estimated native transfer cost for a specified EVM network (Base, Ethereum, Polygon, Arbitrum, Optimism).

## Facts

- Endpoint: GET https://x402.agentindex.world/gas-price?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentindex-x402-gas-price-7d1850c4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oOB8x1boiDXscwOmN7dJq

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 agentindex-x402-gas-price-7d1850c4
```

Example prompt: What's the current gas price on Base right now — give me the gwei figure and an estimate for what a plain ETH transfer would cost?

## When to prefer this

Choose this endpoint when an AI agent needs real-time EVM gas data across Base, Ethereum, Polygon, Arbitrum, or Optimism — especially when operating in a pay-per-call context via x402/USDC on Base. Prefer it over general blockchain APIs when the agent already has x402 payment infrastructure and needs lightweight, structured gas reads without a full node or heavy SDK dependency.

## Known failure modes

- Unsupported or misspelled network enum value returns a 400 or validation error
- Network RPC temporarily unavailable results in 503 or timeout
- Missing required method or type field in input returns schema validation error
- Insufficient USDC balance or failed x402 payment results in 402 Payment Required

## How this service works

Read the live gas price, EIP-1559 base fee and estimated native-transfer cost on Base, Ethereum, Polygon, Arbitrum or Optimism. No RPC key or account. Try GET /gas-price/sample.

## Output

A JSON object containing the network identity (key, name, CAIP-2 identifier), current gas price in both wei and gwei, base fee (if EIP-1559 supported), current block number, and a native transfer estimate including symbol, fee in wei, gas limit, and fee in native token units. Also includes an x402 payment receipt.

## 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": {
      "network": {
       "enum": [
        "base",
        "ethereum",
        "polygon",
        "arbitrum",
        "optimism"
       ],
       "type": "string",
       "description": "EVM network to read; defaults to Base."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "network",
      "block_number",
      "gas_price",
      "native_transfer_estimate"
     ],
     "properties": {
      "network": {
       "type": "object"
      },
      "base_fee": {
       "type": [
        "object",
        "null"
       ]
      },
      "gas_price": {
       "type": "object"
      },
      "block_number": {
       "type": "integer"
      },
      "x402_receipt": {
       "type": "object"
      },
      "native_transfer_estimate": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": {
   "key": "base",
   "name": "Base",
   "caip2": "eip155:8453"
  },
  "base_fee": {
   "wei": "900000",
   "gwei": 0.0009
  },
  "gas_price": {
   "wei": "1000000",
   "gwei": 0.001
  },
  "block_number": 51500000,
  "native_transfer_estimate": {
   "symbol": "ETH",
   "fee_wei": "21000000000",
   "gas_limit": 21000,
   "fee_native": 2.1e-8
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentindex-x402-gas-price-7d1850c4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
