> ## 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 Paths

> Retrieves all available token paths across supported chains with configurable filtering options. It’s recommended to call this endpoint after selecting the source and destination tokens to validate route eligibility.



## OpenAPI

````yaml /swap-api-reference/openapi.json get /getPaths
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:
  /getPaths:
    get:
      summary: Get Paths
      description: >-
        Retrieves all available token paths across supported chains with
        configurable filtering options. It’s recommended to call this endpoint
        after selecting the source and destination tokens to validate route
        eligibility.
      operationId: getPaths
      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
          schema:
            type: string
        - name: dstChainId
          in: query
          required: false
          description: 'Recommended: destination chain ID'
          schema:
            $ref: '#/components/schemas/ChainId'
        - name: dstToken
          in: query
          required: false
          description: 'Recommended: destination token address'
          schema:
            type: string
        - name: excludeBridgeIds
          in: query
          required: false
          description: Bridge IDs to exclude from routing
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BridgeId'
        - name: excludeDexIds
          in: query
          required: false
          description: DEX IDs to exclude from routing
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DexId'
      responses:
        '200':
          description: Paths response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPathsOutput'
        '400':
          description: Bad request due to missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      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.
    BridgeId:
      type: string
      description: Bridge protocol identifier (e.g. "across", "relay", "mayan").
    DexId:
      type: string
      description: DEX identifier (depends on integration)
    GetPathsOutput:
      type: object
      properties:
        srcChainId:
          $ref: '#/components/schemas/ChainId'
          description: The source chain ID
        srcToken:
          $ref: '#/components/schemas/TokenInfoWithAmounts'
          description: Source token information including amount limits
        paths:
          type: array
          items:
            $ref: '#/components/schemas/ChainPath'
        timestamp:
          type: string
          description: Response timestamp (ISO string) for cache validation
      required:
        - srcChainId
        - srcToken
        - paths
        - timestamp
    ErrorResponse:
      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
            name:
              type: string
              description: Error class name
            message:
              type: string
              description: Detailed error message
            title:
              type: string
              description: Short, user-friendly error title
            statusCode:
              type: integer
              description: HTTP status code
            details:
              type: object
              description: Additional error details
              additionalProperties: true
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
    TokenInfoWithAmounts:
      allOf:
        - $ref: '#/components/schemas/TokenInfo'
        - type: object
          required:
            - minAmount
            - maxAmount
          properties:
            minAmount:
              type: string
              nullable: true
              description: |-
                Minimum amount of source token for exact-out swaps. 
                 `null` if no min.
            maxAmount:
              type: string
              nullable: true
              description: |-
                Maximum amount of source token for exact-out swaps. 
                 `null` if no max.
    ChainPath:
      type: object
      properties:
        chainId:
          $ref: '#/components/schemas/ChainId'
        tokens:
          description: |-
            Available destination tokens for given source token 
             `all` indicates all tokens on destination chain are eligible
          oneOf:
            - title: Named VM
              type: string
              enum:
                - all
            - title: Token List
              type: array
              items:
                $ref: '#/components/schemas/TokenInfoWithAmounts'
        supportsExactAmountIn:
          type: boolean
        supportsExactAmountOut:
          type: boolean
        amountLimits:
          allOf:
            - $ref: '#/components/schemas/AmountLimits'
            - type: object
              deprecated: true
              description: >-
                ⚠️ This field is maintained for backwards compatibility. Use
                `srcToken.minAmount` and `srcToken.maxAmount` at the top level
                of the response instead.
      required:
        - chainId
        - tokens
        - supportsExactAmountIn
        - supportsExactAmountOut
    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
          nullable: true
          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.
    AmountLimits:
      type: object
      required:
        - minAmount
        - maxAmount
      properties:
        minAmount:
          type: string
          nullable: true
          description: |-
            Minimum amount of source token required for exact-in swaps. 
             `null` if no min.
        maxAmount:
          type: string
          nullable: true
          description: |-
            Maximum amount of source token for exact-in swaps. 
             `null` if no max.
    Address:
      type: string
      description: >-
        Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or
        AltVmAddress.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````