openapi: 3.0.0 info: title: Jupiter API v6 version: 6.0.0 description: | The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit The rate limit is 50 requests / 10 seconds. If you need a higher rate limit, feel free to contact us on [#developer-support](https://discord.com/channels/897540204506775583/910250162402779146) on Discord. ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec are base64 encoded strings servers: - url: https://quote-api.jup.ag/v6 paths: /quote: get: summary: GET /quote description: Sends a GET request to the Jupiter API to get the best priced quote. parameters: - $ref: '#/components/parameters/InputMintParameter' - $ref: '#/components/parameters/OutputMintParameter' - $ref: '#/components/parameters/AmountParameter' - $ref: '#/components/parameters/SlippageParameter' - $ref: '#/components/parameters/SwapModeParameter' - $ref: '#/components/parameters/DexesParameter' - $ref: '#/components/parameters/ExcludeDexesParameter' - $ref: '#/components/parameters/OnlyDirectRoutesParameter' - $ref: '#/components/parameters/AsLegacyTransactionParameter' - $ref: '#/components/parameters/PlatformFeeBpsParameter' - $ref: '#/components/parameters/MaxAccountsParameter' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/QuoteResponse' /swap: post: summary: POST /swap description: Returns a transaction that you can use from the quote you get from `/quote`. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SwapRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/SwapResponse' /swap-instructions: post: summary: POST /swap-instructions description: Returns instructions that you can use from the quote you get from `/quote`. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SwapRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/SwapInstructionsResponse' /program-id-to-label: get: summary: GET /program-id-to-label description: 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. With that, we can use the `excludeDexes` or `dexes` parameter. responses: '200': description: Default response content: application/json: schema: type: object additionalProperties: type: string /indexed-route-map: get: summary: GET /indexed-route-map description: Returns a hash map, input mint as key and an array of valid output mint as values, token mints are indexed to reduce the file size parameters: - $ref: '#/components/parameters/OnlyDirectRoutesParameter' responses: '200': description: Default response content: application/json: schema: $ref: '#/components/schemas/IndexedRouteMapResponse' components: schemas: Instruction: type: object properties: programId: type: string accounts: type: array items: $ref: '#/components/schemas/AccountMeta' data: type: string required: - programId - accounts - data AccountMeta: type: object properties: pubkey: type: string isSigner: type: boolean isWritable: type: boolean required: - pubkey - isSigner - isWritable QuoteResponse: type: object required: - inputMint - outputMint - inAmount - outAmount - otherAmountThreshold - swapMode - slippageBps - priceImpactPct - routePlan properties: inputMint: type: string inAmount: type: string outputMint: type: string outAmount: type: string otherAmountThreshold: type: string swapMode: $ref: '#/components/schemas/SwapMode' required: true slippageBps: type: integer format: int32 platformFee: $ref: '#/components/schemas/PlatformFee' priceImpactPct: type: string routePlan: type: array items: $ref: '#/components/schemas/RoutePlanStep' contextSlot: type: number timeTaken: type: number SwapMode: type: string enum: - ExactIn - ExactOut PlatformFee: type: object properties: amount: type: string feeBps: type: integer format: int32 RoutePlanStep: type: object properties: swapInfo: $ref: '#/components/schemas/SwapInfo' percent: type: integer format: int32 required: - swapInfo - percent SwapInfo: type: object required: - ammKey - inputMint - outputMint - inAmount - outAmount - feeAmount - feeMint properties: ammKey: type: string label: type: string inputMint: type: string outputMint: type: string inAmount: type: string outAmount: type: string feeAmount: type: string feeMint: type: string SwapRequest: type: object required: - userPublicKey - quoteResponse properties: userPublicKey: description: The user public key. type: string wrapAndUnwrapSol: description: Automatically wrap/unwrap SOL. If false, it will use wSOL token account. Will be ignored if `destinationTokenAccount` is set because the `destinationTokenAccount` may belong to a different user that we have no authority to close. type: boolean default: true useSharedAccounts: description: This enables the usage of shared program accountns. That means no intermediate token accounts or open orders accounts need to be created for the users. But it also means that the likelihood of hot accounts is higher. type: boolean default: true feeAccount: description: Fee token account for the output token, it is derived using the seeds = ["referral_ata", referral_account, mint] and the `REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3` referral contract (only pass in if you set a `platformFeeBps` in `/quote` and make sure that the feeAccount has been created). type: string prioritizationFeeLamports: description: The prioritization fee to pay in addition to the signature fee to prioritize the transaction. type: integer computeUnitPriceMicroLamports: description: The compute unit price to prioritize the transaction, the additional fee will be `computeUnitLimit * computeUnitPriceMicroLamports`. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 1,000,000 lamports. type: integer asLegacyTransaction: description: Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large. type: boolean default: false useTokenLedger: description: This is useful when the instruction before the swap has a transfer that increases the input token amount. Then, the swap will just use the difference between the token ledger token amount and post token amount. type: boolean default: false destinationTokenAccount: description: Public key of the token account that will be used to receive the token out of the swap. If not provided, the user's ATA will be used. If provided, we assume that the token account is already initialized. type: string dynamicComputeUnitLimit: description: Simulate the swap transaction to get the compute unit consumed, factor in a margin and set the ComputeBudget's compute unit limit. type: boolean quoteResponse: $ref: '#/components/schemas/QuoteResponse' SwapResponse: type: object properties: swapTransaction: type: string lastValidBlockHeight: type: number required: - swapTransaction - lastValidBlockHeight SwapInstructionsResponse: type: object properties: tokenLedgerInstruction: description: If you are using `useTokenLedger = true`. $ref: '#/components/schemas/Instruction' computeBudgetInstructions: description: The necessary instructions to setup the compute budget. type: array items: $ref: '#/components/schemas/Instruction' setupInstructions: description: Setup missing ATA for the users. type: array items: $ref: '#/components/schemas/Instruction' swapInstruction: description: The actual swap instruction. $ref: '#/components/schemas/Instruction' cleanupInstruction: description: Unwrap the SOL if `wrapAndUnwrapSol = true`. $ref: '#/components/schemas/Instruction' addressLookupTableAddresses: description: The lookup table addresses that you can use if you are using versioned transaction. type: array items: type: string required: - computeBudgetInstructions - setupInstructions - swapInstruction - addressLookupTableAddresses IndexedRouteMapResponse: type: object required: - mintKeys - indexedRouteMap properties: mintKeys: type: array items: type: string description: All the mints that are indexed to match in indexedRouteMap indexedRouteMap: type: object description: All the possible route and their corresponding output mints additionalProperties: type: array items: type: number example: '1': - 2 - 3 - 4 '2': - 1 - 3 - 4 parameters: InputMintParameter: name: inputMint description: Input token mint address in: query required: true schema: type: string OutputMintParameter: name: outputMint description: Output token mint address in: query required: true schema: type: string AmountParameter: name: amount description: The amount to swap, have to factor in the token decimals. in: query required: true schema: type: integer SlippageParameter: name: slippageBps description: The slippage % in BPS. If the output token amount exceeds the slippage then the swap transaction will fail. in: query schema: type: integer SwapModeParameter: name: swapMode description: (ExactIn or ExactOut) Defaults to ExactIn. ExactOut is for supporting use cases where you need an exact token amount, like payments. In this case the slippage is on the input token. in: query schema: type: string enum: ['ExactIn', 'ExactOut'] DexesParameter: name: dexes description: Default is that all DEXes are included. You can pass in the DEXes that you want to include only and separate them by `,`. You can check out the full list [here](https://quote-api.jup.ag/v6/program-id-to-label). in: query schema: type: array items: type: string ExcludeDexesParameter: name: excludeDexes description: Default is that all DEXes are included. You can pass in the DEXes that you want to exclude and separate them by `,`. You can check out the full list [here](https://quote-api.jup.ag/v6/program-id-to-label). in: query schema: type: array items: type: string OnlyDirectRoutesParameter: name: onlyDirectRoutes description: Default is false. Direct Routes limits Jupiter routing to single hop routes only. in: query schema: type: boolean AsLegacyTransactionParameter: name: asLegacyTransaction description: Default is false. Instead of using versioned transaction, this will use the legacy transaction. in: query schema: type: boolean MaxAccountsParameter: name: maxAccounts description: Rough estimate of the max accounts to be used for the quote, so that you can compose with your own accounts in: query schema: type: integer PlatformFeeBpsParameter: name: platformFeeBps description: If you want to charge the user a fee, you can specify the fee in BPS. Fee % is taken out of the output token. in: query schema: type: integer