Authentication
The LI.FI API works without an API key. A key raises your rate limits; see Rate Limits for the current values.integrator(optional query parameter): identifies your application in analytics and onchain events. Defaults to"lifi-api". Letters, numbers, hyphens, underscores and dots; at most 23 characters.x-lifi-api-key(optional header): created with an integration in the LI.FI partner portal. Keep it server-side.
How Composer is selected
Composer needs no dedicated endpoint. SettoToken to a supported position-token address and the routing engine adds a Composer route to the candidates it compares with DEX and bridge routes. A quote for a vault token may therefore use a DEX that buys the token directly. See Identifying Composer routes.
Request a Composer quote
Using GET /quote (recommended)
Returns the best route with transaction data included.
Slippage
Theslippage parameter is a decimal value representing the maximum acceptable price difference. For example, 0.005 means 0.5%. The quote’s estimate.toAmountMin is estimate.toAmount reduced by this tolerance. A same-chain transaction that would deliver less than toAmountMin reverts.
If you omit slippage, LI.FI picks a route-dependent value, and it can differ between same-chain and cross-chain routes. Read the applied value from action.slippage in the response. Set slippage explicitly when your UI shows or enforces a tolerance.
Using POST /advanced/routes
Returns several route options, for example to let the user choose.
/advanced/routes does not include transaction data. Call POST /v1/advanced/stepTransaction to get the transactionRequest for each step.Getting transaction data for a route step
TypeScript
Quote response structure
The example below is a same-chain quote that Composer won, requested withslippage=0.005, trimmed to the fields this guide uses. For every field, see Get a quote.
Key fields
Contract addresses
estimate.approvalAddress and transactionRequest.to both point to the audited LI.FI Diamond contract. On most EVM chains, including Ethereum, Base and Arbitrum, its address is 0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE. Some chains use a different deployment, so always approve and send to the addresses returned in the quote. For audit reports, see Security and Audits.
Morpho vault naming
Morpho vault tokens carry their curator’s name. For example,0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A returns symbol: "sparkUSDC" because Spark curates this Morpho vault.
Set token allowance
Approveestimate.approvalAddress to spend the input token. Skip this step if fromToken is a native token such as ETH.
The samples assume server-side signing: walletClient is created with a local account (for example via privateKeyToAccount), so walletClient.account is defined. With a browser-injected wallet, get the address from walletClient.getAddresses() instead.
Send the transaction
Submit thetransactionRequest from the quote as a standard EVM transaction.
Track status
A same-chain Composer transaction is complete once it confirms. For a cross-chain route, pollGET /v1/status until the status is DONE or FAILED. DONE with substatus PARTIAL means the bridge delivered but the destination deposit did not run: the user holds the bridged token on the destination chain instead of the vault token. See Cross-chain deposits for the polling sample and PARTIAL handling, and Transaction Status Tracking for every status value.
Error handling
For the full error reference, see Error Codes.
Next steps
Cross-chain deposits
Bridge and deposit, and handle
PARTIAL outcomesError Handling
Read per-tool failure reasons and handle simulation failures

