# OneSource Ethereum Network Info (Chain ID + Block Height + Gas Price)

> OneSource Ethereum Network Info (Chain ID + Block Height + Gas Price) is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Returns the current Ethereum network state — chain ID, latest block number, and current gas price — in a single batched RPC call

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/network-info
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-ethereum-network-info-chain-id-block-height-gas-price-f324b738
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dqyMovqrEoiUgybdCf8lP

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 onesource-ethereum-network-info-chain-id-block-height-gas-price-f324b738
```

Example prompt: What's the current gas price, block height, and chain ID on Ethereum mainnet right now?

## When to prefer this

Use this endpoint when you need Ethereum or Sepolia network state (gas price, block number, chain ID) together in one call, avoiding three separate RPC round-trips. Ideal for transaction preparation workflows where you need current gas price and nonce context simultaneously, or for monitoring Ethereum network conditions. Prefer over raw JSON-RPC when you want a REST interface with per-call micropayment billing instead of managing your own node or RPC provider subscription.

## Known failure modes

- Invalid network value (not 'ethereum' or 'sepolia') returns a 400 error
- Upstream Ethereum node unavailability returns a 503 or timeout
- Payment not provided or insufficient USDC results in a 402 Payment Required response
- Rate limiting may occur under high request volume

## How this service works

EVM network info - chain ID, block height, gas price, chain head age, and chain characteristics in one batched RPC call (eth_chainId + eth_blockNumber + eth_gasPrice + latest block header)

## Output

Returns three key Ethereum network values in one response: the chain ID (e.g. 1 for mainnet), the latest block number, and the current gas price in wei — all fetched via a single batched JSON-RPC call so the values are consistent with each other.

## Example request

```json
{
 "network": "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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "network": {
       "enum": [
        "ethereum",
        "sepolia",
        "robinhood"
       ],
       "type": "string",
       "default": "ethereum"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "data",
      "meta"
     ],
     "properties": {
      "data": {
       "type": "object",
       "properties": {
        "chain": {
         "type": "object",
         "properties": {
          "ens": {
           "type": "boolean"
          },
          "layer": {
           "type": "integer"
          },
          "stack": {
           "type": "string"
          },
          "indexed": {
           "type": "boolean"
          },
          "mempool": {
           "type": "boolean"
          },
          "chain_id": {
           "type": "integer"
          },
          "finality": {
           "type": "string"
          },
          "native_currency": {
           "type": "string"
          },
          "avg_block_time_ms": {
           "type": "integer"
          }
         }
        },
        "stale": {
         "type": "boolean"
        },
        "network": {
         "type": "string"
        },
        "chain_id": {
         "type": "string"
        },
        "gas_price": {
         "type": "string"
        },
        "net_version": {
         "type": "string"
        },
        "block_number": {
         "type": "string"
        },
        "head_timestamp": {
         "type": "integer"
        },
        "head_age_seconds": {
         "type": "integer"
        },
        "stale_after_seconds": {
         "type": "integer"
        }
       },
       "description": "Endpoint-specific response payload"
      },
      "meta": {
       "type": "object",
       "required": [
        "endpoint",
        "request_id"
       ],
       "properties": {
        "endpoint": {
         "typ
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "chain": {
    "ens": true,
    "layer": 1,
    "stack": "ethereum",
    "indexed": true,
    "mempool": true,
    "chain_id": 1,
    "finality": "beacon",
    "native_currency": "ETH",
    "avg_block_time_ms": 12000
   },
   "stale": false,
   "network": "ethereum",
   "chain_id": "0x1",
   "gas_price": "0x4a817c800",
   "net_version": "1",
   "block_number": "0x133da1e",
   "head_timestamp": 1754240345,
   "head_age_seconds": 9,
   "stale_after_seconds": 1200
  },
  "meta": {
   "endpoint": "/api/chain/network-info",
   "cost_usdc": "0.001",
   "request_id": "00000000abcdef01",
   "payment_chain": "base",
   "payment_token": "USDC"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-ethereum-network-info-chain-id-block-height-gas-price-f324b738/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
