# Base Chain ID Lookup

> Base Chain ID Lookup is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Returns the Base mainnet chain ID in integer, hex, and CAIP-2 format via eth_chainId, confirming which EVM network you are connected to.

## Facts

- Endpoint: GET https://x402.agentindex.world/base/chain-id?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-chain-id-lookup-b471abdd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JCK4l7aR5RbP5MLiWUGke

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 base-chain-id-lookup-b471abdd
```

Example prompt: Before I submit this transaction, can you confirm the chain ID of the Base mainnet network — give me the numeric ID, hex value, and the CAIP-2 identifier?

## When to prefer this

Use this endpoint when an AI agent or automated system needs to programmatically confirm it is connected to Base mainnet before executing transactions, signing messages, or configuring wallets — especially in multi-chain environments where network confusion could cause fund loss. Prefer this over manual RPC calls when you need all three chain ID formats (integer, hex, CAIP-2) in one response.

## Known failure modes

- RPC connectivity issues may return a 5xx error if the Base node is unreachable
- Malformed request body may return a 400 validation error
- Payment failure (x402) may block the call if USDC balance is insufficient

## How this service works

Base mainnet chain ID (EIP-155) via eth_chainId - confirm which network you're actually talking to.

## Output

Returns a JSON object with three fields: chain_id (integer, e.g. 8453), chain_id_hex (hex string, e.g. '0x2105'), and caip2 (CAIP-2 identifier string, e.g. 'eip155:8453') for the Base mainnet network.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "title": "ChainIdInput",
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "title": "ChainIdOutput",
     "required": [
      "chain_id",
      "chain_id_hex",
      "caip2"
     ],
     "properties": {
      "caip2": {
       "type": "string",
       "title": "Caip2"
      },
      "chain_id": {
       "type": "integer",
       "title": "Chain Id"
      },
      "chain_id_hex": {
       "type": "string",
       "title": "Chain Id Hex"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-chain-id-lookup-b471abdd/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)
