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

# Discover market routes

> Discover direct and multi-hop routes between assets. The response is informational and does not reserve liquidity.



## OpenAPI

````yaml /openapi.json post /api/v1/market/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/routes:
    post:
      tags:
        - market
      summary: Discover market routes
      description: >-
        Discover direct and multi-hop routes between assets. The response is
        informational and does not reserve liquidity.
      operationId: discoverMarketRoutes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutesResponse'
        '401':
          description: Missing or invalid Bearer API key.
          content:
            application/json:
              example:
                error: missing_api_key
              schema:
                $ref: '#/components/schemas/ApiKeyAuthErrorResponse'
        '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:
    RoutesRequest:
      properties:
        from_asset:
          type: string
          title: From Asset
          description: Source asset ticker or ID
        from_layer:
          anyOf:
            - $ref: '#/components/schemas/Layer'
            - type: 'null'
          description: Filter by source layer (optional)
        to_asset:
          anyOf:
            - type: string
            - type: 'null'
          title: To Asset
          description: Destination asset (if None, returns all reachable assets)
        to_layer:
          anyOf:
            - $ref: '#/components/schemas/Layer'
            - type: 'null'
          description: Filter by destination layer (optional)
        max_hops:
          type: integer
          maximum: 5
          minimum: 1
          title: Max Hops
          description: Maximum number of hops (1-5)
          default: 2
      type: object
      required:
        - from_asset
      title: RoutesRequest
      description: Request for route discovery.
    RoutesResponse:
      properties:
        routes:
          items:
            $ref: '#/components/schemas/MultiHopRoute'
          type: array
          title: Routes
          description: List of discovered routes
        timestamp:
          type: integer
          title: Timestamp
          description: Response timestamp
      type: object
      required:
        - routes
        - timestamp
      title: RoutesResponse
      description: Response with discovered routes.
    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
    FastAPIValidationErrorResponse:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
          type: array
          title: Detail
      type: object
      required:
        - detail
      title: FastAPIValidationErrorResponse
    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
    Layer:
      type: string
      enum:
        - BTC_L1
        - BTC_LN
        - BTC_SPARK
        - BTC_ARKADE
        - BTC_LIQUID
        - BTC_CASHU
        - RGB_L1
        - RGB_LN
        - TAPASS_L1
        - TAPASS_LN
        - LIQUID_LIQUID
        - ARKADE_ARKADE
        - SPARK_SPARK
      title: Layer
      description: >-
        Settlement layer combining protocol and network as a single string.


        Format: PROTOCOL/NETWORK


        Each layer represents a valid combination where assets can exist and be
        transacted.

        The layer encodes both WHAT protocol the asset uses and WHERE it
        settles.
    MultiHopRoute:
      properties:
        steps:
          items:
            $ref: '#/components/schemas/RouteStep'
          type: array
          title: Steps
          description: Ordered list of route steps
        total_hops:
          type: integer
          title: Total Hops
          description: Number of hops in the route
      type: object
      required:
        - steps
        - total_hops
      title: MultiHopRoute
      description: Complete route with one or more steps.
    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
    RouteStep:
      properties:
        from_asset:
          type: string
          title: From Asset
          description: Source asset ticker
        from_layer:
          $ref: '#/components/schemas/Layer'
          description: Source layer
        to_asset:
          type: string
          title: To Asset
          description: Destination asset ticker
        to_layer:
          $ref: '#/components/schemas/Layer'
          description: Destination layer
        pair_ticker:
          type: string
          title: Pair Ticker
          description: Trading pair ticker (e.g., 'USDT/BTC')
        indicative_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Indicative Price
          description: Indicative price from cached pair data
      type: object
      required:
        - from_asset
        - from_layer
        - to_asset
        - to_layer
        - pair_ticker
      title: RouteStep
      description: Single step in a route (one swap within a trading pair).
  securitySchemes:
    KaleidoApiKey:
      type: http
      scheme: bearer
      bearerFormat: Kaleido API key
      description: Pass a Kaleido API key such as `kld_live_c_...`.

````