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/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: array items: 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 - 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: number 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. type: boolean 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 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 `computeUnitSet (1400000) * computeUnitPriceMicroLamports`. type: integer 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 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 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 quoteResponse: $ref: '#/components/schemas/QuoteResponse' SwapResponse: type: object properties: swapTransaction: type: string required: - swapTransaction 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 `wrapUnwrapSOL = 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 DexesParameter: name: dexes 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 `,`. For example, `Aldrin,Saber`. 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