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

# Get pair routes

> Return the supported execution routes for a specific trading pair. Exactly one identification method must be provided.



## OpenAPI

````yaml /openapi.json post /api/v1/market/pairs/routes
openapi: 3.1.0
info:
  title: Kaleidoswap RGB-LSP API
  summary: Public KaleidoSwap Maker API contract
  description: >-
    Public Maker API for KaleidoSwap market data, quotes, atomic swaps, and RGB
    LSPS1

    channel operations.


    Maker endpoints support Bearer API-key authentication. During rollout,

    deployments may accept anonymous requests while attribution is collected;
    once

    API-key enforcement is enabled, requests without a valid `kld_...` key
    return

    `401`.


    Use the per-order `access_token` returned by LSPS1 channel-order creation
    when

    polling protected order status endpoints or submitting a rate decision after
    the

    maker requests client confirmation.
  version: 0.2.0
  termsOfService: https://kaleidoswap.com/terms
  contact:
    name: Kaleidoswap Team
    email: info@kaleidoswap.com
    url: https://kaleidoswap.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  x-support:
    email: contact@kaleidoswap.com
    documentation: https://docs.kaleidoswap.com/api-reference/introduction
  x-build-info:
    version: archive/settlement-backends-pre-removal-7-gb8788aa2
    commit: b8788aa257ea4a01ac0dffc1826cf3bcf1caf09f
    buildDate: '2026-08-05T09:57:35.455127+00:00'
servers:
  - url: http://localhost:8000
    description: Local development
security: []
tags:
  - name: lsps1
    description: >-
      RGB LSPS1 liquidity endpoints for capability discovery, channel-order
      creation, fee estimation, order tracking, rate decisions, and asset
      delivery retries.
  - name: market
    description: >-
      Public market discovery APIs for assets, trading pairs, routes, and
      RFQ-based quote requests.
  - name: swaps
    description: >-
      Atomic swap APIs used by direct RLN integrations to initialize, execute,
      and track swaps.
paths:
  /api/v1/market/pairs/routes:
    post:
      tags:
        - market
      summary: Get pair routes
      description: >-
        Return the supported execution routes for a specific trading pair.
        Exactly one identification method must be provided.
      operationId: getMarketPairRoutes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PairRoutesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PairRoutesResponse'
        '400':
          description: The pair identifier payload is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailOnlyErrorResponse'
              example:
                detail: >-
                  Exactly one identification method must be provided: pair_id,
                  (from_asset_id + quote_asset_id), pair_ticker, or (base_ticker
                  + quote_ticker)
        '401':
          description: Missing or invalid Bearer API key.
          content:
            application/json:
              example:
                error: missing_api_key
              schema:
                $ref: '#/components/schemas/ApiKeyAuthErrorResponse'
        '404':
          description: No routes exist for the requested pair.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KaleidoErrorResponse'
              example:
                error_code: NOT_FOUND
                message: 'No routes found for: BTC/USDT'
                details: {}
                request_id: req_01HV8Q9X7G0Q7Y3Z
        '422':
          description: Request validation failed before reaching application logic.
          content:
            application/json:
              example:
                detail:
                  - loc:
                      - body
                      - rfq_id
                    msg: Field required
                    type: missing
              schema:
                $ref: '#/components/schemas/FastAPIValidationErrorResponse'
        '429':
          description: Too many requests. Respect the rate-limit headers before retrying.
          content:
            application/json:
              example:
                error_code: RATE_LIMIT_EXCEEDED
                message: Too many requests
                details:
                  retry_after: 60
                request_id: req_01HV8Q9X7G0Q7Y3Z
              schema:
                $ref: '#/components/schemas/KaleidoErrorResponse'
        '500':
          description: Unhandled server error.
          content:
            application/json:
              example:
                error_code: INTERNAL_ERROR
                message: Internal Server Error
                details: {}
                request_id: req_01HV8Q9X7G0Q7Y3Z
              schema:
                $ref: '#/components/schemas/KaleidoErrorResponse'
      security:
        - KaleidoApiKey: []
components:
  schemas:
    PairRoutesRequest:
      properties:
        pair_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Pair Id
        from_asset_id:
          anyOf:
            - type: string
            - type: 'null'
          title: From Asset Id
        quote_asset_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Quote Asset Id
        pair_ticker:
          anyOf:
            - type: string
            - type: 'null'
          title: Pair Ticker
        base_ticker:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Ticker
        quote_ticker:
          anyOf:
            - type: string
            - type: 'null'
          title: Quote Ticker
      type: object
      title: PairRoutesRequest
    PairRoutesResponse:
      properties:
        routes:
          items:
            $ref: '#/components/schemas/SwapRoute'
          type: array
          title: Routes
      type: object
      required:
        - routes
      title: PairRoutesResponse
    DetailOnlyErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error detail
          examples:
            - pair_ticker must be in format 'BASE/QUOTE'
      type: object
      required:
        - detail
      title: DetailOnlyErrorResponse
    ApiKeyAuthErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: API-key authentication error code
          examples:
            - missing_api_key
            - invalid_api_key
      type: object
      required:
        - error
      title: ApiKeyAuthErrorResponse
    KaleidoErrorResponse:
      properties:
        error_code:
          type: string
          title: Error Code
          description: Stable machine-readable application error code
          examples:
            - PAIR_NOT_FOUND
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - 'Trading pair not found: BTC/USDT'
        details:
          additionalProperties: true
          type: object
          title: Details
          description: Optional structured error details
        request_id:
          type: string
          title: Request Id
          description: Request correlation identifier for support and debugging
          examples:
            - req_01HV8Q9X7G0Q7Y3Z
      type: object
      required:
        - error_code
        - message
        - request_id
      title: KaleidoErrorResponse
    FastAPIValidationErrorResponse:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
          type: array
          title: Detail
      type: object
      required:
        - detail
      title: FastAPIValidationErrorResponse
    SwapRoute:
      properties:
        from_layer:
          type: string
        to_layer:
          type: string
      type: object
      required:
        - from_layer
        - to_layer
      title: SwapRoute
      description: >-
        Pre-computed valid swap route between two layers.


        Represents a specific path for swapping: from_layer -> to_layer.

        Frozen for immutability and hashability (enables use in sets, dict
        keys).
    ValidationErrorDetail:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
          description: Location of the validation failure
          examples:
            - - body
              - rfq_id
        msg:
          type: string
          title: Msg
          description: Validation error message
          examples:
            - Field required
        type:
          type: string
          title: Type
          description: FastAPI/Pydantic validation error type
          examples:
            - missing
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationErrorDetail
  securitySchemes:
    KaleidoApiKey:
      type: http
      scheme: bearer
      bearerFormat: Kaleido API key
      description: Pass a Kaleido API key such as `kld_live_c_...`.

````