openapi: 3.0.3 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 150 requests / 60 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 for the QuoteResponse of `/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 for the QuoteResponse of `/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 mapping from program id to pogram label. This is used to help map errors from transaction by identifying the erring program id. The labels can be used in the `excludeDexes` or `dexes` parameter when calling `/quote`. 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 mapping of token mint to valid output token mints, 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: Default is true. If true, will 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: Default is true. 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 computeUnitPriceMicroLamports: description: The compute unit price to prioritize the transaction, the additional fee will be `computeUnitLimit (1400000) * computeUnitPriceMicroLamports`. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. type: [integer, string] prioritizationFeeLamports: description: Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. type: [integer, string] asLegacyTransaction: description: Default is false. 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 restrictIntermediateTokens: description: Restrict intermediate tokens to a top token set that has stable liquidity. This will help to ease potential high slippage error rate when swapping with minimal impact on pricing. type: boolean useTokenLedger: description: Default is false. 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: When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit. This will increase latency slightly since there will be one extra RPC call to simulate this. Default is `false`. type: boolean skipUserAccountsRpcCalls: description: When enabled, it will not do any rpc calls check on user's accounts. Enable it only when you already setup all the accounts needed for the trasaction, like wrapping or unwrapping sol, destination account is already created. type: boolean quoteResponse: $ref: '#/components/schemas/QuoteResponse' SwapResponse: type: object properties: swapTransaction: type: string lastValidBlockHeight: type: number prioritizationFeeLamports: 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 to compress the swaps 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 basis points, 1 basis point is 0.01%. 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