Solana swap quote (Jupiter)
POST /api/sol-swap-quoteExecutable swap quote on Solana from Jupiter's aggregator: input and output mint, amount in base units, slippage in bps - returns out amount, minimum out after slippage, price impact percent, the routed DEX labels in hop order with split percentages, the USD value of the swap and the context slot. Send POST /api/sol-swap-quote with the required fields inputMint, outputMint and amount and pay $0.003 per call over x402 or MPP (there is no free tier). It returns a JSON object with inputMint, outputMint, inAmount, outAmount, minOutAmount and 9 more.
A real multi-hop route across Solana DEX liquidity, so the number reflects depth, not a spot price. Quote only - nothing is signed or sent. Keyless.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
inputMint | string | yes | Base58 mint you sell. |
outputMint | string | yes | Base58 mint you buy. |
amount | string | yes | Input amount in base units (integer string; 1 SOL = 1000000000 lamports, 1 USDC = 1000000). |
slippageBps | number | no | Slippage tolerance in basis points (0-5000, default 50 = 0.5%). |
Example request
curl -i -X POST https://agent402.tools/api/sol-swap-quote \
-H "Content-Type: application/json" \
-d '{"inputMint":"So11111111111111111111111111111111111111112","outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount":"1000000000","slippageBps":50}'
Without payment this returns HTTP 402 Payment Required with the exact price for sol-swap-quote; any x402 v2 or MPP client pays it and retries.
Example response
{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1000000000",
"outAmount": "93708783",
"minOutAmount": "93240240",
"slippageBps": 50,
"priceImpactPct": 0,
"swapUsdValue": 93.7,
"swapMode": "ExactIn",
"hops": 2,
"route": [
{
"label": "BisonFi",
"percent": 100,
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "Es9v...",
"inAmount": "1000000000",
"outAmount": "93720054"
},
{
"label": "SolFi V2",
"percent": 100,
"inputMint": "Es9v...",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "93720054",
"outAmount": "93708783"
}
],
"contextSlot": 440919041,
"source": "jupiter",
"fetchedAt": "2026-08-22T12:00:00.000Z"
}
| Field | Type | Always present | In the example |
|---|---|---|---|
inputMint | string | yes | So11111111111111111111111111111111111111112 |
outputMint | string | yes | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
inAmount | string | yes | 1000000000 |
outAmount | string | yes | 93708783 |
minOutAmount | string | yes | 93240240 |
slippageBps | number | yes | 50 |
priceImpactPct | number | yes | 0 |
swapUsdValue | number | yes | 93.7 |
swapMode | string | yes | ExactIn |
hops | number | yes | 2 |
route | array of objects | yes | 2 items in the example |
contextSlot | number | yes | 440919041 |
source | string | yes | jupiter |
fetchedAt | string | yes | 2026-08-22T12:00:00.000Z |
From an MCP client
catalog.call {
"slug": "sol-swap-quote",
"params": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 50
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for sol-swap-quote; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
inputMint,outputMintandamountare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/sol-swap-quote returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/sol-swap-quote", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 50
}),
});
Related tools
Uniswap V3 spot quote
POST /api/dex-quoteSpot quote for swapping through a Uniswap V3 pool at the current tick. amountIn is in human units (not wei). zeroForOne=…
Solana token prices (Jupiter)
POST /api/sol-priceUSD price for up to 50 Solana token mints in one call from Jupiter's price API v3: price, 24h change, liquidity, decimal…
Solana token lookup (Jupiter)
POST /api/sol-token-lookupResolve a Solana token by mint, ticker or name through Jupiter's token index and get its profile in one read: name, symb…
Solana token trading pairs
POST /api/sol-token-pairsEvery DEX pair trading a Solana token mint (Raydium, Orca, Meteora, Pump.fun AMM and the rest), sorted by liquidity: pai…
Search Solana tokens and pairs
POST /api/sol-token-searchFind Solana tokens and pairs by name, ticker or address across every DEX DexScreener indexes, filtered to Solana only, i…
Solana token holder concentration
POST /api/sol-token-holdersTop-holder concentration for a Solana token mint: the 20 largest holders with token account, owner wallet, balance, perc…