# Base Blockchain Block Number via JSON-RPC (x402)

> Base Blockchain Block Number via JSON-RPC (x402) is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns the current Base blockchain block number (or executes other JSON-RPC calls) via a pay-per-call x402 micropayment API requiring no API keys.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/api/block-number?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-blockchain-block-number-via-json-rpc-x402-18f13734
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_puzwzDEjIn0RgdlF_m1cP

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-blockchain-block-number-via-json-rpc-x402-18f13734
```

Example prompt: What's the current block number on Base mainnet right now? Use the eth_blockNumber JSON-RPC method and pay the micropayment fee with USDC.

## When to prefer this

Choose this endpoint when building onchain or trading AI agents that need lightweight Base blockchain JSON-RPC access without registering for a conventional API key. Ideal for autonomous agents that can pay micropayments in USDC via the x402 protocol, need real-time block numbers or balances, and want zero-friction permissionless access. Prefer over full RPC providers when pay-per-call economics fit your agent's usage pattern.

## Known failure modes

- Payment not made or insufficient USDC — returns HTTP 402 Payment Required
- Invalid JSON-RPC method name — returns RPC error in result
- Malformed params array (not valid URL-encoded JSON) — returns parse error
- Upstream dRPC node unavailable — may return 502 or timeout
- Rate limiting if too many unpaid requests attempted

## How this service works

Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.

## Output

A JSON-RPC 2.0 response object containing: the result field (e.g. block number as hex string for eth_blockNumber), chain identifier ('base'), chain_id (8453), upstream RPC URL used, and latency_ms for the upstream call.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "method": {
       "type": "string",
       "examples": [
        "eth_blockNumber",
        "eth_getBalance",
        "eth_call"
       ],
       "description": "JSON-RPC method (default eth_blockNumber)"
      },
      "params": {
       "type": "string",
       "examples": [
        "[]",
        "[\"0xe4be4d0bd82d8e68203deff81f79ede0529f2617\",\"latest\"]"
       ],
       "description": "URL-encoded JSON array of params (default [])"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": 1,
  "chain": "base",
  "result": "0x32c8f1a",
  "jsonrpc": "2.0",
  "chain_id": 8453,
  "upstream": "https://base.drpc.org",
  "latency_ms": 84
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-blockchain-block-number-via-json-rpc-x402-18f13734/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
