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

# Swap API Overview

> Use Rialto as an execution venue: request a quote, then submit the transaction it returns.

## What the API does

The Swap API turns an order into an executable transaction. You request a quote
for a sell token, buy token, and amount, and Rialto returns the best route, the
expected output, the fee breakdown, and a ready-to-send transaction for the
RialtoRouter contract.

The integration boundary is intentionally small: call the quote endpoint, then
submit the returned transaction. You never build route calldata, pool calls, fee
logic, slippage math, Permit2 witnesses, or settlement actions yourself.

## Base URL

```text theme={null}
https://rialto-trade-api.rialto.xyz
```

Protected endpoints require an API key, passed as a bearer token:

```http theme={null}
Authorization: Bearer <api_key>
```

See [Authentication and API Keys](/developers/authentication) for how to obtain
and scope a key.

## Execution flows

Rialto supports two execution flows. Each quote tells you which settlement mode
applies; choose your handling from the response rather than assuming.

* Taker-submitted. The user's wallet submits the onchain transaction and pays gas.
  Use this for native-token sells and for any flow where the taker broadcasts.
* Gasless relayer. The user signs a Permit2 message and Rialto broadcasts the
  transaction and pays gas. Available for ERC20 sells.

## Quickstart

1. Call the tokens endpoint to discover supported tokens.
2. Call the quote endpoint with the sell token, buy token, amount, taker, and
   slippage.
3. Inspect the quote's issues for balance and allowance blockers. Ask the user to
   approve if issues.allowance is present.
4. If the quote includes a Permit2 payload, have the taker sign the returned
   EIP-712 message and insert the signature into tx.data at tx.signature\_offset.
5. Submit the returned transaction from the taker wallet, or for gasless, submit
   the signature to /gasless/submit and poll /gasless/status/{relay_id}.

The pages that follow detail authentication, the tokens and quote endpoints,
executing a quote, the gasless flow, integrator onboarding, fees, and errors.

## Reference

Full API reference:
[https://github.com/rialto-plds/rialto-api-docs/blob/main/RIALTO\_SWAP\_API.md](https://github.com/rialto-plds/rialto-api-docs/blob/main/RIALTO_SWAP_API.md)
