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

# Overview

> One API for all swap use cases on Jupiter

The Swap API unifies Jupiter's swap capabilities into a single entry point at `https://api.jup.ag/swap/v2`. Two paths cover every use case: a default happy path for the best swap experience, and an advanced path for full transaction control.

<CardGroup cols={2}>
  <Card title="Order & Execute" icon="bolt" href="/swap/order-and-execute">
    The default path. Get a fully assembled transaction with the best price across all routers, sign it, and send it to execute endpoint for managed landing.
  </Card>

  <Card title="Build Custom Transactions" icon="code" href="/swap/build">
    The advanced path. Get raw swap instructions to build your own transaction. Add custom instructions, CPI, or modify the transaction however you need.
  </Card>
</CardGroup>

## Choosing a path

|                              | `/order` + `/execute`                                                           | `/build`                                  |
| ---------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------- |
| **Returns**                  | Assembled transaction                                                           | Raw swap instructions                     |
| **Routers**                  | All (Metis, RFQ, Dflow, OKX)                                                    | Metis only                                |
| **Best for**                 | Most integrations. Best price, simplest flow.                                   | Custom transactions, CPI, composability.  |
| **Execution**                | Managed via `/execute` (optimised slippage, priority fees, accelerated landing) | Self-managed via your own RPC             |
| **Swap fees**                | Yes (Jupiter platform fee)                                                      | No                                        |
| **Integrator fees**          | Referral fees (referralAccount + referralFee)                                   | Platform fee only (platformFeeBps) or DIY |
| **Gasless**                  | [Automatic gasless, or your own `payer`](/swap/advanced/gasless)                | Use your own `payer`                      |
| **Transaction modification** | No                                                                              | Full control                              |

**Start with `/order`.** It gives you the best price because all routers compete, including RFQ market makers who often beat onchain routing by 5-20bps on major pairs. Only use `/build` if you need to modify the transaction.

## Endpoints

| Endpoint                                                      | Method | Description                           |
| ------------------------------------------------------------- | ------ | ------------------------------------- |
| [`/order`](/swap/order-and-execute)                           | GET    | Get a quote and assembled transaction |
| [`/build`](/swap/build)                                       | GET    | Get a quote and raw swap instructions |
| [`/execute`](/swap/order-and-execute#execute-the-transaction) | POST   | Execute a signed `/order` transaction |

**Base URL:** `https://api.jup.ag/swap/v2`

All endpoints require an API key via the `x-api-key` header. Get one at [Portal](https://developers.jup.ag/portal).

## API Reference

<CardGroup cols={3}>
  <Card title="GET /order" icon="bolt" href="/api-reference/swap/order">
    Get a quote and assembled transaction
  </Card>

  <Card title="GET /build" icon="code" href="/api-reference/swap/build">
    Get a quote and raw swap instructions
  </Card>

  <Card title="POST /execute" icon="play" href="/api-reference/swap/execute">
    Execute a signed /order transaction
  </Card>
</CardGroup>

## Learn More

<CardGroup cols={2}>
  <Card title="Routing" icon="route" href="/swap/routing">
    How routing works, which routers are available on each endpoint, and how to integrate your liquidity.
  </Card>

  <Card title="Fees" icon="receipt" href="/swap/fees">
    Fee models for /order (platform + referral) and /build (integrator only).
  </Card>

  <Card title="Advanced" icon="gear" href="/swap/advanced">
    Gasless swaps, compute unit estimation, reducing transaction size and latency.
  </Card>

  <Card title="Migration Guide" icon="arrow-right" href="/swap/migration">
    Migrating from Ultra or Metis to Swap V2.
  </Card>
</CardGroup>


Built with [Mintlify](https://mintlify.com).