curl --request POST \
--url https://api.onswitch.xyz/swap/quote \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"amount": 100,
"from_asset": "base:usdc",
"to_asset": "solana:usdt",
"exact_output": false
}
'{
"success": true,
"message": "Swap quote fetched successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"expiry": "2026-04-18T14:37:15.000Z",
"settlement": "Instant",
"channel": "BLOCKCHAIN",
"rate": 1,
"fee": {
"total": 0.5,
"platform": 0.45,
"developer": 0.05,
"currency": "USDC"
},
"fee_inclusive": true,
"source": {
"amount": 100,
"currency": "USDC"
},
"destination": {
"amount": 99.5,
"currency": "USDT"
}
}
}Get a real-time quote for swapping between two stablecoin assets including exchange rate and fees.
curl --request POST \
--url https://api.onswitch.xyz/swap/quote \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"amount": 100,
"from_asset": "base:usdc",
"to_asset": "solana:usdt",
"exact_output": false
}
'{
"success": true,
"message": "Swap quote fetched successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"expiry": "2026-04-18T14:37:15.000Z",
"settlement": "Instant",
"channel": "BLOCKCHAIN",
"rate": 1,
"fee": {
"total": 0.5,
"platform": 0.45,
"developer": 0.05,
"currency": "USDC"
},
"fee_inclusive": true,
"source": {
"amount": 100,
"currency": "USDC"
},
"destination": {
"amount": 99.5,
"currency": "USDT"
}
}
}Documentation Index
Fetch the complete documentation index at: https://docs.onswitch.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Service key for API authentication
x >= 0base:usdc, solana:usdc, solana:usdt, ethereum:usdc, ethereum:usdt, polygon:usdc, polygon:usdt, bsc:usdc, bsc:usdt, arbitrum:usdc, optimism:usdc, gnosis:usdc, gnosis:usdt, arbitrum:usdt, avalanche:usdc, monad:usdc, optimism:usdt, monad:usdt, plasma:usdt, avalanche:usdt, tron:usdt, linea:usdt, mantle:usdt, hyperevm:usdt, berachain:usdt, linea:usdc, berachain:usdc, sonic:usdc, base:cngn, bsc:cngn base:usdc, solana:usdc, solana:usdt, ethereum:usdc, ethereum:usdt, polygon:usdc, polygon:usdt, bsc:usdc, bsc:usdt, arbitrum:usdc, optimism:usdc, gnosis:usdc, gnosis:usdt, arbitrum:usdt, avalanche:usdc, monad:usdc, optimism:usdt, monad:usdt, plasma:usdt, avalanche:usdt, tron:usdt, linea:usdt, mantle:usdt, hyperevm:usdt, berachain:usdt, linea:usdc, berachain:usdc, sonic:usdc, base:cngn, bsc:cngn Successfully retrieved swap quote
Response data
Hide child attributes