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

# Cross-venue cluster membership for a set of markets

> Resolves each `<provider_id>:<market_id>` reference to its equivalence cluster at the requested tier floor and returns the cluster's other live members. Members listed on a venue whose indexing is switched off, or whose status is settled/closed/resolved, are excluded; a reference whose cluster keeps fewer than two live members after that filter is omitted from the response entirely. Membership is capped at 32 per cluster, with `truncated` and the stored `size` stating what was left out.




## OpenAPI

````yaml /openapi/data-api.yaml get /market-clusters
openapi: 3.1.0
info:
  title: Kairos Data API
  version: 1.0.0
  summary: >-
    The full Kairos data plane — markets, candles, trades, search, discover,
    sports, trader analytics, and PnL.
  description: |
    The Kairos Data API at `data.kairos.trade` is the platform's primary data
    plane: market metadata and prices, OHLCV candles, live venue trade proxies,
    normalized trade history, full-text search, discovery feeds, the sports
    catalog, public trader analytics, and account PnL.

    ## Authentication

    Most endpoints accept a Kairos **API key** (`X-Client-Id` + `X-Api-Key` +
    `X-Api-Secret`, all three) or a first-party session JWT. Endpoints tagged
    `public` (trader analytics, provider configs, several sports feeds) need
    no credentials at all. Some endpoints additionally require an API-key
    **scope** (`trade:read`, `position:read`) — stated per operation.

    For high-volume market-data consumption (candles/trades/metadata at
    scale), prefer the dedicated **Market Data API** at `md.kairos.trade` —
    it has higher budgets, ETag caching, and a binary candle format.

    ## Rate limits

    Rate limits use a sliding window keyed on the authenticated user (JWT
    `sub`) or, for anonymous callers, the trusted client IP. Routes belong to
    a named **bucket** (`x-kairos-bucket`) whose per-minute budget is shared
    by every route in it; routes with no bucket run under the service default
    of 100/minute. `x-kairos-rate-limit` states the bucket's compile-time
    default — operators can raise or lower a bucket at runtime, so treat the
    documented number as the baseline, not a contract. 429 responses carry
    `Retry-After` and `X-RateLimit-*`.

    ## Conventions

    - Prices are on the **0–100 cents scale** unless a field says otherwise
      (trader-analytics position/trade prices use the 0–1 scale; each field's
      description states its scale).
    - Errors: `{"detail": "<message>"}` for handler errors; FastAPI's
      standard validation envelope for 422s. Errors surfaced from a venue
      adapter instead use `{"error", "provider", "operation", "message"}` —
      see `DataProviderError`. Unhandled failures always return the generic
      500 body; internal details are logged, never returned.
    - Every request body is capped at 8 MiB service-wide (413).
  contact:
    name: Kairos
    url: https://app.kairos.trade/docs/api-reference
  termsOfService: https://kairos.trade/terms
servers:
  - url: https://data.kairos.trade
    description: Production
  - url: https://staging-data.kairos.trade
    description: Staging
security:
  - apiKeyClientId: []
    apiKeyKey: []
    apiKeySecret: []
paths:
  /market-clusters:
    get:
      tags:
        - Markets
      summary: Cross-venue cluster membership for a set of markets
      description: >
        Resolves each `<provider_id>:<market_id>` reference to its equivalence
        cluster at the requested tier floor and returns the cluster's other live
        members. Members listed on a venue whose indexing is switched off, or
        whose status is settled/closed/resolved, are excluded; a reference whose
        cluster keeps fewer than two live members after that filter is omitted
        from the response entirely. Membership is capped at 32 per cluster, with
        `truncated` and the stored `size` stating what was left out.
      operationId: getMarketClusters
      parameters:
        - name: markets
          in: query
          required: true
          description: >-
            Comma-separated `<provider_id>:<market_id>` references, max 200.
            Only the first colon separates the two parts, so market ids may
            themselves contain colons. Unparseable and duplicate references are
            dropped silently.
          schema:
            type: string
          example: 1:0x1234abcd,2:KXNBA-26JAN15-LAL
        - name: floor
          in: query
          description: Tier floor to resolve membership at.
          schema:
            type: string
            enum:
              - exact
              - semantic
            default: exact
      responses:
        '200':
          description: Cluster membership keyed by the requested reference.
          headers:
            Cache-Control:
              schema:
                type: string
                example: public, max-age=10
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketClustersResponse'
        '400':
          description: >-
            Unknown `floor`, no parseable `<provider_id>:<market_id>` reference,
            or more than 200 references.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataError'
        '422':
          $ref: '#/components/responses/DataValidationError'
        '429':
          $ref: '#/components/responses/DataRateLimited'
        '503':
          description: The cluster store could not be queried.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataError'
              example:
                detail: Cluster store unavailable
      security: []
components:
  schemas:
    MarketClustersResponse:
      type: object
      required:
        - clusters
        - count
        - floor
      properties:
        clusters:
          type: object
          description: >
            Keyed by the requested `<provider_id>:<market_id>` reference. A
            reference with no cluster, or whose cluster has fewer than two live
            members after filtering, is absent — the map is never padded with
            empties.
          additionalProperties:
            $ref: '#/components/schemas/MarketCluster'
        count:
          type: integer
          description: Number of entries in `clusters`.
        floor:
          type: string
          enum:
            - exact
            - semantic
    DataError:
      type: object
      description: Handler error envelope (FastAPI HTTPException).
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
          example: Invalid provider
    MarketCluster:
      type: object
      required:
        - cluster_id
        - floor
        - truncated
        - size
        - members
      properties:
        cluster_id:
          type: string
        floor:
          type: string
          description: Tier floor this membership was resolved at.
          enum:
            - exact
            - semantic
        truncated:
          type: boolean
          description: True when the cluster holds more members than the 32 returned.
        size:
          type: integer
          description: Cluster size as stored — counts members this response filtered out.
        members:
          type: array
          maxItems: 32
          items:
            $ref: '#/components/schemas/MarketClusterMember'
    MarketClusterMember:
      type: object
      description: >-
        One market inside a cluster, after the venue allowlist and stale-status
        filter.
      required:
        - provider_id
        - provider
        - market_id
      properties:
        provider_id:
          type: integer
          description: Numeric provider id as stored.
        provider:
          type: string
          description: Provider name resolved from provider_id.
          example: polymarket
        market_id:
          type: string
        title:
          type:
            - string
            - 'null'
        ticker:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
        expires_at:
          type:
            - string
            - 'null'
          description: ISO-8601 expiry, null when the venue publishes none.
  responses:
    DataValidationError:
      description: Request failed FastAPI parameter validation.
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
            properties:
              detail:
                type: array
                description: >-
                  One entry per failed field, with location, message, and error
                  type.
                items:
                  type: object
                  additionalProperties: true
    DataRateLimited:
      description: >
        Rate limit exceeded for this route's sliding window, keyed on the
        session `sub` when

        authenticated and on the trusted client IP otherwise. Honor
        `Retry-After`. A per-API-key

        data ceiling (set per credential) rejects with `{"detail": "API key data
        rate limit

        exceeded"}` instead of the `error` envelope below.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Rate limit exceeded: 100 per 1 minute'
  securitySchemes:
    apiKeyClientId:
      type: apiKey
      in: header
      name: X-Client-Id
      description: >-
        Credential client id (`kairos_ck_...`). Must be sent together with
        X-Api-Key and X-Api-Secret.
    apiKeyKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 64-char hex API key.
    apiKeySecret:
      type: apiKey
      in: header
      name: X-Api-Secret
      description: 64-char hex API secret.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.