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

> ## Agent Instructions
> Soroswap Aggregator API: base URL https://api.soroswap.finance, pick the network with ?network=mainnet or ?network=testnet (omitted means mainnet).
> Auth: Authorization: Bearer sk_... on every call. Get a key at https://console.soroswap.finance/register. A missing or invalid key returns 401 with code and registerUrl (POST /send returns 403 instead); an expired JWT or a missing role returns 403. Free plan 1 request/s; see https://docs.soroswap.finance/api/plans.md.
> Flow: POST /quote (assetIn, assetOut as C... contract addresses, amount as an integer string in the smallest unit, tradeType, protocols) -> POST /quote/build with the unchanged quote and from -> the user signs the XDR -> POST /send. Build right after quoting: a Soroban XDR is valid for 180 seconds. Submit it as is, never re-simulate it.
> Partner id: every account has one (9 hex chars, permanent). Read partnerId from GET /partner, or in the console at https://console.soroswap.finance under Fees & payouts. The partner fee itself is switched on by Soroswap; see https://docs.soroswap.finance/api/fees.md.
> AI tools: docs MCP at https://docs.soroswap.finance/mcp (claude mcp add --transport http soroswap-docs https://docs.soroswap.finance/mcp), skill with npx skills add https://docs.soroswap.finance. Other clients: https://docs.soroswap.finance/api/build-with-ai.md.
> Units and Stellar pitfalls: https://docs.soroswap.finance/api/stellar-gotchas.md. Errors and retries: https://docs.soroswap.finance/api/errors.md.

# The Swap Aggregator for Stellar

> The Soroswap Aggregator API at https://api.soroswap.finance quotes Soroswap, Aquarius, SushiSwap V3, Comet and SDEX, splits each trade for the best price and returns a transaction to sign. Bearer sk_ key; the free plan allows 1 request/s.

One API call gets your users the best price on Stellar. The Soroswap Aggregator API quotes
Soroswap, Aquarius, SushiSwap V3, Comet and the Stellar classic DEX (SDEX), splits the trade
across them when that pays, and returns a route your app can execute right away.

> [card] [Get an API key](https://console.soroswap.finance/register)
>
> Sign up in the console and generate a key in a minute. The free plan needs no approval.

> [card] [Quickstart](https://docs.soroswap.finance/api/quickstart.md)
>
> Your first quote and swap on mainnet in five minutes.

> [card] [API Reference](https://docs.soroswap.finance/api-reference/quote/quote.md)
>
> Every endpoint, request and response.

> [card] [Monetize your flow](https://docs.soroswap.finance/api/fees.md)
>
> Set a partner fee on your swaps and get your share in USDC every month.

## What you get

* **Best execution across Stellar.** Every quote prices the Soroban venues and, when you ask for
  it, the classic order book. A single trade can split across several pools and hops. See
  [supported venues](https://docs.soroswap.finance/aggregator/supported-amms.md).
* **Gasless trustline.** A user who has never held the output asset, and has no XLM to open a
  trustline, can still receive it in one swap: a sponsor account you control pays for the
  trustline. See [Gasless Trustline](https://docs.soroswap.finance/api/gasless-trustline.md).
* **Revenue on every swap.** Configure a partner fee once on your account. It is collected
  on-chain and settled to you in USDC each month, with a statement per token. See
  [Fees and revenue share](https://docs.soroswap.finance/api/fees.md).
* **Two ways to execute.** Let the API build the transaction for your user to sign, or take the
  route and execute it from your own Soroban contract. See [Quickstart](https://docs.soroswap.finance/api/quickstart.md).

## How to start

1. [Sign up in the console](https://console.soroswap.finance/register) and generate an API key (it starts with `sk_`).
2. Call `POST /quote` with the two assets, the amount and the venues you want in `protocols`.
3. Call `POST /quote/build` to get the transaction, have your user sign it, and submit it with
   `POST /send`.

```bash theme={null}
curl -X POST "https://api.soroswap.finance/quote?network=mainnet" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "assetIn": "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA",
    "assetOut": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
    "amount": "100000000",
    "tradeType": "EXACT_IN",
    "protocols": ["soroswap", "aqua", "sushi", "comet", "sdex"]
  }'
```

The base URL is `https://api.soroswap.finance` for both mainnet and testnet; pick the network
with `?network=`. Request limits depend on your plan, see [Plans and rate limits](https://docs.soroswap.finance/api/plans.md).

## Building on the AMM instead

If you provide liquidity, or your contract needs to trade directly against Soroswap pools, the
[Soroswap AMM](https://docs.soroswap.finance/amm.md) section documents the pair, factory and router contracts.

## Support

Developer questions go to [dev@paltalabs.io](mailto:dev@paltalabs.io) or the developer channels on
[Discord](https://discord.gg/A2rQ3cm9XG). For a large integration or a commercial agreement, see
[Business Partnerships](https://docs.soroswap.finance/resources/partnerships/business-partnerships.md).

## Video walkthrough

[Soroswap API walkthrough](https://www.youtube.com/embed/5KtXqx2I0A0)


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