# Quote a swap

> Quote an exact-input or exact-output swap

`POST /v2/swaps/quote`

Quote an exact-input or exact-output swap.

**Authentication:** None required. Optional: [integrator key](https://docs.wagyu.xyz/authentication.md) in `X-Integrator-Key`.

> **Checked against the live API:** - Send `fromToken` and `toToken` even though the schema marks them optional: without them the API answers `400` `missing/invalid field: fromToken`.
> - Use the token value from the catalog. The `"native"` shorthand described below fails on Ethereum (`no_route`); the zero address works. See [Chains and tokens](https://docs.wagyu.xyz/chains.md).
> - A quote under the minimum is not refused: it can return `200` with `"toAmount": "0"`. Compare `fromAmountUsd` with `minDepositUsd`.
> - `toAddress` is not validated at quote time; it is checked when the order is created.

## Request body

Send one of these 2 shapes:

### Shape 1: with `fromAmount`

- `fromChainId` · integer · **required** — Non-negative integer chain identifier.
- `toChainId` · integer · **required** — Non-negative integer chain identifier.
- `fromToken` · string — Token contract address on the corresponding chain. For a chain's native coin, send "native" or its native symbol.
- `toToken` · string — Token contract address on the corresponding chain. For a chain's native coin, send "native" or its native symbol.
- `fromTokenSymbol` · string — Optional symbol hint for the same token. Resolution is driven by the token address, not by this value.
- `toTokenSymbol` · string — Optional symbol hint for the same token. Resolution is driven by the token address, not by this value.
- `fromAmount` · string (atomic integer) · **required** — Positive base-10 integer in the asset’s atomic unit.
- `toAddress` · string — Intended destination address. Optional for a quote: it only lets the router account for destination-specific costs.
- `integratorFeePercent` · number (0–5) — Optional integrator fee percentage. Requires a valid integrator API key.

### Shape 2: with `toAmount`

- `fromChainId` · integer · **required** — Non-negative integer chain identifier.
- `toChainId` · integer · **required** — Non-negative integer chain identifier.
- `fromToken` · string — Token contract address on the corresponding chain. For a chain's native coin, send "native" or its native symbol.
- `toToken` · string — Token contract address on the corresponding chain. For a chain's native coin, send "native" or its native symbol.
- `fromTokenSymbol` · string — Optional symbol hint for the same token. Resolution is driven by the token address, not by this value.
- `toTokenSymbol` · string — Optional symbol hint for the same token. Resolution is driven by the token address, not by this value.
- `toAmount` · string (atomic integer) · **required** — Positive base-10 integer in the asset’s atomic unit.
- `toAddress` · string — Intended destination address. Optional for a quote: it only lets the router account for destination-specific costs.
- `integratorFeePercent` · number (0–5) — Optional integrator fee percentage. Requires a valid integrator API key.

## Response

`200` returns an object with:

- `toAmount` · string · **required**
- `fromAmount` · string or null
- `fromAmountUsd` · string or null
- `fromSymbol` · string or null
- `toAmountUsd` · string or null
- `toSymbol` · string or null
- `toolUsed` · string or null
- `feeFraction` · number or null
- `feeBreakdown` · object or null
  - `platformFeeRate` · number or null
  - `platformFeeXmr` · string or null
  - `platformFeeUsd` · string or null
  - `bridgeFlatFeeXmr` · string or null
  - `bridgeFlatFeeUsd` · string or null
  - `hlSizeRoundingXmr` · string or null
  - `hlSizeRoundingUsd` · string or null
  - `hlTakerFeeXmr` · string or null
  - `hlTakerFeeUsd` · string or null
  - `totalFeeUsd` · string or null
  - `totalCostUsd` · string or null
- `integratorFee` · object or null
  - `feePercent` · number · **required**
  - `feeAmountUsd` · number · **required**
  - `feeAddress` · string or null
- `minDepositUsd` · number or null
- `isXmrInput` · boolean
- `isXmrOutput` · boolean

Errors use the [standard error envelope](https://docs.wagyu.xyz/actions-and-retries.md#the-error-envelope): branch on `code`, never on the message.

## Example

<!-- curl -->
```bash
curl -X POST 'https://api-beta.wagyu.xyz/v2/swaps/quote' \
  -H 'content-type: application/json' \
  -d '{
    "fromChainId": 20000000000001,
    "toChainId": 0,
    "fromToken": "bitcoin",
    "toToken": "XMR",
    "fromAmount": "1000000",
    "toAddress": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"
  }'
```

<!-- JavaScript -->
```javascript
const res = await fetch('https://api-beta.wagyu.xyz/v2/swaps/quote', {
  method: 'POST',
  headers: {"content-type":"application/json"},
  body: JSON.stringify({
    "fromChainId": 20000000000001,
    "toChainId": 0,
    "fromToken": "bitcoin",
    "toToken": "XMR",
    "fromAmount": "1000000",
    "toAddress": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"
  }),
});
const data = await res.json();
```

<!-- Python -->
```python
import requests

res = requests.post('https://api-beta.wagyu.xyz/v2/swaps/quote', json={
        "fromChainId": 20000000000001,
        "toChainId": 0,
        "fromToken": "bitcoin",
        "toToken": "XMR",
        "fromAmount": "1000000",
        "toAddress": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"
    }, timeout=30)
data = res.json()
```

<!-- Response · 200 · captured 4 Nov 2026, 08:24 UTC -->
```json
{
  "toAmount": "1195223386000",
  "fromAmount": "1000000",
  "fromAmountUsd": "781.65",
  "fromSymbol": "BTC",
  "toAmountUsd": "765.30",
  "toSymbol": "XMR",
  "toolUsed": "near",
  "feeFraction": 0.02,
  "feeBreakdown": {
    "platformFeeRate": 0.02,
    "platformFeeXmr": "0.024392314",
    "platformFeeUsd": "15.62",
    "bridgeFlatFeeXmr": "0",
    "bridgeFlatFeeUsd": "0.00",
    "hlSizeRoundingXmr": "0.000754402624",
    "hlSizeRoundingUsd": "0.48",
    "hlTakerFeeXmr": "0.0003843",
    "hlTakerFeeUsd": "0.25",
    "totalFeeUsd": "15.62",
    "totalCostUsd": "16.35"
  },
  "integratorFee": null,
  "minDepositUsd": 40,
  "isXmrInput": false,
  "isXmrOutput": true
}
```

---
Source: https://docs.wagyu.xyz/api-reference/quote-swap · Built from the live Wagyu API on 2026-11-04.
