# Hyperliquid — Retrieve user's perpetuals account summary

Get Hyperliquid Perps Account Summary data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Hyperliquid, pass parameters such as type, user, and retrieve structured data including account value, reported total margin used, reported cross-margin account value, reported withdrawable amount, and account-summary observation timestamp for account dashboards, and position states.

Documentation: https://openany.si/hyperliquid/hyperliquid-retrieve-user-s-perpetuals-account-summary/f98b3708-e1dd-46cb-9523-106b6d3011f0/
API ID: f98b3708-e1dd-46cb-9523-106b6d3011f0
Provider: hyperliquid
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/hyperliquid/info/clearinghouse-state
Page update time: 2026-12-03T02:49:36.063Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:35.577Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Hyperliquid Perps Account Summary API

POST type="clearinghouseState", user and optional dex. The object separates marginSummary, crossMarginSummary, crossMaintenanceMarginUsed, withdrawable, time and assetPositions. Keep an empty position collection distinct from the account’s reported summary values.

## What You Can Build

- **Account dashboards**: Show margin summaries with their scope and observation time.
- **Position states**: Handle an empty position collection independently of summary amounts.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `marginSummary.accountValue` | Reported account value in the margin summary |
| `marginSummary.totalMarginUsed` | Reported total margin used |
| `crossMarginSummary.accountValue` | Reported cross-margin account value |
| `crossMaintenanceMarginUsed` | Reported cross maintenance margin used |
| `withdrawable` | Reported withdrawable amount |
| `time` | Account-summary observation timestamp |
| `assetPositions` | Returned asset-position collection |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hyperliquid — Retrieve user's perpetuals account summary request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "examples": [
        {
          "type": "clearinghouseState",
          "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
        }
      ],
      "properties": {
        "dex": {
          "description": "Perp dex name. Defaults to the empty string which represents the first perp dex.",
          "type": "string"
        },
        "type": {
          "const": "clearinghouseState",
          "description": "Fixed native Info query discriminator.",
          "enum": [
            "clearinghouseState"
          ],
          "example": "clearinghouseState",
          "type": "string"
        },
        "user": {
          "description": "Onchain address in 42-character hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.",
          "example": "0x677d831aef5328190852e24f13c46cac05f984e7",
          "pattern": "^0x[0-9a-fA-F]{40}$",
          "type": "string"
        }
      },
      "required": [
        "type",
        "user"
      ],
      "type": "object",
      "description": "Retrieve user's perpetuals account summary Documentation prepared only; runtime not verified."
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "assetPositions": {
      "type": "array",
      "items": {}
    },
    "crossMaintenanceMarginUsed": {
      "type": "string"
    },
    "crossMarginSummary": {
      "type": "object",
      "properties": {
        "accountValue": {
          "type": "string"
        },
        "totalMarginUsed": {
          "type": "string"
        },
        "totalNtlPos": {
          "type": "string"
        },
        "totalRawUsd": {
          "type": "string"
        }
      }
    },
    "marginSummary": {
      "type": "object",
      "properties": {
        "accountValue": {
          "type": "string"
        },
        "totalMarginUsed": {
          "type": "string"
        },
        "totalNtlPos": {
          "type": "string"
        },
        "totalRawUsd": {
          "type": "string"
        }
      }
    },
    "time": {
      "type": "integer"
    },
    "withdrawable": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/hyperliquid/info/clearinghouse-state' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "clearinghouseState",
  "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
}'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "assetPositions": [],
  "crossMaintenanceMarginUsed": "0.0",
  "crossMarginSummary": {
    "accountValue": "463.943191",
    "totalMarginUsed": "0.0",
    "totalNtlPos": "0.0",
    "totalRawUsd": "463.943191"
  },
  "marginSummary": {
    "accountValue": "463.943191",
    "totalMarginUsed": "0.0",
    "totalNtlPos": "0.0",
    "totalRawUsd": "463.943191"
  },
  "time": 1793258565291,
  "withdrawable": "463.943191"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Does assetPositions=[] mean account value is zero?
No. Keep an empty position collection separate from margin-summary and withdrawable values.

### Can marginSummary and crossMarginSummary be merged?
Retain their separate scopes and field names. They are distinct summary objects.

### Which DEX is selected when dex is omitted?
The first perpetual DEX is used. Retain that scope when comparing account data.

### Does this query withdraw funds or change margin?
No. It reads the account summary and does not submit a withdrawal or margin action.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- hyperliquid: https://openany.si/hyperliquid/hyperliquid-retrieve-user-s-perpetuals-account-summary/f98b3708-e1dd-46cb-9523-106b6d3011f0/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
