Skip to main content
This page provides actionable playbooks for handling errors from the LI.FI API. For each error, you’ll find the cause, whether to retry, what to change, and how to communicate with users. Start with the Authentication, Status and Retry Contract: the same HTTP code can mean different things for different operations. All API retries below refer to read-only discovery or polling, not transaction resubmission.

HTTP Status Codes

400 Bad Request

Cause: Invalid parameters in the request. Common Causes:
  • Missing required parameters
  • Invalid token address format
  • Invalid chain ID
  • Amount is 0 or negative
  • fromAddress not a valid address

404 Not Found

Cause depends on the operation. On /v1/status, HTTP 404 with code 1003 means the hash is not currently found; it does not prove execution failure or authorize resubmission. Poll within a bounded window, then reconcile the original hash on the source chain. On quote/route discovery, API code 1002 (NoQuoteError) identifies no available route; a generic HTTP 404 may instead indicate a wrong endpoint or missing resource. Do not classify a 404 solely by its HTTP status. See Status & Recovery. Common Causes:
  • Token pair not supported
  • Amount too small (below minimum)
  • Amount too large (exceeds liquidity)
  • Bridge temporarily unavailable

429 Too Many Requests

Cause: Rate limit exceeded. Backoff Strategy:
Prevention:
  • Use an API key for higher limits
  • Cache chain and token data
  • Batch requests where possible

500 Internal Server Error

Cause: Server-side issue.

503 Service Unavailable

Cause: Service temporarily down or overloaded.

API Error Codes

The API returns error codes in the response body. Handle these specific scenarios:

NO_POSSIBLE_ROUTE

Cause: No bridge or DEX can fulfill the request. Suggestions:

AMOUNT_TOO_LOW

Cause: Transfer amount is below minimum threshold.

AMOUNT_TOO_HIGH

Cause: Amount exceeds available liquidity.

INSUFFICIENT_LIQUIDITY

Cause: Not enough liquidity in pools.

Slippage Error (code 1007)

Cause: Price impact exceeds slippage tolerance.
In status responses, slippage issues appear as substatus SLIPPAGE_EXCEEDED.

TOOL_TIMEOUT

Cause: Bridge or DEX response timeout.

CHAIN_NOT_SUPPORTED

Cause: Requested chain is not available.

TOKEN_NOT_SUPPORTED

Cause: Token is not available for transfers.

Transaction Errors

Errors that occur during transaction execution (not API errors):

execution reverted

Cause: Smart contract rejected the transaction.

insufficient funds

Cause: Wallet doesn’t have enough balance.

user rejected

Cause: User declined the transaction in their wallet.

nonce too low

Cause: Pending transaction with same nonce.

Error Handling Template


Quick Reference