Skip to main content
The LI.FI Perps API provides REST endpoints for perpetual futures trading across multiple providers.

Base URLs

Authentication

All requests require an API key. Register at the LI.FI Partner Portal to get your API key and integrator name. Pass the following headers with every request:
In the SDK, pass these as configuration options:
Never expose your x-lifi-api-key in client-side code (browser JavaScript, frontend bundles). The key is visible in browser developer tools and network tabs. For frontend integrations, proxy API calls through your backend to keep the key secret.

Request Format

  • All POST request bodies use application/json
  • Query parameters are used for GET requests
  • String numeric values (prices, sizes, amounts) avoid floating-point precision issues

Response Format

Successful responses return JSON with appropriate HTTP status codes:

Response Headers

All responses include the x-lifi-requestid header for request correlation and debugging:
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 are applied per API key. Contact LI.FI support for rate limit details and higher tier access.

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.

Actions