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:
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
All responses include thex-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.