Hyperliquid API
Zero-custody builder API for Hyperliquid.
Sign locally, we forward. Your keys never leave your machine.
How it works
Every trade follows the same three-step pattern. Use human-readable format (asset names, "buy"/"sell", "market" tif) or native wire format — no SDK needed. Use POST /openOrders and POST /orderStatus to discover orders and get pre-built cancel actions.
Build
POST /exchange
Send the action without signature. We inject the builder fee and compute the hash
Sign
Your key
Sign the hash locally. Your private key never leaves
Send
POST /exchange
Send the action with signature. We forward the signed transaction to Hyperliquid
Quickstart
Clone the repo. Set your key. Run.
https://send.hyperliquidapi.comhyperliquid-api-examples
Clone and run. Full working examples in Python, TypeScript, and Rust.
1git clone https://github.com/quiknode-labs/hyperliquid-api-examples.git2cd hyperliquid-api-examples/python3pip install -r requirements.txt4export PRIVATE_KEY="0xYOUR_PRIVATE_KEY"5 6python3 approve.py # one-time builder fee approval7python3 check_status.py # check approval status8python3 list_markets.py # list all available markets9python3 open_orders.py # view open orders + cancel actions10python3 order_status.py # check what happened to an order11python3 place_order.py # place a perp order12python3 cancel_order.py # place + cancel13python3 modify_order.py # place + modify14python3 roundtrip.py # buy then sell (full cycle)15python3 hip3_order.py # HIP-3 market order by name16python3 revoke.py # revoke approvalTry it now
1curl -s -X POST https://send.hyperliquidapi.com/exchange \2 -H "Content-Type: application/json" \3 -d '{4 "action": {5 "type": "order",6 "orders": [{"asset": "BTC", "side": "buy", "price": "100000", "size": "0.001", "tif": "ioc"}]7 }8 }'API Reference
REST API. POST /exchange for all transactions (build without signature, send with signature). Click any endpoint to expand and try it live.
Exchange — Build (no signature)
Exchange — Send (with signature)
Enhanced Endpoints
Error Codes
Every error uses the appropriate HTTP status code and includes error, message, and guidance with exactly what to do next.
| HTTP | Error Code |
|---|---|
| 403 | NOT_APPROVED |
| 422 | BUILDER_MISMATCH |
| 422 | SIGNATURE_INVALID |
| 422 | HL_EXCHANGE_* |
| 400 | INVALID_JSON |
| 422 | INVALID_PARAMS |
| 500 | INTERNAL_ERROR |
Fees
Two fees apply per trade: our builder fee (injected into your order) and Hyperliquid's exchange fee (maker/taker, charged by the protocol).
| Market | Fee | Protocol Max |
|---|---|---|
| Perpetuals | 0.04% | 0.1% |
| Spot | 0.05% | 1% |
| Market | Taker | Maker |
|---|---|---|
| Perpetuals | 0.045% | 0.015% |
| Spot | 0.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. You can revoke at any time.
FAQ
Common questions about Hyperliquid API.