Rate Limits and API Authentication
To mitigate misuse and manage capacity on our API, we have implemented limits on LI.FI API usage.
Rate limits apply to requests made using your x-lifi-api-key
and are calculated per API key across all endpoints. These limits help prevent abuse and ensure a smooth experience for everyone.
Current Rate Limits
The default rate limits for production usage are as follows:
Unathenticated
Endpoint Scope | Rate Limit |
---|---|
200 requests per two hours | |
Rest of endpoints | 200 requests per two hours |
Authenticated
Endpoint Scope | Rate Limit |
---|---|
200 requests per minute | |
Rest of endpoints | 200 requests per minute |
🔒 Higher limits may be available for enterprise clients. Please see our Plans page for more details.
Handling Rate Limits
If you exceed your rate limits, you’ll receive a 429 Too Many Requests
HTTP response. When this occurs:
- You will get an error message showing when the rate limit will be lifted (e.g., 5 hours)
- Request higher rate limit
Best Practices
To avoid hitting rate limits:
- Cache results from
GET /tokens
,GET /chains
, and static endpoints - Avoid polling frequently for the same data
- Batch or debounce user input that triggers API calls
Abuse Prevention
To prevent abuse, LI.FI may temporarily block keys that:
- Consistently exceed rate limits
- Attempt to bypass limits through multiple keys or IPs
- Cause performance degradation to the service
Using the API key
Authentication to LI.FI’s API is performed via the custom HTTP header x-lifi-api-key
with an API key. If you are using the Client SDK, you will set the API when creating a config, and then the SDK will send the header on your behalf with every request. If integrating directly with the API, you’ll need to send this header yourself like so:
API key can be tested using the following endpoint:
x-lifi-api-key
in client-side environments such as browser-based JavaScript or direct Widget integrations. Using the API key on the client side can lead to unauthorized usage or abuse of your key, as it becomes publicly accessible in the browser’s developer tools or network tab.
If you’re using the LI.FI Widget, you do not need to pass an API key. The Widget operates securely without requiring a key in the frontend. For server-side integrations (e.g. SDK or API requests from your backend), always keep your key secret and secure. Need Higher Limits?
If you’re building a high-volume integration or a production-grade product, we’re happy to support your scaling needs.
Please see our Plans page for more details.
🛠️ For advanced usage recommendations and caching strategies, see Performance & Optimization.