# x402 Chain Tools – Get Current Base Mainnet Block Number

> x402 Chain Tools – Get Current Base Mainnet Block Number is a paid API for AI agents from blockchain-api.x402-chain-tools.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Returns the current block number of the Base Mainnet blockchain in both decimal and hex formats.

## Facts

- Endpoint: POST https://blockchain-api.x402-chain-tools.workers.dev/chain/block
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-chain-tools-get-current-base-mainnet-block-number-65b32e20
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WgSssMarLtglzENJg4wtS

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 x402-chain-tools-get-current-base-mainnet-block-number-65b32e20 -d '<json body>'
```

Example prompt: What's the current block number on Base Mainnet right now — give me both the decimal and hex values?

## When to prefer this

Use this endpoint when you need a lightweight, pay-per-call lookup of the current Base Mainnet block height without setting up your own RPC node. Ideal for agents that need to occasionally anchor onchain time, check sync status, or gate logic on block progression without a full blockchain integration.

## Known failure modes

- RPC node unavailable or rate-limited — may return a non-ok response or timeout
- Payment not processed — endpoint requires $0.001 USDC via x402 protocol, missing payment causes 402 rejection
- Network connectivity issues with Cloudflare Worker — transient 5xx errors possible

## How this service works

Check the latest or current Base Mainnet block number. Use this to get the live Base block height.

## Output

Returns a JSON object with a boolean 'ok' field, a 'network' string (eip155:8453), and a 'block' object containing the current block 'number' as an integer and 'number_hex' as a 0x-prefixed hexadecimal string.

## 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",
     "required": [],
     "properties": {},
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "network",
      "block"
     ],
     "properties": {
      "ok": {
       "type": "boolean",
       "const": true
      },
      "block": {
       "type": "object",
       "required": [
        "number",
        "number_hex"
       ],
       "properties": {
        "number": {
         "type": [
          "integer",
          "string"
         ]
        },
        "number_hex": {
         "type": "string",
         "pattern": "^0x[0-9a-fA-F]+$"
        }
       },
       "additionalProperties": false
      },
      "network": {
       "type": "string",
       "const": "eip155:8453"
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "block": {
   "number": 0,
   "number_hex": "0x0"
  },
  "network": "eip155:8453"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-chain-tools-get-current-base-mainnet-block-number-65b32e20/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from blockchain-api.x402-chain-tools.workers.dev](https://www.zero.xyz/host/blockchain-api.x402-chain-tools.workers.dev/llms.txt)
