# Lifi

LI.FI REST API for cross-chain and same-chain token swaps, bridging, DeFi deposits...

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill lifi -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill lifi -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill lifi -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill lifi -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## Description

LI.FI REST API for cross-chain and same-chain token swaps, bridging, DeFi deposits (Composer), yield discovery (Earn), and intent-based execution (Intents). USE THIS SKILL WHEN USER WANTS TO: - Swap tokens between different blockchains (e.g., "swap USDC on Ethereum to ETH on Arbitrum") - Bridge tokens to another chain (e.g., "move my ETH from mainnet to Optimism") - Swap tokens on the same chain with best rates (e.g., "swap ETH to USDC on Polygon") - Find the best route or quote for a token swap across chains - Deposit into DeFi vaults/lending/staking in one click, including cross-chain (Composer: Aave, Morpho, Pendle, EtherFi, Yearn, etc.) - Discover yield opportunities, vault APY/TVL data, or track DeFi positions (Earn) - Execute gasless or intent-based transfers via a solver network (LI.FI Intents) - Move stablecoins cheaply with optimized defaults (stablecoin preset) - Build multi-chain payment flows (accept any token, settle in specific token) - Check supported chains, tokens, bridges, or gas prices - Track status of a cross-chain transaction, recover from failed/partial transfers - Query transfer history/analytics or withdraw collected integrator fees - Build backends, bots, or AI agents (any language) that need cross-chain functionality

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# LI.FI API Integration

LI.FI aggregates bridges, DEXs, intent solvers, and DeFi protocols behind one API. This skill covers the full product surface:

| Product | Base URL | What it does |
|---------|----------|--------------|
| **Core API** (swaps & bridges) | `https://li.quest/v1` | Quotes, routes, execution data, status tracking across 75+ chains |
| **Composer** (DeFi execution) | `https://li.quest/v1` (same `/quote` endpoint) | One-click swap/bridge + deposit/withdraw into vaults, lending, staking |
| **Earn** (yield data) | `https://earn.li.fi/v1` | Vault discovery, APY/TVL analytics, portfolio positions |
| **Intents** (solver marketplace) | `https://order.li.fi` | Intent-based orders filled by a competitive solver network |

For AI agents, LI.FI also offers an MCP server (`https://mcp.li.quest/mcp`) and a CLI (`@lifi/cli`). LI.FI recommends agents and backends use the REST API directly rather than the SDK.

## Authentication & Rate Limits

API key is **optional**, it only raises rate limits. Header: `x-lifi-api-key` (get one at the [LI.FI Partner Portal](https://portal.li.fi/)).

```bash
curl "https://li.quest/v1/chains" -H "x-lifi-api-key: YOUR_API_KEY"
```

| Tier | `/quote`, `/advanced/routes` | `/advanced/stepTransaction` | Other endpoints |
|------|------------------------------|------------------------------|-----------------|
| Without API key | 75 req / 2 hours | 50 req / 2 hours | 100 req / minute |
| With API key (default) | 100 RPM (2-hour rolling window: 12,000 / 2h) | same | 100 RPM |

Responses include `ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset` (seconds) headers. 429 responses carry error code `1005`. Never expose your API key in client-side code.

## Quick Start, The Five-Call Recipe

The canonical flow for any swap/bridge:

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/lifi/lifi/SKILL.md
