API reference
Quote a swap
POST
/v2/swaps/quoteQuote an exact-input or exact-output swap.
Authentication: None required. Optional: integrator key in X-Integrator-Key.
#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 · requiredfromAmount· string or nullfromAmountUsd· string or nullfromSymbol· string or nulltoAmountUsd· string or nulltoSymbol· string or nulltoolUsed· string or nullfeeFraction· number or nullfeeBreakdown· object or nullplatformFeeRate· number or nullplatformFeeXmr· string or nullplatformFeeUsd· string or nullbridgeFlatFeeXmr· string or nullbridgeFlatFeeUsd· string or nullhlSizeRoundingXmr· string or nullhlSizeRoundingUsd· string or nullhlTakerFeeXmr· string or nullhlTakerFeeUsd· string or nulltotalFeeUsd· string or nulltotalCostUsd· string or null
integratorFee· object or nullfeePercent· number · requiredfeeAmountUsd· number · requiredfeeAddress· string or null
minDepositUsd· number or nullisXmrInput· booleanisXmrOutput· boolean
Errors use the standard error envelope: branch on code, never on the message.
#Example
curl
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
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
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
{
"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
}