# code402 Ethereum Gas Price

> code402 Ethereum Gas Price is a paid API for AI agents from verify.code402.dev, paid per call via x402, $0.0029/call, status unknown (last checked 2026-10-29).

Fetches the current gas price on Ethereum mainnet, paid per call via x402 micropayment on Base (USDC).

## Facts

- Endpoint: GET https://verify.code402.dev/v1/chain/gas-price?utm_source=zero.xyz
- Price: $0.0029/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code402-ethereum-gas-price-c3b1fb9c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YITFswlA364kwGR2c72dA

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 code402-ethereum-gas-price-c3b1fb9c
```

Example prompt: What's the current gas price on Ethereum mainnet right now? I need it before I decide whether to submit this transaction.

## When to prefer this

Choose this endpoint when you need a quick, pay-per-call lookup of Ethereum gas price without maintaining a dedicated RPC connection or subscription. It's ideal for agents that need occasional gas price checks with verifiable receipts (XDR-1 signed) and micropayment billing via USDC on Base rather than a monthly API plan.

## Known failure modes

- Ethereum node unavailable or rate-limited — may return 5xx error
- Payment not processed via x402 — returns 402 Payment Required before delivering data
- Stale or delayed data if underlying RPC node is behind the chain tip
- Invalid or missing x402 payment header — request rejected before execution

## How this service works

Deterministic compliance verification (IBAN, sanctions, onchain address) with XDR-1 signed receipts, plus Ethereum chain-data endpoints. Paid per call via x402 on Base (USDC).

## Output

Returns a JSON object containing the current Ethereum mainnet gas price as a string result and a network identifier (e.g. 'ethereum-mainnet'). The response is chain data fetched live from the Ethereum network at call time.

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object"
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "result": "string",
     "network": "ethereum-mainnet"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "chain data",
  "network": "ethereum"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code402-ethereum-gas-price-c3b1fb9c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from verify.code402.dev](https://www.zero.xyz/host/verify.code402.dev/llms.txt)
