> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Author DeFi flows as Flow documents, compile them to calldata, and execute them with one signature, on one chain or across chains.

The Composer API lets you author a multi-step DeFi operation as a **Flow** with `@lifi/composer-sdk` and compile it with `POST /compose` at `https://composer.li.quest`. The compiled Flow runs atomically in one signed transaction. A flow can also end in a bridge or LI.FI Intents order, and a [cross-chain flow](https://docs.li.fi/composer/composer-api/concepts/cross-chain-flows.md) can run more steps on the destination chain after the funds arrive. The same mechanism, a continuation, can also run steps later on the flow's own chain.

## Before you start

* **API key.** Every compile request needs a LI.FI API key from the [LI.FI Partner Portal](https://portal.li.fi). The SDK sends it as the `x-lifi-api-key` header, and requests without a valid key are rejected. Keep the key on your server: compile there and send only the resulting transactions to the browser. The metadata endpoints (`GET /compose/manifest`, `GET /compose/zap-packs`, `GET /chains` and the `llms.txt` files) answer without a key.

* **SDK and spec versions.** Install both packages on the same version. These docs target 0.14.0.

  ```bash theme={"system"}
  npm install @lifi/composer-sdk @lifi/compose-spec
  ```

* **Runtime.** The SDK runs on Node.js 24 or later.

* **Base URL.** The SDK has no default host. Pass `baseUrl: 'https://composer.li.quest'` and your `apiKey` to `createComposeSdk`.

* **Version check.** The SDK sends its version in the `x-lifi-composer-sdk` header. The server rejects an SDK older than 0.5.0 with HTTP 400 `sdk_outdated`: upgrade both packages. It rejects an SDK newer than the server with HTTP 400 `server_outdated`: pin both packages to the server's version, or wait for the server rollout.

The [Quickstart](https://docs.li.fi/composer/composer-api/quickstart.md) walks through the setup with a runnable example.

## What is a Flow?

A Flow declares its inputs, an ordered list of op calls that pass outputs to later calls, optional guards on those outputs, and an optional epilogue that moves leftover balances off the execution proxy. See [Flow Structure](https://docs.li.fi/composer/composer-api/concepts/flow-anatomy.md) for the authored fields and [the compile response](https://docs.li.fi/composer/composer-api/concepts/execution-model.md#the-compile-response) for what `POST /compose` returns.

## Account model

Composer never holds your funds in a shared contract. **Each signer gets their own execution proxy**:

* **Deterministic.** The proxy factory derives the proxy address from the signer's address (CreateX `CREATE3`), so a signer always maps to the same proxy on a given chain. The SDK exposes it as `builder.context.executionAddress`, and the compile response returns it as `userProxy`.
* **You transact with your proxy.** The signed transaction's `to` is your proxy. On the proxy's first use it is the proxy factory, which deploys the proxy and runs the flow in the same transaction.
* **Access-controlled.** Only the signer can run a flow against their proxy or move its balances.
* **Funds stay put by default.** Any balance the flow does not move out stays on the proxy. A later flow can spend it, for example with the [`balanceOf`](https://docs.li.fi/composer/composer-api/materialisers/balance-of) materialiser.

Funds leave the proxy through an op that delivers to an address, through the flow epilogue (or `run.sweepTo`), or into the escrow of a continuation. See [Terminal Resources](https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts.md) for what each one moves, and [Addresses](https://docs.li.fi/composer/composer-api/reference/addresses.md) for the proxy factory address per chain.

## Endpoints

All paths are relative to `https://composer.li.quest`:

| Endpoint | SDK method | Purpose |
| - | - | - |
| `POST /compose` | `builder.compile(run)`, `sdk.client.compile(request)` | Compile a Flow into calldata. |
| `POST /compose/route` | `sdk.route(request)` | Plan and compile a route for a token pair, without authoring a Flow. The hop limit is in the manifest's `routing` block (two hops in production). |
| `POST /simulate` | `sdk.simulate(request)` | Simulate a raw transaction and report balance changes and gas. |
| `GET /compose/manifest` | `sdk.client.getManifest()` | The live catalog of ops, guards and materialisers, with their ports and config schemas. |
| `GET /compose/zap-packs` | `sdk.client.getZapPacks()` | The routing edges (position entries and exits, wraps) that zaps and routes can use. |
| `GET /chains` | `sdk.getSupportedChains()` | The chains where Composer is deployed. |
| `GET /addresses` | — | The VM, proxy factory and helper contract addresses per chain. |
| `GET /intent-factory/status` | — | The status of a continuation's escrow, cross-chain or same-chain. See [Escrow status](https://docs.li.fi/composer/composer-api/reference/escrow-status.md). |

## Machine-readable docs

These paths serve the API documentation for AI agents and coding assistants. They need no API key:

| Resource | Path | Description |
| - | - | - |
| `llms.txt` | `/llms.txt` | An index of the Composer API documentation. |
| `llms-full.txt` | `/llms-full.txt` | The full documentation in one file. |
| Manifest | `/compose/manifest` | The JSON catalog of every op, guard and materialiser the deployment serves. |

## Where to go next

> [card] [Quickstart](https://docs.li.fi/composer/composer-api/quickstart.md)
>
> One runnable same-chain flow in five minutes.

> [card] [Build a cross-chain flow](https://docs.li.fi/composer/composer-api/guides/build-a-cross-chain-flow.md)
>
> Bridge, then act on the destination chain, with one signature.

> [card] [Recipes](https://docs.li.fi/composer/composer-api/recipes.md)
>
> Runnable flows for common tasks.

> [!NOTE]
>
> Going cross-chain? If you only need to deposit into a supported vault on another chain, the LI.FI API's [cross-chain deposits](https://docs.li.fi/composer/lifi-api/guides/cross-chain-compose.md) do it with one quote. See [Which cross-chain path?](https://docs.li.fi/composer/composer-api/concepts/cross-chain-flows.md#which-cross-chain-path)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.