Prefer to author multi-step flows explicitly? See the Composer API, which documents the explicit Flow authoring API.
Already using the LI.FI SDK or Widget? Composer works automatically. See the SDK guide or Widget guide instead.
Authentication
The LI.FI API is open and requires no API key. You can start making requests immediately.integrator(optional query parameter): A string that identifies your application in analytics and on-chain events. Defaults to"lifi-api"when omitted. Must be alphanumeric with hyphens, underscores, or dots, max 23 characters.x-lifi-api-key(optional header): An API key is generated automatically when you create an integration in the LI.FI partner portal. Attach it for higher rate limits. Without a key, unauthenticated limits apply: 75 requests per two hours for/quoteand/advanced/routes, 50 requests per two hours for/advanced/stepTransaction, and 100 requests per minute for other endpoints. With an API key, the default is 100 requests per minute across all endpoints.
Overview
Composer does not require a dedicated endpoint. SettoToken to a supported protocol token address and LI.FI returns a Composer route from the standard endpoints.
The integration flow:
- Request a quote via
GET /v1/quoteorPOST /v1/advanced/routes - Set token allowance by approving the LI.FI Diamond contract to spend your tokens
- Send the transaction using the
transactionRequestfrom the quote response - Track status by polling
GET /v1/statusfor cross-chain transfers
Request a Composer Quote
Using GET /quote (Recommended)
The simplest way to get a Composer transaction. Returns a single 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%. If omitted, the API defaults to 0.005. Cross-chain routes involve more steps, so consider 0.01 (1%) or higher for cross-chain flows.
Using POST /advanced/routes
Returns multiple route options. Useful when you want to present choices to the user or need more control over route selection.
When using
/advanced/routes, transaction data is not included in the response. You must call POST /v1/advanced/stepTransaction to get the transactionRequest for each step. With /quote, transaction data is included directly.Getting transaction data for a route step
TypeScript
Quote Response Structure
A Composer quote response contains the route details, estimated output, and a ready-to-sign transaction. Here are the key fields:Key fields
Hex-encoded values: The
transactionRequest fields value, gasLimit, and gasPrice are hex strings (e.g., "0x5f45bc"). The chainId field is a plain number. When building transactions manually (e.g., in Python), parse hex fields with int(value, 16).Contract addresses
Theestimate.approvalAddress and transactionRequest.to both point to the LI.FI Diamond contract, a verified, audited smart contract deployed on all supported chains.
The Composer onchain VM (which executes the compiled bytecode) is a separate contract called internally by the Diamond. For audit reports and contract verification, see Security and Audits.
Morpho vault naming
Morpho vaults are named after their curator, not after Morpho itself. For example, the address0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A returns symbol: "sparkUSDC" because it is a Spark-curated Morpho vault. This is expected: Morpho provides the vault infrastructure, and curators like Spark create strategies on top.
Set Token Allowance
Before executing, the LI.FI Diamond contract needs approval to spend your tokens. The approval address is returned in the quote response atestimate.approvalAddress.
Skip this step if
fromToken is a native token (e.g., ETH). Native tokens don’t require approval.Send the Transaction
Submit thetransactionRequest from the quote response. This is a standard EVM transaction.
Track Status
For same-chain Composer transactions, the operation is complete once the transaction is confirmed. For cross-chain Composer flows, poll the/status endpoint until the transfer completes:
Error Handling
Common errors when working with Composer:
For the full error reference, see Error Codes.
Next Steps
Cross-Chain Patterns
Advanced cross-chain Composer flows and patterns
Withdrawals Guide
Implement same-chain and cross-chain withdrawals
Vault Deposit Recipes
Copy-paste recipes for Morpho, Aave, Euler, and more
SDK Integration
Managed execution with hooks, events, and automatic retries
Supported Protocols
Full list of supported protocols and capabilities

