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

# List markets

> Canonical sports markets, each with the Kalshi, Polymarket, Polymarket US and Hyperliquid legs that trade the same outcome. Filter by league, sport, status, start time or text, or look up the markets of one venue symbol. Pass `next_cursor` back as `cursor` for the next page.



## OpenAPI

````yaml api-reference/openapi.json GET /markets
openapi: 3.0.0
info:
  title: Lean API
  version: 0.1.0
  description: >-
    Programmatic access to Lean: canonical sports markets, quotes, orders,
    positions and balances.
servers:
  - url: '{baseUrl}/v1'
    description: Lean API
    variables:
      baseUrl:
        default: https://api.lean.xyz
        description: >-
          The Lean API base URL, without /v1. Same value as LEAN_API_URL in the
          guides.
security:
  - apiKey: []
paths:
  /markets:
    get:
      tags:
        - Markets
      summary: List markets
      description: >-
        Canonical sports markets, each with the Kalshi, Polymarket, Polymarket
        US and Hyperliquid legs that trade the same outcome. Filter by league,
        sport, status, start time or text, or look up the markets of one venue
        symbol. Pass `next_cursor` back as `cursor` for the next page.
      operationId: listMarkets
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: >-
              Look up the markets one venue symbol trades: a leg `ticker`
              (`pm:…`, `hl:…`, `pmus:…` or a Kalshi market ticker), a Polymarket
              condition id or token id, or a Hyperliquid book coin (`#…`). The
              start window, cursor and other filters except `venue` do not
              apply.
          required: false
          description: >-
            Look up the markets one venue symbol trades: a leg `ticker` (`pm:…`,
            `hl:…`, `pmus:…` or a Kalshi market ticker), a Polymarket condition
            id or token id, or a Hyperliquid book coin (`#…`). The start window,
            cursor and other filters except `venue` do not apply.
          name: symbol
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            description: >-
              Words matched the way the Lean app search matches them: every word
              against Kalshi, Polymarket, Polymarket US and Hyperliquid market
              and event titles in any letter case, the last word as a prefix,
              with common team nicknames and small typos tried when few markets
              match. Only markets with a leg that matches are listed, in the
              usual start order, and the other filters and `cursor` apply as
              without it. A search covers the venue markets of the fixtures in
              the start window, at most 10,000 matching ones, open ones first
              and then by start, so narrow broad words with `league`, `sport` or
              the start window. To list a whole league, use `league`.
          required: false
          description: >-
            Words matched the way the Lean app search matches them: every word
            against Kalshi, Polymarket, Polymarket US and Hyperliquid market and
            event titles in any letter case, the last word as a prefix, with
            common team nicknames and small typos tried when few markets match.
            Only markets with a leg that matches are listed, in the usual start
            order, and the other filters and `cursor` apply as without it. A
            search covers the venue markets of the fixtures in the start window,
            at most 10,000 matching ones, open ones first and then by start, so
            narrow broad words with `league`, `sport` or the start window. To
            list a whole league, use `league`.
          name: search
          in: query
        - schema:
            type: string
            enum:
              - sports
            description: Market category. Every listed market is `sports` today.
          required: false
          description: Market category. Every listed market is `sports` today.
          name: category
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 32
            description: Only fixtures of this sport, such as `football`.
          required: false
          description: Only fixtures of this sport, such as `football`.
          name: sport
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 32
            example: nfl
          required: false
          name: league
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 512
            description: >-
              Only markets of this fixture, by its exact `fixture.key`. The
              start window still applies, so a fixture that starts outside it
              lists nothing.
          required: false
          description: >-
            Only markets of this fixture, by its exact `fixture.key`. The start
            window still applies, so a fixture that starts outside it lists
            nothing.
          name: fixture
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: >-
              Only markets of propositions with this exact `group.key`, such as
              `moneyline:game`. With `fixture`, lists one proposition of one
              fixture; without it, that proposition in every fixture the other
              filters keep.
          required: false
          description: >-
            Only markets of propositions with this exact `group.key`, such as
            `moneyline:game`. With `fixture`, lists one proposition of one
            fixture; without it, that proposition in every fixture the other
            filters keep.
          name: group
          in: query
        - schema:
            type: string
            enum:
              - kalshi
              - polymarket
              - polymarket_us
              - hyperliquid
            description: Only markets with a leg on this venue.
          required: false
          description: Only markets with a leg on this venue.
          name: venue
          in: query
        - schema:
            type: string
            enum:
              - open
              - closed
            description: >-
              `open`: at least one venue leg is `tradable`. `closed`: no leg is,
              including markets whose legs are only `unopened` or `resolving`.
          required: false
          description: >-
            `open`: at least one venue leg is `tradable`. `closed`: no leg is,
            including markets whose legs are only `unopened` or `resolving`.
          name: status
          in: query
        - schema:
            type: string
            format: date-time
            description: >-
              Only fixtures starting at or after this time. Defaults to 12 hours
              ago.
          required: false
          description: >-
            Only fixtures starting at or after this time. Defaults to 12 hours
            ago.
          name: starts_after
          in: query
        - schema:
            type: string
            format: date-time
            description: >-
              Only fixtures starting before this time. Defaults to 30 days
              ahead, so season futures such as a championship final are listed
              only when this is set past their start. Their market ids resolve
              at any time.
          required: false
          description: >-
            Only fixtures starting before this time. Defaults to 30 days ahead,
            so season futures such as a championship final are listed only when
            this is set past their start. Their market ids resolve at any time.
          name: starts_before
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          required: false
          name: limit
          in: query
          example: 2
        - schema:
            type: string
            minLength: 1
            maxLength: 512
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Canonical markets with their venue legs
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                      data:
                        type: object
                        properties:
                          markets:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  minLength: 1
                                title:
                                  type: string
                                  minLength: 1
                                outcome:
                                  type: string
                                  minLength: 1
                                line:
                                  type: string
                                  nullable: true
                                  pattern: ^-?\d+(?:\.\d+)?$
                                fixture:
                                  type: object
                                  properties:
                                    key:
                                      type: string
                                      minLength: 1
                                    sport:
                                      type: string
                                      minLength: 1
                                    league:
                                      type: string
                                      minLength: 1
                                    title:
                                      type: string
                                      minLength: 1
                                    starts_at:
                                      type: string
                                      format: date-time
                                    scheduled_date:
                                      type: string
                                      nullable: true
                                      pattern: ^\d{4}-\d{2}-\d{2}$
                                    participants:
                                      type: array
                                      items:
                                        type: string
                                        minLength: 1
                                    teams:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          key:
                                            type: string
                                            minLength: 1
                                          name:
                                            type: string
                                            minLength: 1
                                          role:
                                            type: string
                                            enum:
                                              - home
                                              - away
                                              - competitor
                                        required:
                                          - key
                                          - name
                                          - role
                                  required:
                                    - key
                                    - sport
                                    - league
                                    - title
                                    - starts_at
                                    - scheduled_date
                                    - participants
                                    - teams
                                group:
                                  type: object
                                  properties:
                                    key:
                                      type: string
                                      minLength: 1
                                    kind:
                                      type: string
                                      enum:
                                        - moneyline
                                        - spread
                                        - total
                                        - team_total
                                        - prop
                                    label:
                                      type: string
                                      minLength: 1
                                    period:
                                      type: string
                                      minLength: 1
                                    subject:
                                      type: string
                                      nullable: true
                                    stat:
                                      type: string
                                      nullable: true
                                    line:
                                      type: string
                                      nullable: true
                                      pattern: ^-?\d+(?:\.\d+)?$
                                  required:
                                    - key
                                    - kind
                                    - label
                                    - period
                                    - subject
                                    - stat
                                    - line
                                legs:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      venue:
                                        type: string
                                        enum:
                                          - kalshi
                                          - polymarket
                                          - polymarket_us
                                          - hyperliquid
                                      ticker:
                                        type: string
                                        minLength: 1
                                      side:
                                        type: string
                                        enum:
                                          - 'yes'
                                          - 'no'
                                      status:
                                        type: string
                                        nullable: true
                                        enum:
                                          - unopened
                                          - open
                                          - closed
                                          - resolving
                                          - resolved
                                        description: >-
                                          The venue market status: `unopened`,
                                          `open`, `closed`, `resolving` or
                                          `resolved`; null until Lean has recorded
                                          the venue market. The platform shows a
                                          live book for every status but `closed`
                                          and `resolved`.
                                      tradable:
                                        type: boolean
                                        description: >-
                                          Whether the venue takes orders on this
                                          leg now: `status` is `open`, the venue
                                          has not marked the market untradable,
                                          and the API trades on its venue. An
                                          `unopened` or `resolving` leg is live
                                          but not tradable.
                                      resolution:
                                        type: object
                                        properties:
                                          source:
                                            type: string
                                            nullable: true
                                            description: >-
                                              How the venue's resolution was recorded,
                                              such as the oracle event; null until it
                                              resolves.
                                          rules:
                                            type: string
                                            nullable: true
                                            description: >-
                                              The venue's resolution rules verbatim,
                                              secondary rules after a blank line.
                                          end_date:
                                            type: string
                                            nullable: true
                                            format: date-time
                                            description: >-
                                              When the venue market is scheduled to
                                              close, if the venue gives one.
                                          url:
                                            type: string
                                            nullable: true
                                            format: uri
                                            description: >-
                                              The venue's public page for this market,
                                              when it can be built from stored data.
                                        required:
                                          - source
                                          - rules
                                          - end_date
                                          - url
                                        description: How this venue resolves its market.
                                      fees:
                                        type: object
                                        nullable: true
                                        properties:
                                          formula:
                                            type: string
                                            enum:
                                              - price_curve
                                              - notional_on_exit
                                            description: >-
                                              `price_curve`: every fill, buy or sell,
                                              pays quantity × rate × (price × (1 −
                                              price))^exponent. `notional_on_exit`: a
                                              buy pays nothing; a sell pays quantity ×
                                              price × rate, and each winning share
                                              pays rate × $1 at settlement.
                                          taker_rate:
                                            type: string
                                            pattern: ^\d+(?:\.\d+)?$
                                            description: >-
                                              The rate, as a fraction of 1, a fill
                                              that takes liquidity pays.
                                          maker_rate:
                                            type: string
                                            pattern: ^\d+(?:\.\d+)?$
                                            description: >-
                                              The rate, as a fraction of 1, a resting
                                              order pays when it fills.
                                          exponent:
                                            type: integer
                                            nullable: true
                                            description: >-
                                              The exponent of `price_curve`; null for
                                              `notional_on_exit`.
                                        required:
                                          - formula
                                          - taker_rate
                                          - maker_rate
                                          - exponent
                                        description: >-
                                          What this venue charges a fill, as `POST
                                          /v1/orders/preview` prices it; null on
                                          Kalshi and Polymarket US, and when the
                                          venue's fee terms for the market are not
                                          recorded.
                                    required:
                                      - venue
                                      - ticker
                                      - side
                                      - status
                                      - tradable
                                      - resolution
                                      - fees
                                equivalence:
                                  type: string
                                  enum:
                                    - single_venue
                                    - verified
                                    - unreviewed
                                  description: >-
                                    `single_venue`: one leg. `verified`: a
                                    reviewer confirmed each venue market is the
                                    same proposition; rules text can still
                                    differ, so read each leg `resolution.rules`.
                                    `unreviewed`: at least one leg is not
                                    reviewed yet.
                              required:
                                - id
                                - title
                                - outcome
                                - line
                                - fixture
                                - group
                                - legs
                                - equivalence
                          next_cursor:
                            type: string
                            nullable: true
                            minLength: 1
                            maxLength: 512
                          livemode:
                            type: boolean
                        required:
                          - markets
                          - next_cursor
                          - livemode
                      meta:
                        type: object
                        properties:
                          timestampMs:
                            type: integer
                            minimum: 0
                          requestId:
                            type: string
                            minLength: 1
                          traceId:
                            type: string
                            minLength: 1
                          cachedAtMs:
                            type: integer
                            minimum: 0
                          source:
                            type: string
                            enum:
                              - cache
                              - database
                              - clickhouse
                              - upstream
                              - fallback
                              - internal
                        required:
                          - timestampMs
                          - requestId
                    required:
                      - success
                      - data
                      - meta
                  - $ref: '#/components/schemas/ApiError'
              examples:
                Spread markets:
                  summary: Both sides of DEN -3.5
                  value:
                    success: true
                    data:
                      markets:
                        - id: >-
                            mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4
                          title: >-
                            Denver Broncos at Los Angeles Chargers: DEN -3.5,
                            Denver Broncos -3.5
                          outcome: DEN
                          line: '-3.5'
                          fixture:
                            key: nfl:2026-10-11:DEN-LAC
                            sport: football
                            league: nfl
                            title: Denver Broncos at Los Angeles Chargers
                            starts_at: '2026-10-11T20:25:00.000Z'
                            scheduled_date: '2026-10-11'
                            participants:
                              - Denver Broncos
                              - Los Angeles Chargers
                            teams:
                              - key: DEN
                                name: Denver Broncos
                                role: away
                              - key: LAC
                                name: Los Angeles Chargers
                                role: home
                          group:
                            key: spread:game:DEN:-3.5
                            kind: spread
                            label: DEN -3.5
                            period: game
                            subject: DEN
                            stat: null
                            line: '-3.5'
                          legs:
                            - venue: hyperliquid
                              ticker: <venue ticker>
                              side: 'yes'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves YES if the Denver Broncos win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                            - venue: polymarket
                              ticker: <venue ticker>
                              side: 'yes'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves to Denver Broncos if they win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                          equivalence: verified
                        - id: >-
                            mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpMQUM
                          title: >-
                            Denver Broncos at Los Angeles Chargers: DEN -3.5,
                            Los Angeles Chargers +3.5
                          outcome: LAC
                          line: '3.5'
                          fixture:
                            key: nfl:2026-10-11:DEN-LAC
                            sport: football
                            league: nfl
                            title: Denver Broncos at Los Angeles Chargers
                            starts_at: '2026-10-11T20:25:00.000Z'
                            scheduled_date: '2026-10-11'
                            participants:
                              - Denver Broncos
                              - Los Angeles Chargers
                            teams:
                              - key: DEN
                                name: Denver Broncos
                                role: away
                              - key: LAC
                                name: Los Angeles Chargers
                                role: home
                          group:
                            key: spread:game:DEN:-3.5
                            kind: spread
                            label: DEN -3.5
                            period: game
                            subject: DEN
                            stat: null
                            line: '-3.5'
                          legs:
                            - venue: hyperliquid
                              ticker: <venue ticker>
                              side: 'no'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves YES if the Denver Broncos win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                            - venue: polymarket
                              ticker: <venue ticker>
                              side: 'no'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves to Denver Broncos if they win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                          equivalence: verified
                        - id: >-
                            mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4
                          title: >-
                            Denver Broncos at Los Angeles Chargers: DEN -3.5,
                            Denver Broncos -3.5
                          outcome: DEN
                          line: '-3.5'
                          fixture:
                            key: nfl:2026-10-11:DEN-LAC
                            sport: football
                            league: nfl
                            title: Denver Broncos at Los Angeles Chargers
                            starts_at: '2026-10-11T20:25:00.000Z'
                            scheduled_date: '2026-10-11'
                            participants:
                              - Denver Broncos
                              - Los Angeles Chargers
                            teams:
                              - key: DEN
                                name: Denver Broncos
                                role: away
                              - key: LAC
                                name: Los Angeles Chargers
                                role: home
                          group:
                            key: spread:game:DEN:-3.5
                            kind: spread
                            label: DEN -3.5
                            period: game
                            subject: DEN
                            stat: null
                            line: '-3.5'
                          legs:
                            - venue: hyperliquid
                              ticker: <venue ticker>
                              side: 'yes'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves YES if the Denver Broncos win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                            - venue: polymarket
                              ticker: <venue ticker>
                              side: 'yes'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves to Denver Broncos if they win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                          equivalence: verified
                        - id: >-
                            mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpMQUM
                          title: >-
                            Denver Broncos at Los Angeles Chargers: DEN -3.5,
                            Los Angeles Chargers +3.5
                          outcome: LAC
                          line: '3.5'
                          fixture:
                            key: nfl:2026-10-11:DEN-LAC
                            sport: football
                            league: nfl
                            title: Denver Broncos at Los Angeles Chargers
                            starts_at: '2026-10-11T20:25:00.000Z'
                            scheduled_date: '2026-10-11'
                            participants:
                              - Denver Broncos
                              - Los Angeles Chargers
                            teams:
                              - key: DEN
                                name: Denver Broncos
                                role: away
                              - key: LAC
                                name: Los Angeles Chargers
                                role: home
                          group:
                            key: spread:game:DEN:-3.5
                            kind: spread
                            label: DEN -3.5
                            period: game
                            subject: DEN
                            stat: null
                            line: '-3.5'
                          legs:
                            - venue: hyperliquid
                              ticker: <venue ticker>
                              side: 'no'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves YES if the Denver Broncos win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                            - venue: polymarket
                              ticker: <venue ticker>
                              side: 'no'
                              status: open
                              tradable: true
                              resolution:
                                source: null
                                rules: >-
                                  Resolves to Denver Broncos if they win by more
                                  than 3.5 points, overtime included.
                                end_date: '2026-10-12T04:00:00.000Z'
                                url: null
                          equivalence: verified
                      next_cursor: null
                      livemode: true
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '400':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Invalid request:
                  summary: A field failed validation
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Invalid request
                      details:
                        - path: limit
                          message: Number must be less than or equal to 200
                        - path: limit
                          message: Number must be less than or equal to 200
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '401':
          description: Missing, invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Unknown key:
                  summary: Unknown, expired or revoked key
                  value:
                    success: false
                    error:
                      code: UNAUTHORIZED
                      message: Invalid, expired or revoked API key
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
                Missing key:
                  summary: No Authorization header
                  value:
                    success: false
                    error:
                      code: UNAUTHORIZED
                      message: Missing API key
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '403':
          description: The key lacks the scope this route needs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Missing scope:
                  summary: The key lacks the read scope
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: This API key lacks the read scope
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '429':
          description: API error
          headers:
            Retry-After:
              description: Seconds remaining in the upstream read cooldown, when available
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Rate limited:
                  summary: Over 5 requests a second; wait for Retry-After
                  value:
                    success: false
                    error:
                      code: RATE_LIMITED
                      message: Too many requests for this API key
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '500':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Internal error:
                  summary: Unexpected server error
                  value:
                    success: false
                    error:
                      code: INTERNAL_ERROR
                      message: An internal error occurred.
                    meta:
                      timestampMs: 1791741600000
                      requestId: 5b0d7f3e-2c61-4e8a-b947-1d3a6e0f8c25
        '503':
          description: >-
            UPSTREAM_ERROR when `search` is set and search is unavailable; retry
            later
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UPSTREAM_ERROR
                  message: A required service is temporarily unavailable.
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
components:
  schemas:
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - NOT_FOUND
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - UPSTREAM_ERROR
                - RATE_LIMITED
                - INTERNAL_ERROR
                - FEATURE_DISABLED
                - CONDITIONAL_SELL_REJECTED
                - CONDITIONAL_SELL_ACTIVE
            message:
              type: string
              minLength: 1
            details:
              nullable: true
          required:
            - code
            - message
        meta:
          type: object
          properties:
            timestampMs:
              type: integer
              minimum: 0
            requestId:
              type: string
              minLength: 1
            traceId:
              type: string
              minLength: 1
            cachedAtMs:
              type: integer
              minimum: 0
            source:
              type: string
              enum:
                - cache
                - database
                - clickhouse
                - upstream
                - fallback
                - internal
          required:
            - timestampMs
            - requestId
      required:
        - success
        - error
        - meta
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Lean API key, sent as `Authorization: Bearer <key>`. A test key
        (`lean_sk_test_...`) simulates orders and fills with no money; a live
        key (`lean_sk_live_...`) trades for real within the key's limits. Every
        successful response says which mode answered in `data.livemode`.

````

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