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

# Get 5m/15m/1h crypto up-or-down prediction markets for a window

> Returns the crypto up/down markets (BTC/ETH/SOL/XRP on Kalshi + Polymarket, plus DOGE/HYPE/BNB and predict.fun on some intervals) for one time window. `window_offset` shifts by whole windows of the chosen `interval` (0=current, -1=previous, +1=next, etc.). Responses are cached so UI "previous/next window" navigation doesn't repeatedly re-fetch from upstream. Past windows are immutable and cached longer; future/current windows are refreshed more often since they're still filling in. A window is only cached once it has enough data from both venues; past windows relax that requirement for Kalshi, since Kalshi removes settled contracts from its API. **Price scale note:** `price` is a raw **0–1 decimal** probability read/derived directly from each venue's order book — NOT the platform's usual 0–100 cents scale.




## OpenAPI

````yaml /openapi/data-api.yaml get /markets/crypto
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:
  /markets/crypto:
    get:
      tags:
        - Markets
      summary: Get 5m/15m/1h crypto up-or-down prediction markets for a window
      description: >
        Returns the crypto up/down markets (BTC/ETH/SOL/XRP on Kalshi +
        Polymarket, plus DOGE/HYPE/BNB and predict.fun on some intervals) for
        one time window. `window_offset` shifts by whole windows of the chosen
        `interval` (0=current, -1=previous, +1=next, etc.). Responses are cached
        so UI "previous/next window" navigation doesn't repeatedly re-fetch from
        upstream. Past windows are immutable and cached longer; future/current
        windows are refreshed more often since they're still filling in. A
        window is only cached once it has enough data from both venues; past
        windows relax that requirement for Kalshi, since Kalshi removes settled
        contracts from its API. **Price scale note:** `price` is a raw **0–1
        decimal** probability read/derived directly from each venue's order book
        — NOT the platform's usual 0–100 cents scale.
      operationId: getCryptoMarkets
      parameters:
        - name: interval
          in: query
          required: false
          schema:
            type: string
            enum:
              - 5m
              - 15m
              - 1h
            default: 15m
          example: 15m
        - name: window_offset
          in: query
          required: false
          schema:
            type: integer
            minimum: -10000
            maximum: 10000
            default: 0
          description: >-
            Number of windows from current (0=now, -1=previous, +1=next).
            Bounded so an absurd offset is rejected with 422 rather than
            overflowing the window arithmetic.
          example: 0
      responses:
        '200':
          description: Crypto markets for the requested window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsCryptoResponse'
        '400':
          description: Invalid `interval` (must be 5m, 15m, or 1h).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: 'Invalid interval: 30m. Must be one of: [''15m'', ''1h'', ''5m'']'
        '401':
          $ref: '#/components/responses/DataUnauthorized'
        '403':
          $ref: '#/components/responses/DataForbidden'
        '422':
          $ref: '#/components/responses/DataValidationError'
        '429':
          $ref: '#/components/responses/DataRateLimited'
        '500':
          description: Upstream fetch (Kalshi/Polymarket/predict.fun) failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Failed to fetch crypto markets
components:
  schemas:
    MarketsCryptoResponse:
      type: object
      required:
        - markets
        - window_offset
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/MarketsCryptoMarket'
        window_offset:
          type: integer
    MarketsCryptoMarket:
      type: object
      required:
        - symbol
        - name
        - market_id
        - provider_id
        - is_settled
      properties:
        symbol:
          type: string
          enum:
            - BTC
            - ETH
            - SOL
            - XRP
            - DOGE
            - HYPE
            - BNB
        name:
          type: string
          description: >-
            Human-readable market title (Kalshi titles get an appended
            open/close time range).
        market_id:
          type: string
          description: Kalshi ticker or Polymarket/predict.fun market id.
        token_id:
          type:
            - string
            - 'null'
          description: >-
            Polymarket/predict.fun CLOB token id (the "Yes" token where
            resolvable). Absent for Kalshi entries.
        provider_id:
          type: integer
        price:
          type:
            - number
            - 'null'
          description: >-
            0-1 decimal probability (mid of best bid/ask, last trade, or
            settlement snap to 0/1 for past windows) — NOT the platform's usual
            0-100 cents scale. Null while a market has no orderbook yet.
          example: 0.47
        is_settled:
          type: boolean
          description: >-
            True for past windows and any market whose settlement/resolution was
            found; the price is then snapped to exactly 0.0 or 1.0.
        is_upcoming:
          type: boolean
          description: >-
            Only present on some current-window Kalshi entries — true if the
            market is in Kalshi's "initialized"/"unopened" pre-launch state.
        open_time:
          type:
            - string
            - 'null'
          description: Only present on some current-window Kalshi entries.
    DataError:
      type: object
      description: Handler error envelope (FastAPI HTTPException).
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
          example: Invalid provider
  responses:
    DataUnauthorized:
      description: >
        No valid credential presented — missing/invalid API-key headers, or an
        invalid/expired session token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataError'
          example:
            detail: Not authenticated
    DataForbidden:
      description: >
        Authenticated but not permitted. Three distinct causes: the session user
        is not invited

        (`Invite required`), the API key lacks the operation's scope, or API-key
        access to the

        requested venue is switched off (`API access is disabled for
        <provider>`). Admin and API-key

        callers bypass the invite check; session and admin callers bypass scope
        and venue checks.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataError'
          example:
            detail: Invite required
    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.