LI.FI
Swap and bridge across chains with LI.FI on vAPI Call: quotes, routes and ready-to-sign transactions for $0.001 in USDC on Base per call.
LI.FI finds the best swap and bridge route between two tokens, on one chain or across more than 60 chains, and returns the transaction your wallet signs. On Call, vAPI hosts an x402 layer in front of LI.FI’s API. You pay $0.001 per call in USDC on Base, straight to LI.FI’s wallet, with no LI.FI account and no API key.
vAPI never touches the tokens you swap. LI.FI returns an unsigned transaction, your own wallet signs and sends it, and your address is the sender on every request.
| Fact | Value |
|---|---|
| Listing | api.vapinetwork.ai/call/lifi, ref lifi |
| Group and tier | Verified Provider, verified by vAPI |
| Price | $0.001 per call, every endpoint |
| Asset and network | USDC on Base (eip155:8453) |
| Protocol | x402 v2, exact scheme |
| Payee | 0x29A57013BbF3fDBE2cCD6D3612FD45fd7ef27984 (LI.FI’s fee wallet) |
| vAPI network fee | None |
How a call is paid
- You send a
POSTwith a JSON body toapi.vapinetwork.ai/shim/lifi/<endpoint>. - vAPI answers 402 with the offer: $0.001 in USDC on Base to LI.FI’s wallet.
- Your client or browser wallet checks the offer against your limits and signs the payment.
- vAPI validates the body, forwards it to LI.FI’s API at
li.quest/v1, and settles the payment only when LI.FI returns a usable answer. - The
vapiclient writes a receipt; the console shows the settlement reference.
The payment goes to LI.FI’s wallet in full. vAPI does not sign for you and keeps no share. The listing carries the badge “Provider failures aren’t charged”: invalid input, LI.FI errors (401, 403, 429, 5xx), timeouts and throttling end the call without settlement. A valid request that LI.FI answers with 400, 404 or 422 is settled, because LI.FI did the work.
The $0.001 buys the answer. The swap itself costs what LI.FI’s quote states: LI.FI’s own fee appears in estimate.feeCosts (0.25% in the quotes on this page, already included in toAmount), and gas is paid by the wallet that sends the transaction.
Endpoints
The listing has 9 endpoints. Every endpoint takes a POST with a JSON body; vAPI maps it to LI.FI’s own GET or POST route.
| Endpoint | LI.FI route | What it returns |
|---|---|---|
quote |
GET /quote |
The best swap or bridge route for an amount, with a ready-to-sign transactionRequest |
routes |
POST /advanced/routes |
Several ranked routes to compare, without transaction data |
step-transaction |
POST /advanced/stepTransaction |
The ready-to-sign transaction for one step of a route from routes |
status |
GET /status |
The status of a cross-chain transfer, by its source transaction hash |
chains |
GET /chains |
Chains LI.FI can swap and bridge between |
tokens |
GET /tokens |
Tokens LI.FI supports on each chain, with USD prices |
token |
GET /token |
One token’s address, decimals and USD price on a chain |
connections |
GET /connections |
Which tokens can move between two chains |
tools |
GET /tools |
The bridges and exchanges LI.FI routes through |
Chains take a chain id (8453) or LI.FI’s chain key (BAS for Base, ARB for Arbitrum, ETH for Ethereum, OPT for Optimism, POL for Polygon). Tokens take an address or a symbol. Amounts are strings in the token’s base units: 5000000 is 5 USDC, which has 6 decimals. quote and routes need fromAddress, the wallet that will sign. Bodies for quote and routes are strict: an unknown field is refused before payment settles. The 402 offer carries each endpoint’s input schema and an example body. Check an endpoint’s offer for free:
vapi check https://api.vapinetwork.ai/shim/lifi/quote --method POST
Check: POST https://api.vapinetwork.ai/shim/lifi/quote — HTTP 402
pass status HTTP 402 Payment Required.
pass transport The offer is in the PAYMENT-REQUIRED header and the body.
pass version Declares x402 version 2.
pass fields Every field x402 v2 requires is present and well-typed.
pass scheme 1 of 1 accepted option uses the exact scheme.
pass asset Pays canonical USDC on eip155:8453.
pass pay_to Every exact option names a well-formed payTo address.
pass timeout maxTimeoutSeconds 120.
pass extensions Advertises bazaar, builder-code, payment-identifier.
pass discovery Discovery document at https://api.vapinetwork.ai/.well-known/x402 lists 6 resources.
warn openapi https://api.vapinetwork.ai/x402/openapi.json (via the API catalog at https://api.vapinetwork.ai/.well-known/api-catalog) describes no POST /shim/lifi/quote. [openapi_operation_missing]
10 passed, 1 warning, 0 failed.
Swap or bridge in one call
quote is the shortest path: one paid call returns the best route and the transaction to sign. Quote moving 5 USDC from Base to Arbitrum:
vapi pay lifi \
--endpoint quote \
--method POST \
--content-type application/json \
--body '{"fromChain":"BAS","toChain":"ARB","fromToken":"USDC","toToken":"USDC","fromAddress":"0x39733BD6670B1d0EA1ec081F8B2137663Bc2d510","fromAmount":"5000000"}' \
--max 0.01
--max is the most you agree to pay for this call. The client refuses to sign if the live offer is higher. The result is JSON with status, body (LI.FI’s response) and payment. From the run above, shortened:
{
"status": 200,
"body": {
"type": "lifi",
"tool": "lifiIntents",
"action": {
"fromChainId": 8453,
"fromAmount": "5000000",
"fromToken": { "symbol": "USDC", "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" },
"toChainId": 42161,
"toToken": { "symbol": "USDC", "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" }
},
"estimate": {
"toAmount": "5007450",
"toAmountMin": "5007450",
"approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
"executionDuration": 6,
"feeCosts": [
{
"name": "LIFI Fixed Fee",
"percentage": "0.0025",
"amountUSD": "0.0125",
"included": true
}
]
},
"transactionRequest": {
"to": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
"chainId": 8453,
"value": "0x0",
"data": "0x6d21c5df…",
"gasLimit": "0xa84fb"
}
},
"payment": {
"network": "eip155:8453",
"amountUsd": "0.001",
"payTo": "0x29A57013BbF3fDBE2cCD6D3612FD45fd7ef27984",
"settlement": {
"success": true,
"explorerUrl": "https://basescan.org/tx/0xc326c722518376b9595668c2ef293d5aea6ff74b319f346966b2ae6e252dda5d"
}
}
}
toAmountMin is the least the route delivers after slippage, and executionDuration is LI.FI’s estimate in seconds. To execute the quote from your own wallet:
- If the source token is an ERC-20, approve
estimate.approvalAddressto spend at leastfromAmount. Native tokens such as ETH need no approval. - Send
transactionRequestunchanged fromfromAddress, ontransactionRequest.chainId. That wallet pays the gas in the chain’s native token. - For a cross-chain transfer, poll
statuswith the source transaction hash until it reportsDONEorFAILED.
The x402 payment buys the quote, not the swap. vAPI and LI.FI never hold your keys or sign for you.
Compare routes, then build one
routes returns several ranked options without transaction data, so you can compare output, fees and duration first. Each route has steps; send a step back unchanged to step-transaction to get its ready-to-sign transaction. That is two paid calls, $0.002 in total.
vapi pay lifi \
--endpoint routes \
--method POST \
--content-type application/json \
--body '{"fromChainId":8453,"fromAmount":"5000000","fromTokenAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","toChainId":42161,"toTokenAddress":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","fromAddress":"0x39733BD6670B1d0EA1ec081F8B2137663Bc2d510","options":{"order":"CHEAPEST","slippage":0.005}}' \
--max 0.01 \
--json > routes.json
That run returned 13 routes, cheapest first. The first three, shortened to their totals:
[
{
"id": "12c34984-67fc-4edb-ba21-6d60736316b1",
"toAmount": "5007450",
"toAmountMin": "5007450",
"gasCostUSD": "0.0045",
"steps": [{ "tool": "lifiIntents", "executionDuration": 6 }]
},
{
"id": "583817f8-a1a2-4299-8b97-45e456412306",
"toAmount": "4987500",
"toAmountMin": "4987500",
"gasCostUSD": "0.0040",
"steps": [{ "tool": "polymerStandard", "executionDuration": 1080 }]
},
{
"id": "91b90d0d-62fd-4051-9e24-bc51079a1308",
"toAmount": "4983231",
"toAmountMin": "4958314",
"gasCostUSD": "0.0040",
"steps": [{ "tool": "layerswap", "executionDuration": 3 }]
}
]
Pick a route and send its step back exactly as LI.FI returned it. Do not edit or trim the step; step-transaction accepts every field LI.FI includes:
jq -c '.body.routes[0].steps[0]' routes.json > step.json
vapi pay lifi \
--endpoint step-transaction \
--method POST \
--content-type application/json \
--body "$(cat step.json)" \
--max 0.01
The answer is the same step with transactionRequest filled in. From the run above, shortened:
{
"status": 200,
"body": {
"type": "lifi",
"tool": "lifiIntents",
"transactionRequest": {
"to": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
"chainId": 8453,
"value": "0x0",
"data": "0x6d21c5df…",
"gasLimit": "0xa84fb"
}
},
"payment": {
"amountUsd": "0.001",
"payTo": "0x29A57013BbF3fDBE2cCD6D3612FD45fd7ef27984",
"settlement": {
"success": true,
"explorerUrl": "https://basescan.org/tx/0x9b160e666d66a73bb0bbf883a57a1ede0d0ad8bfaf61749a27dc198578747fdf"
}
}
}
Approve and send it the same way as a quote. A route with several steps needs one step-transaction call per step, each sent after the previous step completes.
Track a cross-chain transfer
After you send a cross-chain transaction, ask status for its progress with the source transaction hash and chain:
vapi pay lifi \
--endpoint status \
--method POST \
--content-type application/json \
--body '{"txHash":"0x9b2b9da201d3de79031d4ac27a8d39b6a5468c15fc19816598420352aea52e82","fromChain":"BAS"}' \
--max 0.01
For a transfer that went through LI.FI, the body carries status (PENDING, DONE, FAILED or NOT_FOUND) and a substatus; see LI.FI’s status reference. Poll every few seconds until it reports DONE or FAILED. The hash in this run was an x402 payment, not a LI.FI transfer, so LI.FI answered 404:
{
"status": 404,
"body": {
"message": "No event found, this transaction was not handled by LI.FI contracts.",
"code": 1003
},
"payment": {
"amountUsd": "0.001",
"payTo": "0x29A57013BbF3fDBE2cCD6D3612FD45fd7ef27984",
"settlement": {
"success": true,
"explorerUrl": "https://basescan.org/tx/0x3b5d49dcdd858376fb580775d9e34e467f3cdb9dcd2c3b97c619bcb8f0890792"
}
}
}
That call still settled $0.001: a valid request that LI.FI answers with 404 is settled, because LI.FI did the lookup.
Before you start
- For the console: a browser wallet with a little USDC on Base.
- For the CLI, SDK or MCP: Node.js 22 or later and the
vapiwallet from the Quickstart, funded with a few dollars of USDC on Base. You do not need ETH for the x402 payment. - To send a swap or bridge transaction: the tokens you move and the native gas token on the source chain, in the wallet that signs.
In the console
- Open api.vapinetwork.ai/call/lifi and choose an endpoint, for example
quote. - Under Request input, choose JSON and enter the body, for example
{"fromChain": "BAS", "toChain": "ARB", "fromToken": "USDC", "toToken": "USDC", "fromAddress": "<your wallet>", "fromAmount": "5000000"}. - Choose Check live price. The quote shows $0.001, Base, and LI.FI’s wallet as the payee.
- Connect your wallet if you have not, choose Pay 0.001 USDC and call, and sign the authorization your wallet shows.
- Choose View result to read the JSON response and its settlement reference.
With the SDK
import { createVapiClient } from "vapi-network";
const vapi = await createVapiClient({ account: "main" });
const result = await vapi.call.pay({
id: "lifi",
endpoint: "token",
method: "POST",
contentType: "application/json",
body: { chain: "BAS", token: "USDC" },
maxPriceUsd: 0.01,
expectedPayTo: "0x29A57013BbF3fDBE2cCD6D3612FD45fd7ef27984",
});
console.log(
result.body.symbol,
result.body.decimals,
result.body.priceUSD,
result.payment.amountUsd
);
USDC 6 0.9983431802 0.001
endpoint is required for this listing because it has several endpoints. expectedPayTo makes the client refuse an offer that pays any other address. The SDK applies the account’s caps and writes the same receipts as the CLI.
From an agent on MCP
Install the local MCP server once (Quickstart, MCP tab):
vapi mcp install claude-desktop # or: claude-code, cursor, codex
Then ask, for example:
Use LI.FI on vAPI to quote bridging 5 USDC from Base to Arbitrum for my wallet, and tell me what I receive and how long it takes.
Use LI.FI on vAPI to compare the cheapest routes for swapping 10 USDC on Base to ETH on Optimism.
Use LI.FI on vAPI to check whether USDC can move from Base to Polygon and which bridges support it.
Use LI.FI on vAPI to check the status of my bridge transaction 0x… from Base.
The agent calls call.search to find the listing, call.inspect with the endpoint name to read its offer, and call.pay with maxPriceUsd to run it. The account’s caps bound what it can spend. A quote comes back unsigned; the agent cannot send it without a wallet that holds the tokens and gas on the source chain.
Price
Every endpoint costs $0.001 per call, as of this page’s check date. There is no vAPI fee. The live 402 offer is the price; your client compares it with --max, maxPriceUsd and your caps before signing. LI.FI’s swap fee and gas are separate and shown in each quote.
Limits and errors
| Problem | What to do |
|---|---|
| The client refuses to sign | The live offer is above --max or maxPriceUsd, or above your account caps. Raise the limit, or check the offer with vapi check. |
ambiguous_default or “has 9 distinct payable endpoints” |
Name an endpoint with --endpoint in the CLI or endpoint in the SDK. |
400 invalid_input |
vAPI refused the body: an unknown field in quote or routes, a missing fromAddress, or an amount that is not a whole number in base units. It does not settle. Fix the body against the schema in the 402 offer. |
409 payment_in_use |
The same signed payment is already in flight. Wait for the first call to finish; do not resend the same payment. |
429 payer_throttled |
Your wallet passed 30 requests a minute or 1,000 LI.FI calls in a UTC day. Wait for the Retry-After time. Throttled calls are not settled. |
503 partner_unavailable |
All Call buyers share one LI.FI allowance, and it is used up for now. Wait for the Retry-After time. The call is not settled. |
| A quote has no route, or LI.FI answers 404 | No route exists for that pair, amount or chain. Check connections, try a larger amount, or another token. A valid request LI.FI answers with 404 is settled. |
| The transaction reverts | The quote went stale or the approval is missing. Approve estimate.approvalAddress, request a new quote and send it promptly. |
| A response is lost after you paid | Run vapi pay --resume <receipt-id>. It reads the chain and tells you whether the payment settled. |
| Not enough USDC | Run vapi balance, then vapi fund. |
Learn more
Checked on 2026-11-25.