# Hyperliquid Order Book via x402 Micropayment

> Hyperliquid Order Book via x402 Micropayment is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Fetches real-time Hyperliquid perpetual order book (bids, asks, spread) for BTC, ETH, or SOL, paid per-call with USDC on Base via x402.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/orderbook?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hyperliquid-order-book-via-x402-micropayment-51d6c38b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_At7ra0FNeutl1Cfe9QLG9

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 hyperliquid-order-book-via-x402-micropayment-51d6c38b
```

Example prompt: What does the BTC perp order book look like on Hyperliquid right now — give me the top 5 levels on each side and the spread in basis points.

## When to prefer this

Choose this endpoint when your AI agent needs low-latency, pay-per-call perpetual order book data from Hyperliquid without API key registration. Ideal for trading bots, arbitrage agents, or portfolio tools that need real-time bid/ask depth and spread for BTC, ETH, or SOL perps, and that pay with USDC on Base via x402. Prefer alternatives if you need spot markets, other venues, or coins beyond the three supported.

## Known failure modes

- Unsupported coin symbol returns validation error — only BTC, ETH, SOL are accepted
- Depth out of range (< 1 or > 20) returns a 400-style error
- x402 payment failure if agent wallet has insufficient USDC on Base
- Hyperliquid upstream outage causes stale or missing data
- Network timeout from Cloudflare Worker if Hyperliquid API is slow

## 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

Returns a JSON object with the coin ticker, venue name (hyperliquid), ordered arrays of bid and ask levels (each with price, size, and order count), best bid, best ask, mid price, spread in basis points, data sources array, and an ISO8601 updated_at timestamp.

## 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": {
      "coin": {
       "enum": [
        "BTC",
        "ETH",
        "SOL"
       ],
       "type": "string",
       "examples": [
        "BTC",
        "ETH",
        "SOL"
       ],
       "description": "Perp coin (default BTC)"
      },
      "depth": {
       "type": "integer",
       "maximum": 20,
       "minimum": 1,
       "description": "Levels per side (default 5)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mid": 80860.5,
  "asks": [
   {
    "n": 3,
    "px": 80861,
    "sz": 0.8
   }
  ],
  "bids": [
   {
    "n": 4,
    "px": 80860,
    "sz": 1.2
   }
  ],
  "coin": "BTC",
  "venue": "hyperliquid",
  "sources": [
   "https://api.hyperliquid.xyz/info"
  ],
  "best_ask": 80861,
  "best_bid": 80860,
  "spread_bps": 0.124,
  "updated_at": "2026-10-28T11:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hyperliquid-order-book-via-x402-micropayment-51d6c38b/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)
