https://trading-api.legend.trade/v1
Use the Legend Trading API to place, modify, and cancel orders, manage positions, and read your account’s balances and fills.
All trading endpoints are versioned under /v1/*. API-key registration, revocation, orders, account reads, and execution actions all use /v1. The machine-readable contract is at /v1/openapi.json.
Breaking API changes require a new major path version. The documentation below describes v1.
https://trading-api.legend.trade/v1
Existing integrations using https://app.legend.trade/api/trading/v1 remain supported. API keys and wallet-signing audiences are unchanged.
Authorization: Bearer … header. Include a unique Idempotency-Key for each trading action.Keys remain valid until revoked. Keys can only be created for your main account on mainnet. Revocation prevents future API actions; it does not cancel existing orders or reverse completed trades. Keys cannot withdraw or transfer funds.
export LEGEND_API_BASE="https://trading-api.legend.trade"
curl "$LEGEND_API_BASE/v1/account" \
-H "Authorization: Bearer $LEGEND_API_KEY"
Set LEGEND_API_KEY to your API key. Keep credentials out of URLs and logs.
"81000.0" becomes "81000", and size "0.0001300" becomes "0.00013". This also applies to trigger prices and TWAP sizes.gtc, ioc, and alo map to Hyperliquid’s Gtc, Ioc, and Alo time-in-force values.canceled with a nonzero filled_size.Read the orders reference, authentication guide, and retry rules. The OpenAPI document contains the full schema.
Hyperliquid’s exchange endpoint documentation describes the underlying order and execution semantics.
Follow Hyperliquid’s tick and lot size rules: prices have at most five significant figures and at most 6 - szDecimals decimal places for perpetuals, or 8 - szDecimals for spot. Integer prices are always valid. Sizes have at most szDecimals decimal places, using the market’s metadata; HIP-3 markets follow the same perpetual rules.
Normalization removes redundant zeros without changing the value. Off-tick prices and off-lot sizes return invalid_precision; the API does not silently round a requested price or size. For example, BTC "81000.1" exceeds five significant figures and is rejected. Use plain decimal strings, without scientific notation.
Retry an action with the same Idempotency-Key and the exact original request body, even if the response uses normalized decimal strings.
For Muse API integration and the ChatGPT/Claude MCP preview, see assistant connectors. Host availability and permissions differ from direct API access.