# Phantom API — XLayer Latest Block

> Phantom API — XLayer Latest Block is a paid API for AI agents from phantom-api-omega.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Fetches the most recent block data from the XLayer blockchain network

## Facts

- Endpoint: POST https://phantom-api-omega.vercel.app/api/xlayer/block/latest
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/phantom-api-xlayer-latest-block-eb0243dd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7FwnKCS3CrsRPkP3Obeg8

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 phantom-api-xlayer-latest-block-eb0243dd -d '<json body>'
```

Example prompt: What's the latest block on the XLayer network right now? I need the block number, hash, and timestamp.

## When to prefer this

Use this endpoint when you need fast, pay-per-call access to the latest XLayer block without managing your own RPC node or paying for a subscription. Preferred over self-hosted RPC when cost per call is acceptable and infrastructure overhead should be minimized. Choose this over generic Ethereum or EVM endpoints when specifically targeting the XLayer (OKX Layer 2) network.

## Known failure modes

- Network unavailable or XLayer RPC node unreachable — returns error or timeout
- Payment of $0.01 USDC not fulfilled — returns HTTP 402 Payment Required
- Malformed request body — returns 400 validation error
- XLayer network experiencing downtime — may return stale or error response

## How this service works

Lightning-fast access to blockchain data, smart contract insights, and Web3 infrastructure across 57+ networks. Pay-per-call via x402.

## Output

Returns structured data about the most recently produced block on the XLayer network, including block number, block hash, timestamp, and potentially transaction count and parent hash.

## 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",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "properties": {},
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/phantom-api-xlayer-latest-block-eb0243dd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from phantom-api-omega.vercel.app](https://www.zero.xyz/host/phantom-api-omega.vercel.app/llms.txt)
