hyperliquidapi / docs

First order in under 60 seconds.

Every action runs through one endpoint, https://send.hyperliquidapi.com/exchange, in three steps. Readable JSON in, no SDK, no dependencies. Any HTTP client and any EIP‑712 signer works, and your key signs locally so it never reaches the API.

1 · Build

POST your order as plain JSON, no signature. Get back a hash to sign.

POST /exchange
{"action":{"type":"order",
  "orders":[{"asset":"BTC",
    "side":"buy","size":"0.001",
    "tif":"ioc"}]}}

 {"hash":"0x9f2c…","nonce":1719…}

2 · Sign (local)

Sign the hash with your key. It never leaves your machine.

// any EIP-712 signer,
// your side
sig = sign(privateKey,
           hash)

3 · Send

POST it back with the signature. It executes.

POST /exchange
{"action":{…},
  "nonce":1719…,
  "signature":{…}}

 {"success":true, "exchangeResponse":{…}}

Verify it worked

Approval status confirms you can trade; open orders confirms what's resting. Both are unsigned reads — safe to run any time.

verify
curl -s "https://send.hyperliquidapi.com/approval?user=0xYOUR_ADDRESS"
# → { "approved": true, "maxFeeRate": "1%", "canTradePerps": true, … }

Building with an agent?

The entire API is documented in a single machine-readable file. Point Claude, Codex, or any coding agent at it and it can build a working integration without scraping these pages.

paste this into your agent
Read https://hyperliquidapi.com/llms-full.txt and use it to
place a market order for 0.5 HYPE via the build-sign-send flow.

The REST surface

Everything routes through https://send.hyperliquidapi.com. Order priority is set with priorityFee, which the API encodes as {"grouping":{"p":10000}} before hashing. Hyperliquid reads p as p / 100000000 of filled notional; 10000 is 1 bp and 80000 is the max. Priority fees require IOC orders on non-outcome assets and are paid from undelegated staking HYPE. HIP-4 # markets settle in USDC and do not support priority fees.

Exchange: Build (no signature)

POST /exchange without a signature. Accepts human-readable or wire format, injects the builder fee, applies optional priorityFee where supported, and returns the exact action + hash to sign.

MethodEndpointReturns
POST

Build Order

/exchange
{ hash, nonce, action, isSpot, builderFee, builder, priorityFee? }
POST

Build Market Order

/exchange
{ hash, nonce, action (with computed price), isSpot, builderFee, builder, appliedSlippage, priorityFee? }
POST

Build Close Position

/exchange
{ hash, nonce, action, appliedSlippage, closePositionContext, priorityFee? }
POST

Build Cancel

/exchange
{ hash, nonce, action, summary, assets }
POST

Build Modify

/exchange
{ hash, nonce, action, summary, assets }
POST

Build Approval

/exchange
{ hash, nonce, details: { builder, maxFeeRate, chain }, typedData }
POST

Build Revoke

/exchange
{ hash, nonce, details: { builder, maxFeeRate: "0%", chain }, typedData }
POST

Build Outcome Action

/exchange
{ hash, nonce, action, actionType, nextStep }
POST

Build Priority Funding Deposit

/exchange
{ hash, nonce, action, actionType, typedData, nextStep }
POST

Build User-Signed Action

/exchange
{ hash, nonce, action, actionType, typedData, nextStep }
POST

Build Leverage or Margin Action

/exchange
{ hash, nonce, action, actionType, nextStep }

Exchange: Send (with signature)

POST /exchange with the action from a build response plus its nonce and signature. Verifies approval and priority rules, then forwards to Hyperliquid.

MethodEndpointReturns
POST

Send Order

/exchange
{ success, user, exchangeResponse, orders? }
POST

Send Cancel

/exchange
{ success, user, exchangeResponse }
POST

Send Modify

/exchange
{ success, user, exchangeResponse }
POST

Send Approval

/exchange
{ approved, builder, maxFeeRate, user, message, exchangeResponse }
POST

Send Revoke

/exchange
{ revoked, builder, user, message, exchangeResponse }
POST

Send Outcome Action

/exchange
{ success, user, exchangeResponse }
POST

Send User-Signed Action

/exchange
{ success, user, exchangeResponse }
POST

Send Leverage or Margin Action

/exchange
{ success, user, exchangeResponse }

Enhanced Endpoints

Read-only GET/POST helpers that enrich Hyperliquid data: approval status, open orders, order status, preflight, markets, outcomes, and dexes.

MethodEndpointReturns
GET

Check Approval

/approval?user=0x…
{ approved, maxFeeRate, maxFeeRaw, canTradePerps, canTradeSpot, feeBreakdown }
POST

Open Orders

/openOrders
{ orders, count, cancelActions: { all, byAsset } }
POST

Order Status

/orderStatus
{ status, explanation, coin, asset, name, isSpot, order, statusTimestamp }
POST

Preflight

/preflight
{ valid, errors, assetInfo, estimatedFee, priorityFee?, isSpot }
GET

List Markets

/markets
{ perps, spot, hip3, hip4 }
GET

List Outcomes

/outcomes
{ quoteToken, outcomes, questions, encoding, actions }
GET

Outcome Balances

/outcomes/balances?user=0x…&outcome=10
{ user, outcome, quote, yes, no, actions }
GET

List Dexes

/dexes
[{ name, index }, …]

Order action — body fields

action.orders[].assetstringasset name, e.g. "BTC", "HYPE", "xyz:SILVER", or "#10" (HIP-4)
action.orders[].sidestring"buy" or "sell"
action.orders[].pricestringlimit price (omit for market orders)
action.orders[].sizestringorder size
action.orders[].tifstring"ioc", "gtc", "alo", or "market"
priorityFeenumber|string?optional IOC-only priority rate p, max 80000; p=10000 is 1 bp. Encoded as action.grouping {"p": priorityFee} before signing
vaultAddressstring?optional vault
slippagenumber?market-order slippage tolerance (default 3%). Range: 0.1%–10%

Examples

curl
curl -s -X POST https://send.hyperliquidapi.com/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "order",
      "orders": [{"asset": "BTC", "side": "buy", "price": "100000",
                  "size": "0.001", "tif": "ioc"}]
    }
  }'
Try it — POST /exchangeno signature
hits the live endpoint

Error codes

Every error uses the appropriate HTTP status code and includes error, message, and guidance with exactly what to do next.

HTTPError codeMeaningWhat to do
403NOT_APPROVEDNot approved / fee too lowRun approval flow or visit /approve
422BUILDER_MISMATCHBuilder mismatchPOST /exchange without a signature; it injects the correct builder
422SIGNATURE_INVALIDInvalid signatureSign the exact hash from the build response. r/s: 0x hex, v: 27 or 28
422HL_EXCHANGE_*Exchange rejectionSee errorCode and actionRequired in response
400INVALID_JSONInvalid request bodySend valid JSON to the correct endpoint
422INVALID_PARAMSInvalid paramsCheck required fields and types
500INTERNAL_ERRORInternal errorRetry in a few seconds

Two fees per trade

The API itself is free: no subscription, no API key, no usage tiers. You pay only when an order fills, and only two fees exist. Our builder fee (injected into your order) and Hyperliquid's exchange fee (maker/taker, charged by the protocol).

Builder fee

charged by us, injected into each order

MarketFeeProtocol max
Perpetuals0.04%0.1%
Spot0.05%1%

Exchange fee

charged by Hyperliquid, based on your volume tier

MarketTakerMaker
Perpetuals0.045%0.015%
Spot0.070%0.040%

You approve a maxFeeRate ceiling (e.g. "1%") for the builder fee. The actual builder fee is always within your approved limit, and you can revoke at any time. Priority is optional: set priorityFee on an IOC order (max 80000), paid from undelegated staking HYPE. HIP-4 # markets do not support priority fees.

Questions

Hyperliquid API is a zero-custody REST builder API for Hyperliquid, built by Quicknode. It lets you trade perpetuals, spot, HIP-3, and HIP-4 markets programmatically while your private keys never leave your machine.