# Hyperliquid Account Perpetuals State

> Hyperliquid Account Perpetuals State is a paid API for AI agents from hyperliquid-accounts.use.x402atlas.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns open perpetual positions, cross-margin summary, and withdrawable balance for a given Hyperliquid 0x address.

## Facts

- Endpoint: GET https://hyperliquid-accounts.use.x402atlas.com/state
- 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/hyperliquid-account-perpetuals-state-43a612b9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9HscrpeXOHeqQuFQS2-38

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-account-perpetuals-state-43a612b9
```

Example prompt: Pull up the current perpetuals state for Hyperliquid address 0x1234567890abcdef1234567890abcdef12345678 — I want to see the open positions, margin usage, and how much is withdrawable.

## When to prefer this

Use this endpoint when you need a real-time snapshot of a Hyperliquid account's perpetuals exposure — including open positions, margin health, and withdrawable balance — for any arbitrary 0x address. Prefer this over sibling endpoints when you specifically need perps/derivatives data rather than spot balances, trade history, or staking state.

## Known failure modes

- Invalid or malformed address (not a valid 0x 20-byte hex) returns a validation error
- Address with no Hyperliquid account history may return an empty positions array
- Hyperliquid upstream API unavailable causes a timeout or 5xx error
- Payment not processed correctly results in 402 Payment Required
- Rate limiting if too many calls are made in quick succession

## How this service works

A Hyperliquid account's perpetuals state — open positions, margin summary and withdrawable balance, for any 0x address.

## Output

Returns a JSON object with the queried address (lowercased), the timestamp of the upstream query, and a verbatim Hyperliquid clearinghouseState object containing: all open perpetual positions (size, entry price, unrealized PnL, leverage, liquidation price), cross-margin summary (account value, total margin used, total notional), and withdrawable balance.

## 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",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "0x-prefixed 20-byte Hyperliquid account address"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "queried_at",
      "address",
      "state"
     ],
     "properties": {
      "state": {
       "type": "object",
       "description": "Upstream Hyperliquid clearinghouseState object relayed verbatim — open positions (size, entry, unrealized PnL, leverage, liquidation price), cross-margin summary (account value, total margin used, total notional), and withdrawable balance"
      },
      "address": {
       "type": "string",
       "description": "Lower-cased account address queried"
      },
      "queried_at": {
       "type": "string",
       "format": "date-time",
       "description": "Time the upstream was queried"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "state": {
   "marginSummary": {
    "accountValue": "1000.0"
   },
   "assetPositions": []
  },
  "address": "0x0000000000000000000000000000000000000000",
  "queried_at": "2026-07-10T12:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hyperliquid-account-perpetuals-state-43a612b9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hyperliquid-accounts.use.x402atlas.com](https://www.zero.xyz/host/hyperliquid-accounts.use.x402atlas.com/llms.txt)
