# OneSource Ethereum Chain ID Lookup

> OneSource Ethereum Chain ID Lookup 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-13).

Returns the EIP-155 chain ID for Ethereum mainnet or Sepolia testnet via eth_chainId RPC call

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/chain-id
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-ethereum-chain-id-lookup-955334b5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TKXs0xTnPHDr_SIl10ASj

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-chain-id-lookup-955334b5
```

Example prompt: What is the EIP-155 chain ID for the Ethereum mainnet? I need to confirm the network before signing a transaction.

## When to prefer this

Use this endpoint when you need to programmatically confirm or retrieve the EIP-155 chain ID for Ethereum mainnet or Sepolia testnet before signing transactions, configuring wallets, or validating network context. Prefer this over manual lookup when building automated Ethereum workflows that must confirm chain identity at runtime.

## Known failure modes

- Invalid network enum value returns validation error
- Network parameter missing defaults to ethereum mainnet
- Service unavailability returns 5xx error
- Payment failure (x402) blocks the request if USDC balance is insufficient

## How this service works

Ethereum chain ID (EIP-155) via eth_chainId - confirm which chain a network is on

## Output

Returns the numeric EIP-155 chain ID for the requested network (e.g. 1 for Ethereum mainnet, 11155111 for Sepolia), confirming which chain the node is operating on.

## 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": {
        "result": {
         "type": "string"
        }
       },
       "description": "Endpoint-specific response payload"
      },
      "meta": {
       "type": "object",
       "required": [
        "endpoint",
        "request_id"
       ],
       "properties": {
        "endpoint": {
         "type": "string"
        },
        "cost_usdc": {
         "type": "string"
        },
        "request_id": {
         "type": "string"
        },
        "payment_chain": {
         "type": "string"
        },
        "payment_token": {
         "type": "string"
        }
       }
      },
      "error": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "code": {
         "type": "integer"
        },
        "message": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "result": "0x1"
  },
  "meta": {
   "endpoint": "/api/chain/chain-id",
   "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-chain-id-lookup-955334b5/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)
