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

# Overview

> How Pods Swap v2 works end to end: one quote endpoint for same-chain, cross-chain, and fiat routes, then trustless execution and tracking

Pods Swap v2 prices and executes token swaps through a single endpoint. It automatically detects the route type — same-chain, cross-chain, or fiat ramp — aggregates across providers for the best output, and returns an executable payload you sign yourself. Pods never takes custody of funds.

<Info>
  Request the quote with wallet addresses (and `pixKey` for fiat offramps) and the response already includes the executable fields (`id`, `transactionData`, and `paymentInstructions` for fiat onramps) — you do not need a second `POST /v2/swap/bytecode` call.
</Info>

## Introduction

| Item                | Value                                                                                                                                                                                 |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Endpoint**        | `GET /v2/swap/quote` (quote + executable payload in one call)                                                                                                                         |
| **Route types**     | Same-chain (`originChain` == `destinationChain`), cross-chain (they differ), fiat ramp (`originChain`/`destinationChain` = `fiat`)                                                    |
| **Amounts**         | Token's smallest unit; provide exactly one of `amountIn` or `amountOut`                                                                                                               |
| **Providers**       | Aggregated across `relay`, `mayan`, `lifi`, `cctp`, `1inch`, `jupiter`, `teleswap`, `pods`, `symbiosis-bitcoin` — highest `expectedAmountOut` wins unless you set `preferredProvider` |
| **Execution**       | Trustless — you sign and submit `transactionData` yourself; Pods never custodies funds                                                                                                |
| **Status endpoint** | `GET /v2/swap/status/{quoteId}`                                                                                                                                                       |
| **Auth**            | Header `x-api-key: <your-key>`                                                                                                                                                        |

The system automatically detects the route type from the chains you pass and routes to the appropriate provider:

<Info>
  **Same-chain swap**: `originChain` equals `destinationChain`
  **Cross-chain swap**: `originChain` differs from `destinationChain`
  **Fiat ramp**: `originChain` or `destinationChain` is `fiat`
</Info>

## Authentication

Every request requires:

```
x-api-key: <your-api-key>
```

* The key identifies your **customer**. Fee configuration and strategy catalog are scoped to it.
* Success responses are the bare JSON body (HTTP 200). Errors use `{ "error": { "code", "message", "details?" } }`.
* Keep the API key on your **backend** — never expose it in a browser app.

Don't have a key yet? [Get an API key](https://www.pods.finance/plg/select-plan).

## Integration flow

<Steps>
  <Step title="Get a quote">
    Request a same-chain, cross-chain, or fiat quote. Pass `originAddress` and `destinationAddress` (or `pixKey` for fiat offramps) so the response includes executable fields.
  </Step>

  <Step title="Review the quote">
    Read `tokenOut.expectedAmountOut` / `minAmountOut` and `feeBreakdown` before executing, and store the canonical `chainIdIn` / `chainIdOut` and `quote.quoteId`:

    ```http theme={null}
    GET /v2/swap/quote
    ```

    Full guide: [Get a quote](/guides/swaps/get-quote).
  </Step>

  <Step title="Execute">
    Execute all origin-chain `transactionData` legs as **one atomic batch** (EIP-7702 or a smart-account userOp) from `originAddress` — never submit them one by one, or a later failure can leave approvals/transfers committed and strand funds. Fiat onramps have nothing to sign — show `paymentInstructions` instead:

    ```http theme={null}
    GET /v2/swap/quote
    ```

    Full guide: [Execute a swap](/guides/swaps/execute-swap) (atomic batching via [EIP-7702](/examples/javascript/using-eip7702) or [Executing Bytecode](/getting-started/executing-bytecode)).
  </Step>

  <Step title="Track">
    Poll the swap to `fulfilled` with the quote's `quoteId`, or subscribe to live WebSocket updates:

    ```http theme={null}
    GET /v2/swap/status/{quoteId}
    ```

    Full guide: [Track a swap](/guides/swaps/track-status).
  </Step>
</Steps>
