Download OpenAPI specification:
Consolidated OpenAPI 3.1 schema for Hyperliquid REST and WebSocket APIs.
type discriminatoraction.type discriminatorA single endpoint that serves many read-only queries distinguished by a type field
in the JSON body. This operation uses a discriminator on the type property to pick
the appropriate request schema. Responses vary by request type.
Valid type values and purposes:
allMids: Return mid prices for all actively traded coins. If a book is empty, last trade price is used.openOrders: Retrieve a user's open orders.frontendOpenOrders: Retrieve a user's open orders with additional frontend fields.userFills: Retrieve a user's most recent trade fills (up to 2,000).userFillsByTime: Retrieve a user's trade fills within a time range (up to 2,000 per response).userRateLimit: Return the user's current rate-limit usage and capacity.orderStatus: Query order status by numeric order ID or client order ID (cloid).l2Book: Retrieve an L2 order book snapshot for a given coin (up to 20 levels per side).candleSnapshot: Retrieve OHLCV candles for a coin and interval (most recent 5,000).portfolio: Retrieve summarized portfolio time-series across intervals.spotMeta: Retrieve spot token metadata and spot universe definitions.spotMetaAndAssetCtxs: Retrieve spot metadata and per-asset pricing contexts.spotClearinghouseState: Retrieve a user's spot balances and totals.meta: Retrieve perpetuals metadata including universe and margin tables.metaAndAssetCtxs: Retrieve perps universe and per-asset contexts (funding, OI, prices).clearinghouseState: Retrieve a user's perps clearinghouse account state and summaries.gossipRootIps: Retrieve recently available seed peer IP addresses to bootstrap gossip.| type required | string |
{- "type": "allMids"
}{- "property1": "string",
- "property2": "string"
}All trading operations use POST /exchange with different action.type variants.
Common request structure:
action: Operation-specific objectnonce: Timestamp in millisecondssignature: Cryptographic signaturevaultAddress: Optional, for vault tradingexpiresAfter: Optional expiration timestamprequired | any (Trading Action) Choose one of the following actions via the
|
| nonce required | integer Current timestamp in milliseconds |
| signature required | object Cryptographic signature |
| vaultAddress | string Vault address for vault trading |
| expiresAfter | integer Request expiration timestamp |
{- "action": {
- "type": "order",
- "order": {
- "a": 0,
- "b": true,
- "p": "string",
- "s": "string",
- "r": true,
- "t": {
- "limit": {
- "tif": "gtc"
}
}, - "c": "string"
}
}, - "nonce": 0,
- "signature": { },
- "vaultAddress": "string",
- "expiresAfter": 0
}{- "status": "err",
- "response": "string"
}