> ## 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:…`, `lt:…` 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:…`, `lt:…` 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`. With
              `kind=event`, every word must match a whole word of the open venue
              market title, its event title or its outcome names, in any letter
              case, the last word as a prefix, so `rain` finds `Rain` and
              `Rainfall` but not `Ukraine`; no nicknames or near spellings are
              tried.
          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`. With `kind=event`, every word
            must match a whole word of the open venue market title, its event
            title or its outcome names, in any letter case, the last word as a
            prefix, so `rain` finds `Rain` and `Rainfall` but not `Ukraine`; no
            nicknames or near spellings are tried.
          name: search
          in: query
        - schema:
            type: string
            enum:
              - sports
              - time_window
              - event
            description: >-
              `sports`: one outcome of a fixture proposition, with a leg on each
              venue that lists it. `time_window`: one outcome of a crypto price
              window. `event`: one side of a single Polymarket, Polymarket US,
              Hyperliquid or Kalshi market that no fixture lists and that is no
              Kalshi parlay, such as an election or a company result. Defaults
              to `time_window` with `category=crypto` or `venue=lighter`, to
              `event` with any category but `sports` and `crypto`, else to
              `sports`.
          required: false
          description: >-
            `sports`: one outcome of a fixture proposition, with a leg on each
            venue that lists it. `time_window`: one outcome of a crypto price
            window. `event`: one side of a single Polymarket, Polymarket US,
            Hyperliquid or Kalshi market that no fixture lists and that is no
            Kalshi parlay, such as an election or a company result. Defaults to
            `time_window` with `category=crypto` or `venue=lighter`, to `event`
            with any category but `sports` and `crypto`, else to `sports`.
          name: kind
          in: query
        - schema:
            type: string
            enum:
              - sports
              - crypto
              - politics
              - economy
              - business
              - entertainment
              - science
              - society
              - climate
              - commodities
              - transportation
              - gaming
              - health
              - law
              - uncategorized
            description: >-
              The topic listed. `sports` lists fixture markets. `crypto` without
              `kind` lists only Lighter crypto price windows, so with another
              `venue` it lists an empty page unless `kind=event` is passed.
              Every other category lists event markets. An event market lists as
              `crypto` when it is a coin-price market (Polymarket tagged
              `crypto-prices`, or `crypto` and `hit-price`; a Hyperliquid
              outcome tagged `asset:<coin>` for a Hyperliquid coin), whatever
              its taxonomy; otherwise as the first root of its Lean taxonomy,
              else the category Kalshi files it under, else `uncategorized`.
              Defaults to `sports`, or to `crypto` with `venue=lighter`. A
              `crypto` window listing takes the start window, `status`, `venue`,
              `limit` and `cursor`; an event listing takes `search`, `venue`,
              `status`, the end window, `limit` and `cursor`; filters that do
              not apply are refused.
          required: false
          description: >-
            The topic listed. `sports` lists fixture markets. `crypto` without
            `kind` lists only Lighter crypto price windows, so with another
            `venue` it lists an empty page unless `kind=event` is passed. Every
            other category lists event markets. An event market lists as
            `crypto` when it is a coin-price market (Polymarket tagged
            `crypto-prices`, or `crypto` and `hit-price`; a Hyperliquid outcome
            tagged `asset:<coin>` for a Hyperliquid coin), whatever its
            taxonomy; otherwise as the first root of its Lean taxonomy, else the
            category Kalshi files it under, else `uncategorized`. Defaults to
            `sports`, or to `crypto` with `venue=lighter`. A `crypto` window
            listing takes the start window, `status`, `venue`, `limit` and
            `cursor`; an event listing takes `search`, `venue`, `status`, the
            end window, `limit` and `cursor`; filters that do not apply are
            refused.
          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
            description: >-
              Only fixtures of this league. Coverage includes international
              basketball (euroleague, eurocup), hockey (khl, shl, del, ahl,
              liiga), soccer and other sports.
            example: nfl
          required: false
          description: >-
            Only fixtures of this league. Coverage includes international
            basketball (euroleague, eurocup), hockey (khl, shl, del, ahl,
            liiga), soccer and other sports.
          name: league
          in: query
        - schema:
            type: string
            enum:
              - moneyline
              - spread
              - total
              - team_total
              - prop
            description: >-
              Sports listings only: only propositions of this `group.kind`, such
              as `moneyline`, `spread`, `total`, `team_total` or `prop` (which
              includes `sports.player_prop` markets).
          required: false
          description: >-
            Sports listings only: only propositions of this `group.kind`, such
            as `moneyline`, `spread`, `total`, `team_total` or `prop` (which
            includes `sports.player_prop` markets).
          name: group_kind
          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
              - lighter
            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
            minLength: 1
            maxLength: 200
            description: >-
              Event markets only: list all markets/strikes belonging to this
              exact event ticker.
          required: false
          description: >-
            Event markets only: list all markets/strikes belonging to this exact
            event ticker.
          name: event
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: >-
              Event markets only: list markets belonging to this exact series
              ticker (e.g. KXFAOFPI).
          required: false
          description: >-
            Event markets only: list markets belonging to this exact series
            ticker (e.g. KXFAOFPI).
          name: series
          in: query
        - schema:
            type: string
            enum:
              - ending_soon
              - newest
              - overdue
            description: >-
              Event markets only. `ending_soon` (default): soonest scheduled
              close first. `newest`: most recently listed markets first.
              `overdue`: open markets past their scheduled end_date, oldest
              overdue first.
          required: false
          description: >-
            Event markets only. `ending_soon` (default): soonest scheduled close
            first. `newest`: most recently listed markets first. `overdue`: open
            markets past their scheduled end_date, oldest overdue first.
          name: sort
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Event markets only: when `"true"`, include Kalshi multivariate
              combo markets (KXMVE*) in listings. Defaults to `"false"`. Any
              combo ticker still resolves directly by id or symbol.
          required: false
          description: >-
            Event markets only: when `"true"`, include Kalshi multivariate combo
            markets (KXMVE*) in listings. Defaults to `"false"`. Any combo
            ticker still resolves directly by id or symbol.
          name: include_combos
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Event listings only. With true and no status, include every venue
              status and untradable markets; with status=closed, include only
              untradable markets. Requires an end window of at most 30 days,
              starting no more than 30 days ago. Omitted ends_after defaults to
              48 hours ago; omitted ends_before defaults to 30 days after
              ends_after. The default window is retained by the cursor. Does not
              apply to symbol lookups.
          required: false
          description: >-
            Event listings only. With true and no status, include every venue
            status and untradable markets; with status=closed, include only
            untradable markets. Requires an end window of at most 30 days,
            starting no more than 30 days ago. Omitted ends_after defaults to 48
            hours ago; omitted ends_before defaults to 30 days after ends_after.
            The default window is retained by the cursor. Does not apply to
            symbol lookups.
          name: include_closed
          in: query
        - schema:
            type: string
            enum:
              - open
              - closed
              - resolved
              - all
            description: >-
              `open`: tradable open markets. `closed`: closed, resolving or
              unopened markets. `resolved`: settled event markets (useful for
              backtesting/history). `all`: every status (event markets only).
          required: false
          description: >-
            `open`: tradable open markets. `closed`: closed, resolving or
            unopened markets. `resolved`: settled event markets (useful for
            backtesting/history). `all`: every status (event markets only).
          name: status
          in: query
        - schema:
            type: string
            format: date-time
            description: >-
              Only fixtures, or crypto windows, starting at or after this time.
              Defaults to 12 hours ago.
          required: false
          description: >-
            Only fixtures, or crypto windows, 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, or crypto windows, 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, or crypto windows, 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: string
            format: date-time
            description: >-
              Event markets only: only venue markets scheduled to close at or
              after this time. Defaults to 48 hours ago, so a market still
              trading after its scheduled close stays listed.
          required: false
          description: >-
            Event markets only: only venue markets scheduled to close at or
            after this time. Defaults to 48 hours ago, so a market still trading
            after its scheduled close stays listed.
          name: ends_after
          in: query
        - schema:
            type: string
            format: date-time
            description: >-
              Event markets only: only venue markets scheduled to close before
              this time. With include_closed=true, defaults to 30 days after
              ends_after and the window must be at most 30 days.
          required: false
          description: >-
            Event markets only: only venue markets scheduled to close before
            this time. With include_closed=true, defaults to 30 days after
            ends_after and the window must be at most 30 days.
          name: ends_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
            description: >-
              The `next_cursor` of the previous page. An event listing refuses a
              cursor issued for another `category`, `venue`, `search`,
              `ends_after`, `ends_before`, `include_closed` or closed-status
              filter.
          required: false
          description: >-
            The `next_cursor` of the previous page. An event listing refuses a
            cursor issued for another `category`, `venue`, `search`,
            `ends_after`, `ends_before`, `include_closed` or closed-status
            filter.
          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:
                              oneOf:
                                - type: object
                                  properties:
                                    kind:
                                      type: string
                                      enum:
                                        - sports
                                    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
                                        template:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            Canonical sports contract template, such
                                            as `sports.winner`, `sports.handicap`,
                                            `sports.total`, `sports.team_total` or
                                            `sports.player_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
                                        - template
                                        - label
                                        - period
                                        - subject
                                        - stat
                                        - line
                                    legs:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          venue:
                                            type: string
                                            enum:
                                              - kalshi
                                              - polymarket
                                              - polymarket_us
                                              - hyperliquid
                                              - lighter
                                          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.
                                          yes_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 YES outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          no_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 NO outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          lean_url:
                                            type: string
                                            format: uri
                                            description: >-
                                              Direct Lean web terminal link for this
                                              market leg and side.
                                          venue_url:
                                            type: string
                                            nullable: true
                                            format: uri
                                            description: >-
                                              External venue page URL (Kalshi,
                                              Polymarket, Polymarket US, Hyperliquid),
                                              when known.
                                          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.
                                              result:
                                                type: string
                                                nullable: true
                                                enum:
                                                  - won
                                                  - lost
                                                  - void
                                                description: >-
                                                  How the venue settled this leg's side
                                                  once `status` is `resolved`: `won` pays
                                                  $1 a share, `lost` pays nothing, `void`
                                                  pays the venue's void payout. Null until
                                                  then.
                                            required:
                                              - source
                                              - rules
                                              - end_date
                                              - url
                                              - result
                                            description: How this venue resolves its market.
                                          fees:
                                            type: object
                                            nullable: true
                                            properties:
                                              formula:
                                                type: string
                                                enum:
                                                  - price_curve
                                                  - flat
                                                  - 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. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              maker_rate:
                                                type: string
                                                pattern: ^\d+(?:\.\d+)?$
                                                description: >-
                                                  The rate, as a fraction of 1, a resting
                                                  order pays when it fills. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              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 when
                                              the venue's fee terms for the market are
                                              not recorded or depend on an account fee
                                              multiplier Lean cannot read (Lighter).
                                        required:
                                          - venue
                                          - ticker
                                          - side
                                          - status
                                          - tradable
                                          - yes_token
                                          - no_token
                                          - lean_url
                                          - venue_url
                                          - 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:
                                    - kind
                                    - id
                                    - title
                                    - outcome
                                    - line
                                    - fixture
                                    - group
                                    - legs
                                    - equivalence
                                - type: object
                                  properties:
                                    kind:
                                      type: string
                                      enum:
                                        - time_window
                                    id:
                                      type: string
                                      minLength: 1
                                    title:
                                      type: string
                                      minLength: 1
                                    outcome:
                                      type: string
                                      enum:
                                        - up
                                        - down
                                    line:
                                      nullable: true
                                    window:
                                      type: object
                                      properties:
                                        key:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            The window: underlying, length and UTC
                                            start, such as `btc:15m:20261117-0100`.
                                            Every venue market on the same window
                                            shares it.
                                        category:
                                          type: string
                                          enum:
                                            - crypto
                                        underlying:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            The asset whose price the window
                                            follows, such as `BTC`.
                                        duration_minutes:
                                          type: integer
                                          minimum: 0
                                          exclusiveMinimum: true
                                        proposition:
                                          type: string
                                          enum:
                                            - up_down
                                          description: >-
                                            `up_down`: `up` pays when the price at
                                            the window end is at or above the price
                                            at its start, as the venue resolution
                                            rules define them; `down` pays when it
                                            is below.
                                        starts_at:
                                          type: string
                                          format: date-time
                                        ends_at:
                                          type: string
                                          format: date-time
                                        title:
                                          type: string
                                          minLength: 1
                                      required:
                                        - key
                                        - category
                                        - underlying
                                        - duration_minutes
                                        - proposition
                                        - starts_at
                                        - ends_at
                                        - title
                                    legs:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          venue:
                                            type: string
                                            enum:
                                              - kalshi
                                              - polymarket
                                              - polymarket_us
                                              - hyperliquid
                                              - lighter
                                          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.
                                          yes_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 YES outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          no_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 NO outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          lean_url:
                                            type: string
                                            format: uri
                                            description: >-
                                              Direct Lean web terminal link for this
                                              market leg and side.
                                          venue_url:
                                            type: string
                                            nullable: true
                                            format: uri
                                            description: >-
                                              External venue page URL (Kalshi,
                                              Polymarket, Polymarket US, Hyperliquid),
                                              when known.
                                          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.
                                              result:
                                                type: string
                                                nullable: true
                                                enum:
                                                  - won
                                                  - lost
                                                  - void
                                                description: >-
                                                  How the venue settled this leg's side
                                                  once `status` is `resolved`: `won` pays
                                                  $1 a share, `lost` pays nothing, `void`
                                                  pays the venue's void payout. Null until
                                                  then.
                                            required:
                                              - source
                                              - rules
                                              - end_date
                                              - url
                                              - result
                                            description: How this venue resolves its market.
                                          fees:
                                            type: object
                                            nullable: true
                                            properties:
                                              formula:
                                                type: string
                                                enum:
                                                  - price_curve
                                                  - flat
                                                  - 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. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              maker_rate:
                                                type: string
                                                pattern: ^\d+(?:\.\d+)?$
                                                description: >-
                                                  The rate, as a fraction of 1, a resting
                                                  order pays when it fills. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              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 when
                                              the venue's fee terms for the market are
                                              not recorded or depend on an account fee
                                              multiplier Lean cannot read (Lighter).
                                        required:
                                          - venue
                                          - ticker
                                          - side
                                          - status
                                          - tradable
                                          - yes_token
                                          - no_token
                                          - lean_url
                                          - venue_url
                                          - 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:
                                    - kind
                                    - id
                                    - title
                                    - outcome
                                    - line
                                    - window
                                    - legs
                                    - equivalence
                                - type: object
                                  properties:
                                    kind:
                                      type: string
                                      enum:
                                        - event
                                    id:
                                      type: string
                                      minLength: 1
                                    title:
                                      type: string
                                      minLength: 1
                                    outcome:
                                      type: string
                                      enum:
                                        - 'yes'
                                        - 'no'
                                    line:
                                      nullable: true
                                    event:
                                      type: object
                                      properties:
                                        key:
                                          type: string
                                          minLength: 1
                                          description: >-
                                            The venue event the market belongs to,
                                            such as a Polymarket event's ticker.
                                        title:
                                          type: string
                                          minLength: 1
                                        category:
                                          type: string
                                          enum:
                                            - sports
                                            - crypto
                                            - politics
                                            - economy
                                            - business
                                            - entertainment
                                            - science
                                            - society
                                            - climate
                                            - commodities
                                            - transportation
                                            - gaming
                                            - health
                                            - law
                                            - uncategorized
                                          description: >-
                                            `crypto` for a coin-price market
                                            (Polymarket tagged `crypto-prices`, or
                                            `crypto` and `hit-price`; a Hyperliquid
                                            outcome tagged `asset:<coin>` for a
                                            Hyperliquid coin), whatever its
                                            taxonomy; otherwise the first root of
                                            the venue event's Lean taxonomy, else
                                            the category Kalshi files it under, else
                                            `uncategorized`.
                                        ends_at:
                                          type: string
                                          nullable: true
                                          format: date-time
                                          description: >-
                                            When the venue market is scheduled to
                                            close; null when the venue gives no
                                            date.
                                        created_at:
                                          type: string
                                          nullable: true
                                          format: date-time
                                          description: >-
                                            When the market was first listed on the
                                            venue or indexed by Lean.
                                        series_ticker:
                                          type: string
                                          nullable: true
                                          description: >-
                                            Recurring series identifier when the
                                            event belongs to a series; null
                                            otherwise.
                                        is_recurring:
                                          type: boolean
                                          description: >-
                                            True when the event belongs to a
                                            recurring series with prior or repeated
                                            iterations.
                                        recurrence:
                                          type: string
                                          nullable: true
                                          description: >-
                                            Recurrence cadence reported by the venue
                                            (e.g. daily, weekly, monthly), if known.
                                      required:
                                        - key
                                        - title
                                        - category
                                        - ends_at
                                        - created_at
                                        - series_ticker
                                        - is_recurring
                                        - recurrence
                                    legs:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          venue:
                                            type: string
                                            enum:
                                              - kalshi
                                              - polymarket
                                              - polymarket_us
                                              - hyperliquid
                                              - lighter
                                          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.
                                          yes_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 YES outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          no_token:
                                            type: string
                                            nullable: true
                                            description: >-
                                              On-chain Polymarket ERC1155 NO outcome
                                              token id; null on venues that do not use
                                              ERC1155 tokens or when not recorded.
                                          lean_url:
                                            type: string
                                            format: uri
                                            description: >-
                                              Direct Lean web terminal link for this
                                              market leg and side.
                                          venue_url:
                                            type: string
                                            nullable: true
                                            format: uri
                                            description: >-
                                              External venue page URL (Kalshi,
                                              Polymarket, Polymarket US, Hyperliquid),
                                              when known.
                                          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.
                                              result:
                                                type: string
                                                nullable: true
                                                enum:
                                                  - won
                                                  - lost
                                                  - void
                                                description: >-
                                                  How the venue settled this leg's side
                                                  once `status` is `resolved`: `won` pays
                                                  $1 a share, `lost` pays nothing, `void`
                                                  pays the venue's void payout. Null until
                                                  then.
                                            required:
                                              - source
                                              - rules
                                              - end_date
                                              - url
                                              - result
                                            description: How this venue resolves its market.
                                          fees:
                                            type: object
                                            nullable: true
                                            properties:
                                              formula:
                                                type: string
                                                enum:
                                                  - price_curve
                                                  - flat
                                                  - 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. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              maker_rate:
                                                type: string
                                                pattern: ^\d+(?:\.\d+)?$
                                                description: >-
                                                  The rate, as a fraction of 1, a resting
                                                  order pays when it fills. For
                                                  `notional_on_exit` (Hyperliquid) this is
                                                  the base volume tier's rate, an upper
                                                  bound: accounts on a discounted tier pay
                                                  less.
                                              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 when
                                              the venue's fee terms for the market are
                                              not recorded or depend on an account fee
                                              multiplier Lean cannot read (Lighter).
                                        required:
                                          - venue
                                          - ticker
                                          - side
                                          - status
                                          - tradable
                                          - yes_token
                                          - no_token
                                          - lean_url
                                          - venue_url
                                          - 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:
                                    - kind
                                    - id
                                    - title
                                    - outcome
                                    - line
                                    - event
                                    - 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.