Base URLs
Production accepts requests with no API key; they use LI.FI’s default fees. Development and Staging require an API key.
Authentication
An API key is optional on Production (https://li.quest/v1/perps). Development and Staging require one. The API key identifies your integration for fees:
- No API key — the request uses LI.FI’s default fees. This is a supported configuration.
- A valid API key — LI.FI validates the key and applies the fees agreed for your integration.
- An invalid API key, or a key that is not linked to an integration — the request is rejected before any fee or order is built.
x-lifi-integrator is an assertion, not a credential
x-lifi-integrator only checks a claim against the identity your API key already established:
- Matches the authenticated identity — accepted.
- Differs from the authenticated identity — ignored. The backend uses the API-key identity and does not reject the request. Send the key’s own integration id, or omit the header.
- Sent with no API key — has no effect. Without a key there is no authenticated identity to match, so the request uses LI.FI’s default fees.
x-lifi-integrator only when both apiKey and integrator are set. See Getting Started for the key-only, key-plus-assertion, and no-key configurations.
Hyperliquid builder fee
Hyperliquid orders carry a LI.FI builder fee, which the trading address must approve via theapproveBuilderFee setup step. Without the approval, createAction returns 409 / 2070 (SetupRequired).
Browser apps: proxy pattern
PointapiUrl at a route on your own server. The route adds x-lifi-api-key (and optionally x-lifi-integrator) and forwards the request to LI.FI. The browser never holds the key.
- Forward the request body and
content-typeuntouched. - Do not cache responses.
- Restrict the path to the routes you use; do not expose
adminroutes.
checkSetup, and provider WebSocket streams go from the SDK directly to the provider, so they still originate in the browser.
Request Format
- All
POSTrequest bodies useapplication/json - Query parameters are used for
GETrequests - String numeric values (prices, sizes, amounts) avoid floating-point precision issues
Response Format
Successful responses return JSON with appropriate HTTP status codes:Response Headers
Responses include thex-lifi-requestid header for request correlation and debugging. A request that fails before the server creates its request context can have no header.
Include the
x-lifi-requestid value when reporting issues to LI.FI support. This ID is logged server-side and allows us to trace your specific request.Error Format
All errors follow the same structure with numeric error codes (2000+ range):HTTP Error Status Codes
Rate Limits
Rate limits apply per one-minute window. The backend counts a request against the integration of its API key, so all the keys of one integration share one budget. A key with no integration counts against the key id. A request with no key counts against the hashed client IP. The default budget is300 requests each minute. createAction and executeAction have their own default of 30 requests each minute for a request with no key, and for a key with no rateLimit of its own. Contact LI.FI support for higher limits.
Every response carries x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset. A 429 response also carries retry-after.
Endpoints Overview
Market Data (Public)
Account
Account-level reads (account summary, positions, orders, fills, activity, single order) are served by the SDK directly from each provider, not by LI.FI HTTP endpoints. Use@lifi/perps-sdk: getAccount, getPositions, getOrders, getFills, getActivity, getOrder. See SDK / Account.