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

# Request market quote

> Request an RFQ-backed quote for a route between two asset legs. A successful response returns an `rfq_id` that can be consumed by atomic swap initiation until the quote expires.



## OpenAPI

````yaml /openapi.json post /api/v1/market/quote
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/quote:
    post:
      tags:
        - market
      summary: Request market quote
      description: >-
        Request an RFQ-backed quote for a route between two asset legs. A
        successful response returns an `rfq_id` that can be consumed by atomic
        swap initiation until the quote expires.
      operationId: requestMarketQuote
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PairQuoteRequest'
            examples:
              btc_ln_to_rgb_ln:
                summary: Quote BTC Lightning to RGB Lightning
                value:
                  from_asset:
                    asset_id: BTC
                    layer: BTC_LN
                    amount: 1500000
                  to_asset:
                    asset_id: >-
                      rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB
                    layer: RGB_LN
      responses:
        '200':
          description: Quote created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PairQuoteResponse'
              example:
                rfq_id: 13d4777c-ae96-4858-9c7c-3ca730c5039a
                from_asset:
                  asset_id: BTC
                  name: Bitcoin
                  ticker: BTC
                  layer: BTC_LN
                  amount: 1500000
                  precision: 8
                to_asset:
                  asset_id: rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB
                  name: Tether USD
                  ticker: USDT
                  layer: RGB_LN
                  amount: 875000
                  precision: 6
                price: 59507000000
                fee:
                  base_fee: 1000
                  variable_fee: 250
                  fee_rate: 0.0001
                  final_fee: 1250
                  fee_asset: BTC
                  fee_asset_precision: 8
                timestamp: 1715896356
                expires_at: 1715896416
        '400':
          description: The requested route or amount is invalid.
          content:
            application/json:
              example:
                detail: 'Route not supported for this pair. From: BTC_LN, To: RGB_LN'
              schema:
                $ref: '#/components/schemas/DetailOnlyErrorResponse'
        '401':
          description: Missing or invalid Bearer API key.
          content:
            application/json:
              example:
                error: missing_api_key
              schema:
                $ref: '#/components/schemas/ApiKeyAuthErrorResponse'
        '404':
          description: The requested pair does not exist.
          content:
            application/json:
              example:
                error_code: PAIR_NOT_FOUND
                message: 'Trading pair not found: BTC/USDT'
                details: {}
                request_id: req_01HV8Q9X7G0Q7Y3Z
              schema:
                $ref: '#/components/schemas/KaleidoErrorResponse'
        '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'
        '503':
          description: The trading service is still starting or temporarily unavailable.
          content:
            application/json:
              example:
                error_code: SERVICE_UNAVAILABLE
                message: >-
                  Trading service is starting up. Please try again in a few
                  moments.
                details: {}
                request_id: req_01HV8Q9X7G0Q7Y3Z
              schema:
                $ref: '#/components/schemas/KaleidoErrorResponse'
      security:
        - KaleidoApiKey: []
components:
  schemas:
    PairQuoteRequest:
      properties:
        from_asset:
          $ref: '#/components/schemas/SwapLegInput'
          description: Source leg specification (asset_id, layer, amount)
        to_asset:
          $ref: '#/components/schemas/SwapLegInput'
          description: Destination leg specification (asset_id, layer, amount)
      type: object
      required:
        - from_asset
        - to_asset
      title: PairQuoteRequest
      description: Request for a quote on a trading pair using SwapLegInput.
      example:
        from_asset:
          amount: 1500000
          asset_id: BTC
          layer: BTC_LN
        to_asset:
          asset_id: rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB
          layer: RGB_LN
    PairQuoteResponse:
      properties:
        rfq_id:
          type: string
          title: Rfq Id
          examples:
            - '1234567890'
        from_asset:
          $ref: '#/components/schemas/SwapLeg'
          description: Complete source leg specification with amount and details
        to_asset:
          $ref: '#/components/schemas/SwapLeg'
          description: Complete destination leg specification with amount and details
        price:
          type: integer
          format: int64
          title: Price
          description: >-
            Price of 1 whole unit of from_asset (e.g., 1 BTC) in terms of the
            smallest unit of to_asset (e.g., USDT with precision 6). Matches
            PriceData.price for the given rfq_id.
          examples:
            - 50000123456
        fee:
          $ref: '#/components/schemas/Fee'
        timestamp:
          type: integer
          title: Timestamp
          description: Quote creation timestamp (seconds since epoch)
        expires_at:
          type: integer
          title: Expires At
          description: Quote expiry timestamp (seconds since epoch)
      type: object
      required:
        - rfq_id
        - from_asset
        - to_asset
        - price
        - fee
        - timestamp
        - expires_at
      title: PairQuoteResponse
      description: |-
        Response containing a quote for a trading pair.

        Uses full SwapLeg for both sides, providing complete asset details
        including ticker, name, precision, layer, and amount.
    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
    SwapLegInput:
      properties:
        asset_id:
          type: string
          title: Asset Id
          description: Asset identifier (e.g., 'BTC', RGB contract ID)
          examples:
            - BTC
        layer:
          $ref: '#/components/schemas/Layer'
          description: Settlement layer (e.g., 'BTC_LN', 'RGB_L1')
          examples:
            - BTC_LN
        amount:
          anyOf:
            - type: integer
              format: int64
            - type: 'null'
          title: Amount
          description: Amount in smallest unit (optional - one side must have amount)
          examples:
            - 1000000
      type: object
      required:
        - asset_id
        - layer
      title: SwapLegInput
      description: >-
        Lightweight input model for specifying one leg of a swap request.


        Only contains the fields the client needs to provide. The service will

        look up additional details (name, ticker, precision) from the asset
        registry.
    SwapLeg:
      properties:
        asset_id:
          type: string
          title: Asset Id
          description: Unique identifier for the asset (e.g., 'BTC', RGB contract ID, etc.)
        name:
          type: string
          title: Name
          description: Full name of the asset
          examples:
            - Bitcoin
        ticker:
          type: string
          title: Ticker
          description: Asset ticker symbol for display (e.g., 'BTC', 'USDT', 'EURX')
          examples:
            - BTC
        layer:
          $ref: '#/components/schemas/Layer'
          description: Settlement layer (e.g., 'BTC_LN', 'RGB_L1')
        amount:
          type: integer
          minimum: 0
          format: int64
          title: Amount
          description: >-
            Amount of the asset in smallest unit. Must be greater than or equal
            to zero.
          examples:
            - 100000
        precision:
          type: integer
          maximum: 18
          minimum: 0
          title: Precision
          description: >-
            Number of decimal places for this asset (e.g., 8 for BTC, 6 or 8 for
            stablecoins)
          examples:
            - 8
      type: object
      required:
        - asset_id
        - name
        - ticker
        - layer
        - amount
        - precision
      title: SwapLeg
      description: >-
        Swap Leg: Complete asset specification for one side of a swap.


        Represents a specific asset on a specific settlement layer with an
        amount.

        This is the fundamental unit for swap orders - each side (leg) of a swap

        specifies an asset on a particular network with a specific amount.
    Fee:
      properties:
        base_fee:
          type: integer
          format: int64
          title: Base Fee
          examples:
            - 1000000
        variable_fee:
          type: integer
          format: int64
          title: Variable Fee
          examples:
            - 1000000
        fee_rate:
          type: number
          title: Fee Rate
          examples:
            - 0.0001
        final_fee:
          type: integer
          format: int64
          title: Final Fee
          examples:
            - 2000000
        fee_asset:
          type: string
          title: Fee Asset
          examples:
            - rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd
        fee_asset_precision:
          type: integer
          title: Fee Asset Precision
          examples:
            - 6
      type: object
      required:
        - base_fee
        - variable_fee
        - fee_rate
        - final_fee
        - fee_asset
        - fee_asset_precision
      title: Fee
    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
    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.
  securitySchemes:
    KaleidoApiKey:
      type: http
      scheme: bearer
      bearerFormat: Kaleido API key
      description: Pass a Kaleido API key such as `kld_live_c_...`.

````