Base URL
All trading endpoints are versioned under/api/trading/v1/*. API-key registration, revocation, orders, account reads, and execution actions all use /v1. The machine-readable contract is at /api/trading/v1/openapi.json.
Breaking API changes require a new major path version. The documentation below describes v1.
Getting started
- Sign in to Legend and open Settings → Trading.
- Create an API key. Allow trading is on by default; switch it off for read-only access.
- Copy the key and store it securely; Legend does not retain the plaintext key.
- Send it in the
Authorization: Bearer …header. Include a uniqueIdempotency-Keyfor each trading action.
LEGEND_API_KEY to your API key. Keep credentials out of URLs and logs.
Exchange conventions
- Prices and sizes are decimal strings, with Hyperliquid market precision rules.
gtc,ioc, andalomap to Hyperliquid’sGtc,Ioc, andAlotime-in-force values.- Market execution uses an IOC order with an explicit worst acceptable price. A partially filled IOC may return
canceledwith a nonzerofilled_size. - Markets use the venue symbol, including HIP-3 DEX-qualified names. Order retrieval and mutation accept Legend UUIDs or native Hyperliquid order IDs.
- There are no API-specific notional, position-size, or cumulative trading-volume budgets. Exchange requirements, available margin, and request rate limits still apply.
- Legend derives the wallet signer from the authenticated account. Callers cannot supply a wallet signer, vault, or arbitrary exchange action.
