# Jupiter > API reference for Jupiter's Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript https://github.com/jup-ag/jupiter-quote-api-node ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec are base64 encoded strings (4 operations) MCP endpoint: https://jupiter.mcp.junct.dev/mcp Domain: dex Auth: none ## Tools ### quote_get quote — Request for a quote to be used in `POST /swap` Returns: { inputMint: string, inAmount: string, outputMint: string, ... }. **Parameters:** - `inputMint` (string, required): query parameter: inputMint (string) - `outputMint` (string, required): query parameter: outputMint (string) - `amount` (number, required): - Raw amount to swap (before decimals) - Input Amount if `SwapMode=ExactIn` - Output Amount if `SwapMode=ExactOut` - `slippageBps` (number, optional): - Default: 50 - This is threshold denoted in basis points. - If exact in and output amount exceeds the threshold, then the swap transaction will fail. - `swapMode` (string, optional): - ExactOut is for supporting use cases where you need an exact output amount - In the case of `ExactIn`, the slippage is on the output token - In the case of `ExactOut`, the slippage is on the input token - Not all AMMs support `ExactOut`: Currently only Orca Whirlpool, Raydium CLMM, Raydium CPMM - We do not recommend using `ExactOut` for most use cases - `dexes` (array, optional): - Multiple DEXes can be pass in by comma separating them - For example: `dexes=Raydium,Orca+V2,Meteora+DLMM` - If a DEX is indicated, the route will **only use** that DEX - Full list of DEXes here: https://lite-api.jup.ag/swap/v1/program-id-to-label - `excludeDexes` (array, optional): - Multiple DEXes can be pass in by comma separating them - For example: `excludeDexes=Raydium,Orca+V2,Meteora+DLMM` - If a DEX is indicated, the route will **not use** that DEX - Full list of DEXes here: https://lite-api.jup.ag/swap/v1/program-id-to-label - `restrictIntermediateTokens` (boolean, optional): - Restrict intermediate tokens within a route to a set of more stable tokens - This will help to reduce exposure to potential high slippage routes - `onlyDirectRoutes` (boolean, optional): - Direct route limits Jupiter routing to single hop routes only - This may result in worse routes - `asLegacyTransaction` (boolean, optional): - Instead of using versioned transaction, this will use the legacy transaction - `platformFeeBps` (number, optional): - Take fees in basis points - If `platformFeeBps` is passed in, the `feeAccount` in `/swap` must be passed as well - `maxAccounts` (number, optional): - Rough estimate of the max accounts to be used for the quote - Useful if composing your own transaction or to be more precise in resource accounting for better routes - `instructionVersion` (string, optional): - The version of instruction to use in the swap program - `dynamicSlippage` (boolean, optional): - No longer applicable, only required to pass in via `/swap` endpoint ### swap_post swap — Request for a base64-encoded unsigned swap transaction based on the `/quote` response Returns: { swapTransaction: string, lastValidBlockHeight: number, prioritizationFeeLamports: number }. **Parameters:** - `userPublicKey` (string, required): userPublicKey (string) - `payer` (string, optional): - Allow a custom payer to pay for the transaction fees and rent of token accounts - Note that users can close their ATAs elsewhere and have you reopen them again, your fees should account for this - `wrapAndUnwrapSol` (boolean, optional): - To automatically wrap/unwrap SOL in the transaction, as WSOL is an SPL token while native SOL is not - When true and input mint is SOL, it will wrap the SOL amount to WSOL and swap - When true and output mint is SOL, it will unwrap the WSOL back to SOL - When false and input mint is SOL, it will use existing WSOL amount to swap - When false and output mint is SOL, it will not unwrap the WSOL to SOL - To set this parameter to false, you need to have the WSOL token account initialized - `useSharedAccounts` (boolean, optional): - The default is determined dynamically by the routing engine, allowing us to optimize for compute units, etc - This enables the usage of shared program accounts, this is essential as complex routing will require multiple intermediate token accounts which the user might not have - If true, you do not need to handle the creation of intermediate token accounts for the user - Do note, shared accounts route will fail on some new AMMs (low liquidity token) - `feeAccount` (string, optional): - An initialized token account that will be used to collect fees - The mint of the token account **can only be either the input or output mint of the swap** - Swap API no longer requires the use of the Referral Program - If `platformFeeBps` is passed in `/quote`, the `feeAccount` must be passed as well - `trackingAccount` (string, optional): - Specify any public key that belongs to you to track the transactions - Useful for integrators to get all the swap transactions from this public key - Query the data using a block explorer like Solscan/SolanaFM or query like Dune/Flipside - `prioritizationFeeLamports` (string, optional): - To specify a level or amount of additional fees to prioritize the transaction - It can be used for EITHER priority fee OR Jito tip (not both at the same time) - If you want to include both, you will need to use `/swap-instructions` to add both at the same time - Defaults to `auto`, but preferred to use `priorityLevelWithMaxLamports` as it may be more accurate when accounting local fee market - Fixed lamports can be passed in as an integer in the `prioritizationFeeLamports` parameter - `asLegacyTransaction` (boolean, optional): - Builds a legacy transaction rather than the default versioned transaction - Used together with `asLegacyTransaction` in `/quote`, otherwise the transaction might be too large - `destinationTokenAccount` (string, optional): - Public key of a token account that will be used to receive the token out of the swap - If not provided, the signer's token account will be used - If provided, we assume that the token account is already initialized - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive - `nativeDestinationAccount` (string, optional): - Public key of an account that will be used to receive the native SOL token out of the swap - If not provided, the swap will default unwrap the WSOL and transfer the native SOL to the swap authority account - If provided, we will unwrap the WSOL and transfer the native SOL to the account - Only works if the output mint is SOL, is using the V2 instructions and the account passed in is not owned by token program - When sending native SOL to a new account, you must swap at least enough to cover the rent required to create it. - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive - `dynamicComputeUnitLimit` (boolean, optional): - When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit - This incurs one extra RPC call to simulate this - We recommend to enable this to estimate compute unit correctly and reduce priority fees needed or have higher chance to be included in a block - `skipUserAccountsRpcCalls` (boolean, optional): - When enabled, it will not do any additional RPC calls to check on required accounts - The returned swap transaction will still attempt to create required accounts regardless if it exists or not - `dynamicSlippage` (boolean, optional): - When enabled, it estimates slippage and apply it in the swap transaction directly, overwriting the `slippageBps` parameter in the quote response. - This is no longer maintained, we are focusing efforts on RTSE on Ultra Swap API - `computeUnitPriceMicroLamports` (number, optional): - To use an exact compute unit price to calculate priority fee - `computeUnitLimit (1400000) * computeUnitPriceMicroLamports` - We recommend using `prioritizationFeeLamports` and `dynamicComputeUnitLimit` instead of passing in your own compute unit price - `blockhashSlotsToExpiry` (number, optional): - Pass in the number of slots we want the transaction to be valid for - Example: If you pass in 10 slots, the transaction will be valid for ~400ms * 10 = approximately 4 seconds before it expires - `quoteResponse` (object, required): quoteResponse ({ inputMint: string, inAmount: string, outputMint: string, outAmount: string, otherAmountThreshold: string, instructionVersion: "V1" | "V2", ... }) ### swap_instructions_post swap-instructions — Request for swap instructions that you can use from the quote you get from `/quote` Returns: { otherInstructions: { programId: string, accounts: unknown[], data: string }[], computeBudgetInstructions: { programId: string, accounts: unknown[], data: string }[], setupInstructions: { programId: string, accounts: unknown[], data: string }[], ... }. **Parameters:** - `userPublicKey` (string, required): userPublicKey (string) - `payer` (string, optional): - Allow a custom payer to pay for the transaction fees and rent of token accounts - Note that users can close their ATAs elsewhere and have you reopen them again, your fees should account for this - `wrapAndUnwrapSol` (boolean, optional): - To automatically wrap/unwrap SOL in the transaction, as WSOL is an SPL token while native SOL is not - When true and input mint is SOL, it will wrap the SOL amount to WSOL and swap - When true and output mint is SOL, it will unwrap the WSOL back to SOL - When false and input mint is SOL, it will use existing WSOL amount to swap - When false and output mint is SOL, it will not unwrap the WSOL to SOL - To set this parameter to false, you need to have the WSOL token account initialized - `useSharedAccounts` (boolean, optional): - The default is determined dynamically by the routing engine, allowing us to optimize for compute units, etc - This enables the usage of shared program accounts, this is essential as complex routing will require multiple intermediate token accounts which the user might not have - If true, you do not need to handle the creation of intermediate token accounts for the user - Do note, shared accounts route will fail on some new AMMs (low liquidity token) - `feeAccount` (string, optional): - An initialized token account that will be used to collect fees - The mint of the token account **can only be either the input or output mint of the swap** - Swap API no longer requires the use of the Referral Program - If `platformFeeBps` is passed in `/quote`, the `feeAccount` must be passed as well - `trackingAccount` (string, optional): - Specify any public key that belongs to you to track the transactions - Useful for integrators to get all the swap transactions from this public key - Query the data using a block explorer like Solscan/SolanaFM or query like Dune/Flipside - `prioritizationFeeLamports` (string, optional): - To specify a level or amount of additional fees to prioritize the transaction - It can be used for EITHER priority fee OR Jito tip (not both at the same time) - If you want to include both, you will need to use `/swap-instructions` to add both at the same time - Defaults to `auto`, but preferred to use `priorityLevelWithMaxLamports` as it may be more accurate when accounting local fee market - Fixed lamports can be passed in as an integer in the `prioritizationFeeLamports` parameter - `asLegacyTransaction` (boolean, optional): - Builds a legacy transaction rather than the default versioned transaction - Used together with `asLegacyTransaction` in `/quote`, otherwise the transaction might be too large - `destinationTokenAccount` (string, optional): - Public key of a token account that will be used to receive the token out of the swap - If not provided, the signer's token account will be used - If provided, we assume that the token account is already initialized - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive - `nativeDestinationAccount` (string, optional): - Public key of an account that will be used to receive the native SOL token out of the swap - If not provided, the swap will default unwrap the WSOL and transfer the native SOL to the swap authority account - If provided, we will unwrap the WSOL and transfer the native SOL to the account - Only works if the output mint is SOL, is using the V2 instructions and the account passed in is not owned by token program - When sending native SOL to a new account, you must swap at least enough to cover the rent required to create it. - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive - `dynamicComputeUnitLimit` (boolean, optional): - When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit - This incurs one extra RPC call to simulate this - We recommend to enable this to estimate compute unit correctly and reduce priority fees needed or have higher chance to be included in a block - `skipUserAccountsRpcCalls` (boolean, optional): - When enabled, it will not do any additional RPC calls to check on required accounts - The returned swap transaction will still attempt to create required accounts regardless if it exists or not - `dynamicSlippage` (boolean, optional): - When enabled, it estimates slippage and apply it in the swap transaction directly, overwriting the `slippageBps` parameter in the quote response. - This is no longer maintained, we are focusing efforts on RTSE on Ultra Swap API - `computeUnitPriceMicroLamports` (number, optional): - To use an exact compute unit price to calculate priority fee - `computeUnitLimit (1400000) * computeUnitPriceMicroLamports` - We recommend using `prioritizationFeeLamports` and `dynamicComputeUnitLimit` instead of passing in your own compute unit price - `blockhashSlotsToExpiry` (number, optional): - Pass in the number of slots we want the transaction to be valid for - Example: If you pass in 10 slots, the transaction will be valid for ~400ms * 10 = approximately 4 seconds before it expires - `quoteResponse` (object, required): quoteResponse ({ inputMint: string, inAmount: string, outputMint: string, outAmount: string, otherAmountThreshold: string, instructionVersion: "V1" | "V2", ... }) ### program_id_to_label_get program-id-to-label — Returns a hash, which key is the program id and value is the label. This is used to help map error from transaction by identifying the fault program id. This can be used in conjunction with the `excludeDexes` or `dexes` parameter. _No parameters required._ ## Usage Connect to this MCP server at `https://jupiter.mcp.junct.dev/mcp`. All tools are callable via the MCP protocol. Call `quote_get` first to query current state before any write operations. Write operations like `swap_post` return data or calldata for agent use.