> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swaps.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Quote

> Returns a non-binding reference price for a cross-chain swap. Unlike `GET /getAction`, this endpoint never allocates a deposit address, builds transaction calldata, or triggers wallet-screening checks — it's priced-only, safe to call at high frequency (e.g. to refresh a quote widget), and always uses `swap-action` semantics regardless of any `actionType` you pass.

`sender` and `recipient` are not accepted as inputs — the endpoint prices the route using internal placeholder addresses, since no transaction is produced. If you need a signable transaction, use `GET /getAction` instead.



## OpenAPI

````yaml /swap-api-reference/openapi.json get /getQuote
openapi: 3.1.0
info:
  title: Swaps API
  description: >-
    The Swaps API provides instant cross-chain swap and bridge functionality for
    decentralized applications.

    It supports multiple virtual machines (EVM, Solana, Bitcoin) and various DEX
    protocols and bridge solutions.
  version: 3.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /getQuote:
    get:
      summary: Get Quote
      description: >-
        Returns a non-binding reference price for a cross-chain swap. Unlike
        `GET /getAction`, this endpoint never allocates a deposit address,
        builds transaction calldata, or triggers wallet-screening checks — it's
        priced-only, safe to call at high frequency (e.g. to refresh a quote
        widget), and always uses `swap-action` semantics regardless of any
        `actionType` you pass.


        `sender` and `recipient` are not accepted as inputs — the endpoint
        prices the route using internal placeholder addresses, since no
        transaction is produced. If you need a signable transaction, use `GET
        /getAction` instead.
      operationId: getQuote
      parameters:
        - name: srcChainId
          in: query
          required: true
          description: Source chain ID
          schema:
            $ref: '#/components/schemas/ChainId'
        - name: srcToken
          in: query
          required: true
          description: Source token address. Use `native` for the chain's native asset.
          schema:
            $ref: '#/components/schemas/Address'
        - name: dstChainId
          in: query
          required: true
          description: Destination chain ID
          schema:
            $ref: '#/components/schemas/ChainId'
        - name: dstToken
          in: query
          required: true
          description: >-
            Destination token address. Use `native` for the chain's native
            asset.
          schema:
            $ref: '#/components/schemas/Address'
        - name: amount
          in: query
          required: true
          description: >-
            The exact in or exact out amount of the swap, in the source or
            destination token's base units respectively.
          schema:
            type: string
            pattern: ^[0-9]+$
        - name: swapDirection
          in: query
          required: true
          description: Whether `amount` is an exact input or exact output amount.
          schema:
            $ref: '#/components/schemas/SwapDirection'
        - name: slippage
          in: query
          required: false
          description: >-
            Slippage tolerance in bps. **Defaults to `50`** (0.5%) if omitted —
            unlike `GET /getAction`, where this parameter is required.
          schema:
            type: number
            format: float
            minimum: 0
            maximum: 10000
            default: 50
        - name: bridgeIds
          in: query
          required: false
          description: |-
            Specific bridge protocols to use

            **Optional:** Will default to all available protocols
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BridgeId'
        - name: refundTo
          in: query
          required: false
          description: |-
            Alternate address the reference route would refund to

            **Optional:** Will default to an internal placeholder address
          schema:
            $ref: '#/components/schemas/Address'
        - name: solanaSponsor
          in: query
          required: false
          description: >-
            Solana address that would pay for tx fees and rent (e.g. ATA
            creation) if this quote were later executed. Only used for Solana
            same-chain swaps.
          schema:
            $ref: '#/components/schemas/Address'
        - name: returnDepositAddress
          in: query
          required: false
          description: >-
            Restrict the priced route universe to deposit-address-based flows


            **Optional:** Set to `true` to price against the deposit-address
            strategy set
          schema:
            type: boolean
            default: false
        - name: dstGas
          in: query
          required: false
          description: >-
            Extra gas to deliver on the destination chain, factored into the
            reference price


            **Optional**
          schema:
            type: string
            pattern: ^[0-9]+$
        - name: appFees
          in: query
          required: false
          description: |-
            Application fees configuration as JSON array

            **Optional:** Will default to fees configured for the application

             **Example:** `[{ "bps": 50, "receiverAddress": "0x..." }]`
          schema:
            type: string
        - name: gasless
          in: query
          required: false
          description: >-
            Price the route as if gasless execution were requested.


            **Optional:** Has limited effect on this endpoint's response —
            `executions`/`executionsType` are never returned by `getQuote`, so
            this mainly affects fee computation, not the response shape.
          schema:
            type: boolean
            default: false
        - name: skipCache
          in: query
          required: false
          description: >-
            Bypass the internal quote cache and re-price against live routes.


            **Optional:** Presence, not value, is checked — passing
            `skipCache=false` still skips the cache. Omit the parameter entirely
            to use the cache.
          schema:
            type: boolean
      responses:
        '200':
          description: Successful response with a reference-price quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateQuoteResponse'
        '400':
          description: Bad request due to missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                AMOUNT_TOO_HIGH:
                  summary: Amount Too High
                  value:
                    success: false
                    error:
                      code: AMOUNT_TOO_HIGH
                      name: AmountTooHighError
                      message: The specified amount is too high.
                      title: Amount too high
                      statusCode: 400
                      details:
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x0000000000000000000000000000000000000000'
                        srcChainId: 1
                        dstChainId: 42161
                        maxAmount: 100000000000000000000
                      timestamp: '2024-01-01T00:00:00.000Z'
                AMOUNT_TOO_LOW:
                  summary: Amount Too Low
                  value:
                    success: false
                    error:
                      code: AMOUNT_TOO_LOW
                      name: AmountTooLowError
                      message: The specified amount is too low.
                      title: Amount too low
                      statusCode: 400
                      details:
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x0000000000000000000000000000000000000000'
                        srcChainId: 1
                        dstChainId: 42161
                        minAmount: 0.000123
                      timestamp: '2024-01-01T00:00:00.000Z'
                CROSS_VM_RECEIVER_REQUIRED:
                  summary: Cross VM Receiver Required
                  value:
                    success: false
                    error:
                      code: CROSS_VM_RECEIVER_REQUIRED
                      name: CrossVmReceiverRequiredError
                      message: >-
                        Receiver address is required for swaps across different
                        VMs.
                      title: Receiver address required
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 1399811149
                      timestamp: '2024-01-01T00:00:00.000Z'
                EXCESSIVE_FEE:
                  summary: Excessive Fee
                  value:
                    success: false
                    error:
                      code: EXCESSIVE_FEE
                      name: ExcessiveFeeError
                      message: >-
                        The inputted flat fee is too large (over 50% of tx
                        input).
                      title: Excessive fee
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INSUFFICIENT_LIQUIDITY:
                  summary: Insufficient Liquidity
                  value:
                    success: false
                    error:
                      code: INSUFFICIENT_LIQUIDITY
                      name: InsufficientLiquidityError
                      message: >-
                        There is insufficient liquidity to complete this
                        transaction.
                      title: Insufficient liquidity
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_ADDRESS_FORMAT:
                  summary: Invalid Address Format
                  value:
                    success: false
                    error:
                      code: INVALID_ADDRESS_FORMAT
                      name: InvalidAddressError
                      message: The format of the specified address is invalid.
                      title: Invalid address format
                      statusCode: 400
                      details:
                        field: sender
                        address: 0xinvalid
                        reason: Address must be 40 characters long
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_AMOUNT_ZERO:
                  summary: Invalid Amount Zero
                  value:
                    success: false
                    error:
                      code: INVALID_AMOUNT_ZERO
                      name: InvalidAmountZeroError
                      message: Amount must be greater than zero.
                      title: Zero amount not allowed
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_DESTINATION_TOKEN:
                  summary: Invalid Destination Token
                  value:
                    success: false
                    error:
                      code: INVALID_DESTINATION_TOKEN
                      name: InvalidDstTokenError
                      message: Destination token is required.
                      title: Invalid destination token
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_PARAMETER:
                  summary: Invalid Parameter
                  value:
                    success: false
                    error:
                      code: INVALID_PARAMETER
                      name: InvalidParameterError
                      message: The request contains an invalid parameter.
                      title: Invalid parameter
                      statusCode: 400
                      details:
                        parameter: slippage
                        value: '15000'
                        reason: Slippage must be between 0 and 10000 bps
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_SOURCE_TOKEN:
                  summary: Invalid Source Token
                  value:
                    success: false
                    error:
                      code: INVALID_SOURCE_TOKEN
                      name: InvalidSrcTokenError
                      message: Source token is required.
                      title: Invalid source token
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                MISSING_REQUIRED_FIELD:
                  summary: Missing Required Field
                  value:
                    success: false
                    error:
                      code: MISSING_REQUIRED_FIELD
                      name: MissingRequiredFieldError
                      message: The request is missing a required field.
                      title: Missing required field
                      statusCode: 400
                      details:
                        field: srcToken
                        context: Source token address is required for swap actions
                      timestamp: '2024-01-01T00:00:00.000Z'
                NO_AVAILABLE_ROUTE:
                  summary: No Available Route
                  value:
                    success: false
                    error:
                      code: NO_AVAILABLE_ROUTE
                      name: NoAvailableRouteError
                      message: No route is available for the specified parameters.
                      title: No available route
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 42161
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x1234567890123456789012345678901234567890'
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK:
                  summary: Unsupported Network
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK
                      name: UnsupportedNetworkError
                      message: The network with the specified chainId is not supported.
                      title: Unsupported network
                      statusCode: 400
                      details:
                        chainId: 999999
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK_PAIR:
                  summary: Unsupported Network Pair
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK_PAIR
                      name: UnsupportedNetworkPairError
                      message: Routing between the specified networks is not supported.
                      title: Unsupported network pair
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 999999
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK_TOKEN_PAIR:
                  summary: Unsupported Network Token Pair
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK_TOKEN_PAIR
                      name: UnsupportedNetworkAndTokenPairError
                      message: >-
                        Routing between the specified tokens and networks is not
                        supported.
                      title: Unsupported network and token pair
                      statusCode: 400
                      details:
                        srcChainId: 1
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstChainId: 42161
                        dstToken: '0x1234567890123456789012345678901234567890'
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_SWAP_DIRECTION:
                  summary: Unsupported Swap Direction
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_SWAP_DIRECTION
                      name: UnsupportedSwapDirectionError
                      message: The specified swap direction is not supported.
                      title: Unsupported swap direction
                      statusCode: 400
                      details:
                        swapDirection: exact-amount-out
                      timestamp: '2024-01-01T00:00:00.000Z'
                AMOUNT_INVALID:
                  summary: Amount Invalid
                  value:
                    success: false
                    error:
                      code: AMOUNT_INVALID
                      name: AmountInvalidError
                      message: The specified amount is invalid.
                      title: Invalid amount
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                INVALID_API_KEY:
                  summary: Invalid API Key
                  value:
                    success: false
                    error:
                      code: INVALID_API_KEY
                      name: InvalidApiKeyError
                      message: The provided API key is invalid.
                      title: Invalid API key
                      statusCode: 401
                      timestamp: '2024-01-01T00:00:00.000Z'
                MISSING_API_KEY:
                  summary: Missing API Key
                  value:
                    success: false
                    error:
                      code: MISSING_API_KEY
                      name: MissingApiKeyError
                      message: API key is required.
                      title: Missing API key
                      statusCode: 401
                      timestamp: '2024-01-01T00:00:00.000Z'
        '403':
          description: Forbidden - Access denied due to restrictions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                GEO_BLOCKED:
                  summary: Geographic Restriction
                  value:
                    success: false
                    error:
                      code: GEO_BLOCKED
                      name: GeoBlockingError
                      message: Access denied due to geo-blocking restrictions.
                      title: Geo-blocking restriction
                      statusCode: 403
                      details:
                        countryCode: US
                        countryName: United States
                        reason: Country is on the blocked list
                        blockedAt: '2024-01-15T10:30:00.000Z'
                      timestamp: '2024-01-01T00:00:00.000Z'
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                METHOD_NOT_ALLOWED:
                  summary: Method Not Allowed
                  value:
                    success: false
                    error:
                      code: METHOD_NOT_ALLOWED
                      name: MethodNotAllowedError
                      message: The HTTP request method specified is not allowed.
                      title: Method not allowed
                      statusCode: 405
                      details:
                        method: POST
                      timestamp: '2024-01-01T00:00:00.000Z'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                INTERNAL_SERVER_ERROR:
                  summary: Internal Server Error
                  value:
                    success: false
                    error:
                      code: INTERNAL_SERVER_ERROR
                      name: InternalServerError
                      message: >-
                        An internal server error occurred while processing the
                        request.
                      title: Internal Server Error
                      statusCode: 500
                      timestamp: '2024-01-01T00:00:00.000Z'
      servers:
        - url: https://api-v2.swaps.xyz/api
          description: Core Swap API server
components:
  schemas:
    ChainId:
      type: integer
      description: Chain ID. Find in the list of supported networks.
    Address:
      type: string
      description: >-
        Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or
        AltVmAddress.
    SwapDirection:
      type: string
      enum:
        - exact-amount-in
        - exact-amount-out
      description: Swap direction for the action.
    BridgeId:
      type: string
      description: Bridge protocol identifier (e.g. "across", "relay", "mayan").
    EstimateQuoteResponse:
      type: object
      required:
        - vmId
        - amountIn
        - amountInMax
        - amountOutMin
        - amountOut
        - protocolFee
        - applicationFee
        - exchangeRate
        - estimatedTxTime
        - estimatedPriceImpact
        - requiresTokenApproval
        - requiresRegisterTransaction
      properties:
        vmId:
          type: string
          enum:
            - evm
            - solana
            - alt-vm
            - hypercore
          description: Virtual machine identifier.
        amountIn:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount to input (exclusive of slippage - recommended value
            to display in frontend)
        amountInMax:
          $ref: '#/components/schemas/Payment'
          description: Maximum amount to input (inclusive of slippage)
        amountOut:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount delivered to users (exclusive of slippage -
            recommended value to display in frontend)
        amountOutMin:
          $ref: '#/components/schemas/Payment'
          description: Minimum amount delivered to users (inclusive of slippage)
        protocolFee:
          $ref: '#/components/schemas/Payment'
          description: Swaps.xyz fee
        applicationFee:
          $ref: '#/components/schemas/Payment'
          description: Application fee (your fee!)
        bridgeFee:
          $ref: '#/components/schemas/Payment'
          description: >-
            Bridge fee (from aggregated providers). Only present when the
            reference route crosses a bridge.
        relayerFee:
          $ref: '#/components/schemas/Payment'
          description: >-
            Fee charged by a gasless relay provider, denominated in USDT. Rarely
            populated on this endpoint since `executionsType`/`executions` are
            not returned here — present mainly for schema parity with `GET
            /getAction`.
        exchangeRate:
          type: number
          format: float
          description: Exchange rate for the swap.
        estimatedTxTime:
          type: number
          format: float
          description: Estimated transaction time in seconds.
        estimatedPriceImpact:
          type: number
          format: float
          description: Estimated price impact percentage.
        requiresTokenApproval:
          type: boolean
          description: >-
            Flag indicating whether executing this route later would require a
            source token approval check.
        requiresRegisterTransaction:
          type: boolean
          description: >-
            Flag indicating whether executing this route later would require
            registration via the registerTxs endpoint. Mandatory for non-EVM
            transactions.
    GetActionErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Always false for error responses
          enum:
            - false
          example: false
        error:
          type: object
          required:
            - code
            - name
            - message
            - title
            - statusCode
            - timestamp
          properties:
            code:
              type: string
              description: Error type code for programmatic handling
              enum:
                - AMOUNT_INVALID
                - AMOUNT_TOO_HIGH
                - AMOUNT_TOO_LOW
                - CROSS_VM_RECEIVER_REQUIRED
                - EXCESSIVE_FEE
                - GEO_BLOCKED
                - INSUFFICIENT_LIQUIDITY
                - INVALID_ADDRESS_FORMAT
                - INVALID_AMOUNT_ZERO
                - INVALID_API_KEY
                - INVALID_DESTINATION_TOKEN
                - INVALID_PARAMETER
                - INVALID_SOURCE_TOKEN
                - INTERNAL_SERVER_ERROR
                - METHOD_NOT_ALLOWED
                - MISSING_API_KEY
                - MISSING_REQUIRED_FIELD
                - NO_AVAILABLE_ROUTE
                - UNSUPPORTED_NETWORK
                - UNSUPPORTED_NETWORK_PAIR
                - UNSUPPORTED_NETWORK_TOKEN_PAIR
                - UNSUPPORTED_SWAP_DIRECTION
                - WALLET_SCREENED
            name:
              type: string
              description: Error class name
              example: InvalidAddressError
            message:
              type: string
              description: Detailed error message
              example: The format of the specified address is invalid.
            title:
              type: string
              description: Short, user-friendly error title
              example: Invalid address format
            statusCode:
              type: integer
              description: HTTP status code
              example: 400
            details:
              type: object
              description: >-
                Additional context about the error, including invalid values and
                suggestions
              properties:
                field:
                  type: string
                  description: The field that caused the error
                address:
                  type: string
                  description: The invalid address value
                reason:
                  type: string
                  description: Explanation of why the value is invalid
              additionalProperties: true
              example:
                field: srcToken
                address: 0xinvalid
                reason: Address must be 40 characters long
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
              example: '2024-01-01T00:00:00.000Z'
    Payment:
      allOf:
        - $ref: '#/components/schemas/TokenInfo'
        - type: object
          required:
            - amount
          properties:
            amount:
              type: string
              pattern: ^[0-9]+$
            usdAmount:
              type:
                - number
                - 'null'
              format: float
              description: USD value of the payment amount
    TokenInfo:
      type: object
      required:
        - chainId
        - address
        - name
        - symbol
        - decimals
        - isNative
      properties:
        chainId:
          $ref: '#/components/schemas/ChainId'
          description: Chain ID for the token
        address:
          $ref: '#/components/schemas/Address'
          description: Token address
        name:
          type: string
          description: Token name
        symbol:
          type: string
          description: Token symbol
        decimals:
          type: integer
          description: Token decimals
        isNative:
          type: boolean
          description: Boolean flag for whether token is the chain's gas token.
        logo:
          type:
            - string
            - 'null'
          description: URL to the token's logo image. Can be null if logo is not available.
        swapsXyzCode:
          type: string
          description: Internal Swaps.xyz token identifier code.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````