openapi: 3.0.0
info:
  title: Kalshi Trade API Manual Endpoints
  version: 3.34.0
  description: Manually defined OpenAPI spec for endpoints being migrated to spec-first approach

servers:
  - url: https://external-api.kalshi.com/trade-api/v2
    description: Production Trade API server
  - url: https://api.elections.kalshi.com/trade-api/v2
    description: Production shared API server, also supported
  - url: https://external-api.demo.kalshi.co/trade-api/v2
    description: Demo Trade API server
  - url: https://demo-api.kalshi.co/trade-api/v2
    description: Demo shared API server, also supported

paths:
  /exchange/status:
    get:
      operationId: GetExchangeStatus
      summary: Get Exchange Status
      description: ' Endpoint for getting the exchange status.'
      tags:
        - exchange
      responses:
        '200':
          description: Exchange status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeStatus'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeStatus'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeStatus'
        '504':
          description: Gateway timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeStatus'

  /series/fee_changes:
    get:
      operationId: GetSeriesFeeChanges
      summary: Get Series Fee Changes
      tags:
        - exchange
      parameters:
        - name: series_ticker
          in: query
          required: false
          schema:
            type: string
          x-go-type-skip-optional-pointer: true
        - name: show_historical
          in: query
          required: false
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
      responses:
        '200':
          description: Series fee changes retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSeriesFeeChangesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /exchange/schedule:
    get:
      operationId: GetExchangeSchedule
      summary: Get Exchange Schedule
      description: ' Endpoint for getting the exchange schedule.'
      tags:
        - exchange
      responses:
        '200':
          description: Exchange schedule retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetExchangeScheduleResponse'
        '500':
          description: Internal server error

  /exchange/user_data_timestamp:
    get:
      operationId: GetUserDataTimestamp
      summary: Get User Data Timestamp
      description: ' There is typically a short delay before exchange events are reflected in the API endpoints. Whenever possible, combine API responses to PUT/POST/DELETE requests with WebSocket data to obtain the most accurate view of the exchange state. This endpoint provides an approximate indication of when the data from the following endpoints was last validated: GetBalance, GetOrder(s), GetFills, GetPositions'
      tags:
        - exchange
      responses:
        '200':
          description: User data timestamp retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserDataTimestampResponse'
        '500':
          description: Internal server error

  /series/{series_ticker}/markets/{ticker}/candlesticks:
    get:
      operationId: GetMarketCandlesticks
      summary: Get Market Candlesticks
      description: |
        Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
        Candlesticks for markets that settled before the historical cutoff are only available via `GET /historical/markets/{ticker}/candlesticks`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
      tags:
        - market
      parameters:
        - name: series_ticker
          in: path
          required: true
          description: Series ticker - the series that contains the target market
          schema:
            type: string
        - name: ticker
          in: path
          required: true
          description: Market ticker - unique identifier for the specific market
          schema:
            type: string
        - name: start_ts
          in: query
          required: true
          description: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
          schema:
            type: integer
            format: int64
        - name: end_ts
          in: query
          required: true
          description: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
          schema:
            type: integer
            format: int64
        - name: period_interval
          in: query
          required: true
          description: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
          schema:
            type: integer
            enum: [1, 60, 1440]
            x-enum-varnames:
              - GetMarketCandlesticksParamsPeriodIntervalN1
              - GetMarketCandlesticksParamsPeriodIntervalN60
              - GetMarketCandlesticksParamsPeriodIntervalN1440
          x-oapi-codegen-extra-tags:
            validate: "required,oneof=1 60 1440"
        - name: include_latest_before_start
          in: query
          required: false
          description: |
            If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
            1. Finding the most recent real candlestick before start_ts
            2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
            3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Candlesticks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketCandlesticksResponse'
        '400':
          description: Bad request
        '404':
          description: Not found
        '500':
          description: Internal server error

  /markets/trades:
    get:
      operationId: GetTrades
      summary: Get Trades
      description: |
        Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. Block trades are included in the response by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
      tags:
        - market
      parameters:
        - $ref: '#/components/parameters/MarketLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/IsBlockTradeQuery'
      responses:
        '200':
          description: Trades retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTradesResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error

  /markets/{ticker}/orderbook:
    get:
      operationId: GetMarketOrderbook
      summary: Get Market Orderbook
      description: ' Endpoint for getting the current order book for a specific market.  The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes.  Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.'
      tags:
        - market
      parameters:
        - $ref: '#/components/parameters/TickerPath'
        - name: depth
          in: query
          description: Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 100
            default: 0
          x-oapi-codegen-extra-tags:
            validate: omitempty,min=0,max=100
      responses:
        '200':
          description: Orderbook retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketOrderbookResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /markets/orderbooks:
    get:
      operationId: GetMarketOrderbooks
      summary: Get Multiple Market Orderbooks
      description: 'Endpoint for getting the current order books for multiple markets in a single request. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices. Returns one orderbook per requested market ticker.'
      tags:
        - market
      parameters:
        - name: tickers
          in: query
          required: true
          description: List of market tickers to fetch orderbooks for
          schema:
            type: array
            items:
              type: string
              maxLength: 200
            minItems: 1
            maxItems: 100
          style: form
          explode: true
          x-oapi-codegen-extra-tags:
            validate: required,min=1,max=100,dive,max=200
      responses:
        '200':
          description: Orderbooks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketOrderbooksResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /series/{series_ticker}:
    get:
      operationId: GetSeries
      summary: Get Series
      description: ' Endpoint for getting data about a specific series by its ticker.  A series represents a template for recurring events that follow the same format and rules (e.g., "Monthly Jobs Report", "Weekly Initial Jobless Claims", "Daily Weather in NYC"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.'
      tags:
        - market
      parameters:
        - name: series_ticker
          in: path
          required: true
          schema:
            type: string
          description: The ticker of the series to retrieve
        - name: include_volume
          in: query
          required: false
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
          description: If true, includes the total volume traded across all events in this series.
      responses:
        '200':
          description: Series retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSeriesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /series:
    get:
      operationId: GetSeriesList
      summary: Get Series List
      description: ' Endpoint for getting data about multiple series with specified filters.  A series represents a template for recurring events that follow the same format and rules (e.g., "Monthly Jobs Report", "Weekly Initial Jobless Claims", "Daily Weather in NYC"). This endpoint allows you to browse and discover available series templates by category.'
      tags:
        - market
      parameters:
        - name: category
          in: query
          required: false
          description: >-
            Return series whose `categories` list contains this value. A series can have more than one discovery category, so the `category` field of a returned series (its primary category) may differ from the filter value. Matching is exact and case-sensitive.
          schema:
            type: string
          x-go-type-skip-optional-pointer: true
        - name: tags
          in: query
          required: false
          schema:
            type: string
          x-go-type-skip-optional-pointer: true
        - name: include_product_metadata
          in: query
          required: false
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
        - name: include_volume
          in: query
          required: false
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
          description: If true, includes the total volume traded across all events in each series.
        - name: min_updated_ts
          in: query
          required: false
          description: Filter series with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Series list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSeriesListResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /markets:
    get:
      operationId: GetMarkets
      summary: Get Markets
      description: |
       Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status.
        - Only one `status` filter may be supplied at a time.
        - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters.

        | Compatible Timestamp Filters | Additional Status Filters| Extra Notes |
        |------------------------------|--------------------------|-------------|
        | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | |
        | min_close_ts, max_close_ts | `closed`, *empty* | |
        | min_settled_ts, max_settled_ts | `settled`, *empty* | |
        | min_updated_ts, max_updated_ts | *empty* | Incompatible with all filters besides `mve_filter=exclude`. May be combined with `series_ticker`, which requires `mve_filter=exclude` |

        Markets that settled before the historical cutoff are only available via `GET /historical/markets`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.

      tags:
        - market
      parameters:
        - $ref: '#/components/parameters/MarketLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/SeriesTickerQuery'
        - $ref: '#/components/parameters/MinCreatedTsQuery'
        - $ref: '#/components/parameters/MaxCreatedTsQuery'
        - $ref: '#/components/parameters/MinUpdatedTsQuery'
        - $ref: '#/components/parameters/MaxUpdatedTsQuery'
        - $ref: '#/components/parameters/MaxCloseTsQuery'
        - $ref: '#/components/parameters/MinCloseTsQuery'
        - $ref: '#/components/parameters/MinSettledTsQuery'
        - $ref: '#/components/parameters/MaxSettledTsQuery'
        - $ref: '#/components/parameters/MarketStatusQuery'
        - $ref: '#/components/parameters/TickersQuery'
        - $ref: '#/components/parameters/MveFilterQuery'
      responses:
        '200':
          description: Markets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /markets/{ticker}:
    get:
      operationId: GetMarket
      summary: Get Market
      description: ' Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., "Will candidate X win?"). Markets have yes/no positions, current prices, volume, and settlement rules.'
      tags:
        - market
      parameters:
        - $ref: '#/components/parameters/TickerPath'
      responses:
        '200':
          description: Market retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error

  /markets/candlesticks:
    get:
      operationId: BatchGetMarketCandlesticks
      summary: Batch Get Market Candlesticks
      description: |
        Endpoint for retrieving candlestick data for multiple markets.

        - Accepts up to 100 market tickers per request
        - Returns up to 10,000 candlesticks total across all markets
        - Returns candlesticks grouped by market_id
        - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter)
      tags:
        - market
      parameters:
        - name: market_tickers
          in: query
          required: true
          description: Comma-separated list of market tickers (maximum 100)
          schema:
            type: string
        - name: start_ts
          in: query
          required: true
          description: Start timestamp in Unix seconds
          schema:
            type: integer
            format: int64
        - name: end_ts
          in: query
          required: true
          description: End timestamp in Unix seconds
          schema:
            type: integer
            format: int64
        - name: period_interval
          in: query
          required: true
          description: Candlestick period interval in minutes
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: include_latest_before_start
          in: query
          required: false
          description: |
            If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
            1. Finding the most recent real candlestick before start_ts
            2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
            3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Market candlesticks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchGetMarketCandlesticksResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /series/{series_ticker}/events/{ticker}/candlesticks:
    get:
      operationId: GetMarketCandlesticksByEvent
      summary: Get Event Candlesticks
      description: ' End-point for returning aggregated data across all markets corresponding to an event.'
      tags:
        - events
      parameters:
        - name: ticker
          in: path
          required: true
          description: The event ticker
          schema:
            type: string
        - name: series_ticker
          in: path
          required: true
          description: The series ticker
          schema:
            type: string
        - name: start_ts
          in: query
          required: true
          description: Start timestamp for the range
          schema:
            type: integer
            format: int64
          x-oapi-codegen-extra-tags:
            validate: "required"
        - name: end_ts
          in: query
          required: true
          description: End timestamp for the range
          schema:
            type: integer
            format: int64
          x-oapi-codegen-extra-tags:
            validate: "required"
        - name: period_interval
          in: query
          required: true
          description: Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day.
          schema:
            type: integer
            format: int32
            enum: [1, 60, 1440]
          x-oapi-codegen-extra-tags:
            validate: "required,oneof=1 60 1440"
      responses:
        '200':
          description: Event candlesticks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventCandlesticksResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /events:
    get:
      operationId: GetEvents
      summary: Get Events
      description: |
        Get all events. This endpoint excludes multivariate events.
        To retrieve multivariate events, use the GET /events/multivariate endpoint.
        All events are accessible through this endpoint, even if their associated markets are older than the historical cutoff.
      tags:
        - events
      parameters:
        - name: limit
          in: query
          required: false
          description: Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 200
        - name: cursor
          in: query
          required: false
          description: Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
          schema:
            type: string
        - name: with_nested_markets
          in: query
          required: false
          description: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event. Historical markets settled before the historical cutoff will not be included.
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
        - name: with_milestones
          in: query
          required: false
          description: If true, includes related milestones as a field alongside events.
          schema:
            type: boolean
            default: false
          x-go-type-skip-optional-pointer: true
        - name: status
          in: query
          required: false
          description: Filter by event status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return events with any status.
          schema:
            type: string
            enum: ['unopened', 'open', 'closed', 'settled']
        - $ref: '#/components/parameters/SeriesTickerQuery'
        - $ref: '#/components/parameters/EventTickersQuery'
        - name: min_close_ts
          in: query
          required: false
          description: Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).
          schema:
            type: integer
            format: int64
        - name: min_updated_ts
          in: query
          required: false
          description: Filter events with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Events retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /events/multivariate:
    get:
      operationId: GetMultivariateEvents
      summary: Get Multivariate Events
      description: 'Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections. Supports filtering by series ticker, collection ticker, or a comma-separated list of event tickers.'
      tags:
        - events
      parameters:
        - name: limit
          in: query
          required: false
          description: Number of results per page. Defaults to 100. Maximum value is 200.
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 100
        - name: cursor
          in: query
          required: false
          description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.
          schema:
            type: string
        - $ref: '#/components/parameters/SeriesTickerQuery'
        - name: collection_ticker
          in: query
          required: false
          description: Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.
          schema:
            type: string
        - $ref: '#/components/parameters/EventTickersQuery'
        - name: with_nested_markets
          in: query
          required: false
          description: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Multivariate events retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMultivariateEventsResponse'
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /events/fee_changes:
    get:
      operationId: GetEventFeeChanges
      summary: Get Event Fee Changes
      description: |
        Event fees are an override layered on top of the parent series' fee structure. If `fee_type_override` and `fee_multiplier_override` are null, that indicates the override is cleared.
      tags:
        - events
      parameters:
        - name: event_ticker
          in: query
          required: false
          schema:
            type: string
          x-go-type-skip-optional-pointer: true
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Event fee changes retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventFeeChangesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /events/{event_ticker}:
    get:
      operationId: GetEvent
      summary: Get Event
      description: |
        Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release.
        Events contain one or more markets where users can place trades on different outcomes.
        All events are accessible through this endpoint, even if their associated markets are older than the historical cutoff.
      tags:
        - events
      parameters:
        - name: event_ticker
          in: path
          required: true
          description: Event ticker
          schema:
            type: string
        - name: exclude_markets
          in: query
          description: Return event metadata without loading child markets. Use GET /markets with event_ticker, limit and cursor for bounded market pages. Cannot be combined with with_nested_markets=true.
          required: false
          schema:
            type: boolean
            default: false
        - name: with_nested_markets
          in: query
          required: false
          description: If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response. Historical markets settled before the historical cutoff will not be included.
          schema:
            type: boolean
            default: false
            x-go-type-skip-optional-pointer: true
      responses:
        '200':
          description: Event retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventResponse'
        '400':
          description: Bad request
        '404':
          description: Event not found
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /events/{event_ticker}/metadata:
    get:
      operationId: GetEventMetadata
      summary: Get Event Metadata
      description: ' Endpoint for getting metadata about an event by its ticker.  Returns only the metadata information for an event.'
      tags:
        - events
      parameters:
        - name: event_ticker
          in: path
          required: true
          description: Event ticker
          schema:
            type: string
      responses:
        '200':
          description: Event metadata retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventMetadataResponse'
        '400':
          description: Bad request
        '404':
          description: Event not found
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /series/{series_ticker}/events/{ticker}/forecast_percentile_history:
    get:
      operationId: GetEventForecastPercentilesHistory
      summary: Get Event Forecast Percentile History
      description: Endpoint for getting the historical raw and formatted forecast numbers for an event at specific percentiles.
      tags:
        - events
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: ticker
          in: path
          required: true
          description: The event ticker
          schema:
            type: string
        - name: series_ticker
          in: path
          required: true
          description: The series ticker
          schema:
            type: string
        - name: percentiles
          in: query
          required: true
          description: Array of percentile values to retrieve (0-9999, max 10 values)
          schema:
            type: array
            items:
              type: integer
              format: int32
              minimum: 0
              maximum: 9999
            maxItems: 10
          style: form
          explode: true
        - name: start_ts
          in: query
          required: true
          description: Start timestamp for the range
          schema:
            type: integer
            format: int64
        - name: end_ts
          in: query
          required: true
          description: End timestamp for the range
          schema:
            type: integer
            format: int64
        - name: period_interval
          in: query
          required: true
          description: Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals.
          schema:
            type: integer
            format: int32
            enum: [0, 1, 60, 1440]
      responses:
        '200':
          description: Event forecast percentile history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventForecastPercentilesHistoryResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /portfolio/orders:
    get:
      operationId: GetOrders
      summary: Get Orders
      description: |
        Restricts the response to orders that have a certain status: resting, canceled, or executed.
        Orders that have been canceled or fully executed before the historical cutoff are only available via `GET /historical/orders`. Resting orders will always be available through this endpoint. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/MultipleEventTickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/StatusQuery'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
        - $ref: '#/components/parameters/ExchangeIndexFilterQuery'
      responses:
        '200':
          description: Orders retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrdersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/orders/{order_id}:
    get:
      operationId: GetOrder
      summary: Get Order
      description: ' Endpoint for getting a single order.'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderIdPath'
      responses:
        '200':
          description: Order retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/orders/queue_positions:
    get:
      operationId: GetOrderQueuePositions
      summary: Get Queue Positions for Orders
      description: ' Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that need to be matched before an order receives a partial or full match, determined using price-time priority.'
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: market_tickers
          in: query
          description: Comma-separated list of market tickers to filter by
          schema:
            type: string
        - name: event_ticker
          in: query
          description: Event ticker to filter by
          schema:
            type: string
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      responses:
        '200':
          description: Queue positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderQueuePositionsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/orders/{order_id}/queue_position:
    get:
      operationId: GetOrderQueuePosition
      summary: Get Order Queue Position
      description: ' Endpoint for getting an order''s queue position in the order book. This represents the amount of orders that need to be matched before this order receives a partial or full match. Queue position is determined using a price-time priority.'
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderIdPath'
      responses:
        '200':
          description: Queue position retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderQueuePositionResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/events/orders:
    post:
      operationId: CreateOrderV2
      summary: Create Order (V2)
      description: 'Endpoint for submitting event-market orders using the V2 request/response shape (single-book `bid`/`ask` side and fixed-point dollar prices). The legacy `/portfolio/orders` endpoint will be deprecated no earlier than May 6, 2026 — clients should migrate to this path.'
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderV2Request'
      responses:
        '201':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailableError'

    delete:
      operationId: CancelAllOrders
      summary: Cancel All Orders
      description: Cancels all resting event-market orders for the authenticated Direct member across every exchange shard. If `subaccount` is omitted, matching orders may come from any subaccount. If it is provided, only orders for that subaccount are eligible. Newly placed orders may also be cancelled during the minute after the request.
      x-mint:
        content: |
          <Note>
          **Rate limit:** 2 tokens per request, the same cost as cancelling one event-market order. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - orders
      parameters:
        - $ref: '#/components/parameters/SubaccountQuery'
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '204':
          description: All matching resting orders were cancelled
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/events/orders/batched:
    post:
      operationId: BatchCreateOrdersV2
      summary: Batch Create Orders (V2)
      description: 'Endpoint for submitting a batch of event-market orders using the V2 request/response shape. The maximum batch size scales with your tier''s write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 10 tokens per order in the batch — billed per item, so total cost for a batch of N orders is N × 10. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateOrdersV2Request'
      responses:
        '201':
          description: Batch order creation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateOrdersV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      operationId: BatchCancelOrdersV2
      summary: Batch Cancel Orders (V2)
      description: 'Endpoint for cancelling a batch of event-market orders using the V2 response shape. To auto-route a cancellation, provide its `market_ticker` and omit `exchange_index` or set it to `-1`. The maximum batch size scales with your tier''s write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).'
      x-mint:
        content: |
          <Warning>
          For auto-routing, each order must include `market_ticker`. An `order_id` alone cannot identify the exchange shard.
          </Warning>

          <Note>
          **Rate limit:** 2 tokens per order in the batch — billed per item, so total cost for a batch of N cancels is N × 2. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCancelOrdersV2Request'
      responses:
        '200':
          description: Batch order cancellation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancelOrdersV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/events/orders/{order_id}:
    delete:
      operationId: CancelOrderV2
      summary: Cancel Order (V2)
      description: 'Endpoint for cancelling event-market orders using the V2 response shape. To auto-route the cancellation, provide `market_ticker` and omit `exchange_index` or set it to `-1`. Returns `{order_id, client_order_id, reduced_by}` rather than a full order object.'
      x-mint:
        content: |
          <Warning>
          Auto-routing requires `market_ticker`. An `order_id` alone cannot identify the exchange shard.
          </Warning>

          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - name: exchange_index
          in: query
          description: Exchange shard index. If omitted, auto-routes when market_ticker is provided; otherwise defaults to 0. Use -1 to require auto-routing. The market_ticker parameter is required for auto-routing.
          schema:
            $ref: '#/components/schemas/ExchangeIndex'
        - name: market_ticker
          in: query
          description: Market ticker. Required for auto-routing when exchange_index is omitted or -1.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
      responses:
        '200':
          description: Order cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderV2Response'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/events/orders/{order_id}/amend:
    post:
      operationId: AmendOrderV2
      summary: Amend Order (V2)
      description: 'Endpoint for amending the price, max fillable count, and/or expiration time of an existing event-market order. The request `count` is the updated total/max fillable count, equal to already filled count plus desired resting remaining count. This behavior matches the v1 amend endpoints; only the request/response shape differs.'
      x-mint:
        content: |
          <Note>
          Amending only expiry or decreasing size preserves queue position. Increasing size or changing price forfeits queue position and places the order at the back of the queue.
          </Note>
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmendOrderV2Request'
      responses:
        '200':
          description: Order amended successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmendOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailableError'

  /portfolio/events/orders/{order_id}/decrease:
    post:
      operationId: DecreaseOrderV2
      summary: Decrease Order (V2)
      description: 'Endpoint for decreasing the remaining count of an existing event-market order using the V2 request/response shape. Exactly one of `reduce_by` or `reduce_to` must be provided.'
      tags:
        - orders
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecreaseOrderV2Request'
      responses:
        '200':
          description: Order decreased successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecreaseOrderV2Response'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups:
    get:
      operationId: GetOrderGroups
      summary: Get Order Groups
      description: ' Retrieves all order groups for the authenticated user.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Order groups retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderGroupsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups/create:
    post:
      operationId: CreateOrderGroup
      summary: Create Order Group
      description: ' Creates a new order group with a contracts limit measured over a rolling 15-second window. Users can have up to 100,000 order groups at a time. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderGroupRequest'
      responses:
        '201':
          description: Order group created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderGroupResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups/{order_group_id}:
    get:
      operationId: GetOrderGroup
      summary: Get Order Group
      description: ' Retrieves details for a single order group including all order IDs and auto-cancel status.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderGroupIdPath'
        - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Order group retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderGroupResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: DeleteOrderGroup
      summary: Delete Order Group
      description: ' Deletes an order group and cancels all orders within it. This permanently removes the group.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderGroupIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/ExchangeIndexQuery'
      responses:
        '200':
          description: Order group deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups/{order_group_id}/reset:
    put:
      operationId: ResetOrderGroup
      summary: Reset Order Group
      description: ' Resets the order group''s matched contracts counter to zero, allowing new orders to be placed again after the limit was hit.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderGroupIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/ExchangeIndexQuery'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyResponse'
      responses:
        '200':
          description: Order group reset successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups/{order_group_id}/trigger:
    put:
      operationId: TriggerOrderGroup
      summary: Trigger Order Group
      description: ' Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderGroupIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/ExchangeIndexQuery'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyResponse'
      responses:
        '200':
          description: Order group triggered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/order_groups/{order_group_id}/limit:
    put:
      operationId: UpdateOrderGroupLimit
      summary: Update Order Group Limit
      description: ' Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered.'
      tags:
        - order-groups
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/OrderGroupIdPath'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/ExchangeIndexQuery'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderGroupLimitRequest'
      responses:
        '200':
          description: Order group limit updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  # Portfolio endpoints
  /portfolio/balance:
    get:
      operationId: GetBalance
      summary: Get Balance
      description: |
        Returns the balance and portfolio value for a member. Both values include all exchange indexes unless `exchange_index` is provided. Pass `subaccount` to use a subaccount instead of the primary account. This endpoint also accepts API keys with the 'read::portfolio_balance' scope.

        **Rate limit:** this endpoint has its own bucket, separate from the Read budget. Basic and Advanced tiers may call it **1 time per second**; all higher tiers may call it **5 times per second**. The bucket holds one second of budget, so there is no burst. Calls to this endpoint do not draw down the Read budget, and other reads do not draw down this bucket. Balance only changes on fills, settlements and transfers, so react to those (for example the user fills websocket channel) instead of polling this endpoint.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - name: exchange_index
          in: query
          schema:
            $ref: '#/components/schemas/ExchangeIndex'
          description: 'Exchange index used to scope the balance and portfolio value. If omitted, both include all exchange indexes.'
      responses:
        '200':
          description: Balance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBalanceResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/intra_exchange_instance_transfer:
    post:
      operationId: IntraExchangeInstanceTransfer
      summary: Intra Account Transfer
      description: |
        Transfers funds within the same account.

        When `source_exchange_shard` and `destination_exchange_shard` are the same, Kalshi treats the request as a subaccount transfer. The returned transfer ID appears in the subaccount transfer history.

        Cross-exchange-index subaccount transfers run in up to three non-atomic steps. If a later step fails, completed steps are not undone, so funds may remain in the primary account on the source or destination exchange index.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntraExchangeInstanceTransferRequest'
      responses:
        '200':
          description: Transfer request accepted. The transfer is processed asynchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntraExchangeInstanceTransferResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/intra_exchange_instance_transfers:
    get:
      operationId: GetIntraExchangeInstanceTransfers
      summary: Get Intra Account Transfers
      description: 'Endpoint for fetching intra-exchange account transfer history.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/TransfersLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Transfers retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIntraExchangeInstanceTransfersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/intra_exchange_instance_transfers/{transfer_id}:
    get:
      operationId: GetIntraExchangeInstanceTransfer
      summary: Get Intra Account Transfer
      description: 'Endpoint for getting a single intra-account transfer by id.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: transfer_id
          in: path
          required: true
          description: Transfer id returned by creation endpoint
          schema:
            type: string
      responses:
        '200':
          description: The requested transfer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIntraExchangeInstanceTransferResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/subaccounts:
    post:
      operationId: CreateSubaccount
      summary: Create Subaccount
      description: 'Creates a new subaccount for the authenticated user. This endpoint is available to all users on the Advanced API tier and above. Subaccounts are numbered sequentially starting from 1. Maximum 63 numbered subaccounts per user (64 including the primary account).'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubaccountRequest'
      responses:
        '201':
          description: Subaccount created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubaccountResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/subaccounts/transfer:
    post:
      operationId: ApplySubaccountTransfer
      summary: Transfer Between Subaccounts
      description: 'Transfers funds between the authenticated user''s subaccounts. Use 0 for the primary account, or 1-63 for numbered subaccounts. Set exchange_index to apply the transfer on a specific exchange shard (defaults to 0).'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplySubaccountTransferRequest'
      responses:
        '200':
          description: Transfer completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplySubaccountTransferResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/subaccounts/balances:
    get:
      operationId: GetSubaccountBalances
      summary: Get All Subaccount Balances
      description: 'Gets balances for all subaccounts including the primary account.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Balances retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubaccountBalancesResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/subaccounts/transfers:
    get:
      operationId: GetSubaccountTransfers
      summary: Get Subaccount Transfers
      description: 'Gets a paginated list of all transfers between subaccounts for the authenticated user.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Transfers retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubaccountTransfersResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/subaccounts/netting:
    put:
      operationId: UpdateSubaccountNetting
      summary: Update Subaccount Netting
      description: 'Updates the netting enabled setting for a specific subaccount. Use 0 for the primary account, or 1-63 for numbered subaccounts.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubaccountNettingRequest'
      responses:
        '200':
          description: Netting setting updated successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      operationId: GetSubaccountNetting
      summary: Get Subaccount Netting
      description: 'Gets the netting enabled settings for all subaccounts.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Netting settings retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubaccountNettingResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/positions:
    get:
      operationId: GetPositions
      summary: Get Positions
      description: |
        Returns unsettled positions by default. Set `settlement_status=settled` to page through settled positions that are still in the live data set, or `settlement_status=all` for both live states. Positions already archived are available via `GET /historical/positions`.
        Settled and all-state positions are paginated by event ticker to keep large histories bounded. Cursors are specific to the selected settlement status.
        `count_filter` restricts positions to those with a non-zero position or total traded count.
        Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
        - kalshiOauthAccessToken: []
      parameters:
        - $ref: '#/components/parameters/PositionsCursorQuery'
        - $ref: '#/components/parameters/PositionsLimitQuery'
        - $ref: '#/components/parameters/CountFilterQuery'
        - $ref: '#/components/parameters/PositionSettlementStatusQuery'
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/ExchangeIndexFilterQuery'
      responses:
        '200':
          description: Positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPositionsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/settlements:
    get:
      operationId: GetSettlements
      summary: Get Settlements
      description: 'Returns settlement records still in the live data set. Archived positions are available via `GET /historical/positions`, which has different fields; this endpoint does not return archived settlement records.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Settlements retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSettlementsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/deposits:
    get:
      operationId: GetDeposits
      summary: Get Deposits
      description: 'Endpoint for getting the member''s deposit history.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/WithdrawalLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Deposits retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDepositsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/withdrawals:
    get:
      operationId: GetWithdrawals
      summary: Get Withdrawals
      description: 'Endpoint for getting the member''s withdrawal history.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/WithdrawalLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Withdrawals retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWithdrawalsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/summary/total_resting_order_value:
    get:
      operationId: GetPortfolioRestingOrderTotalValue
      summary: Get Total Resting Order Value
      description: ' Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you''re uncertain about this endpoint, it likely does not apply to you.'
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Total resting order value retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPortfolioRestingOrderTotalValueResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/fills:
    get:
      operationId: GetFills
      summary: Get Fills
      description: |
        Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
        Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope.
        Fills that occurred before the historical cutoff are only available via `GET /historical/fills`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
        - kalshiOauthAccessToken: []
      parameters:
        - name: ticker
          in: query
          description: Filter by market ticker. Accepts a comma-separated list of up to 100 market tickers.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - $ref: '#/components/parameters/OrderIdQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
        - $ref: '#/components/parameters/ExchangeIndexFilterQuery'
      responses:
        '200':
          description: Fills retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFillsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /communications/id:
    get:
      operationId: GetCommunicationsID
      summary: Get Communications ID
      description: ' Endpoint for getting the communications ID of the logged-in user.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Communications ID retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCommunicationsIDResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/block-trade-proposals:
    get:
      operationId: GetBlockTradeProposals
      summary: Get Block Trade Proposals
      description: ' Endpoint for getting block trade proposals visible to the authenticated user.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/MarketTickerQuery'
        - name: limit
          in: query
          description: Parameter to specify the number of results per page. Defaults to 100.
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
            default: 100
        - name: status
          in: query
          description: Filter block trade proposals by status
          schema:
            type: string
      responses:
        '200':
          description: Block trade proposals retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBlockTradeProposalsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      operationId: ProposeBlockTrade
      summary: Propose Block Trade
      description: ' Endpoint for creating a block trade proposal.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProposeBlockTradeRequest'
      responses:
        '201':
          description: Block trade proposal created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProposeBlockTradeResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/block-trade-proposals/{block_trade_proposal_id}/accept:
    post:
      operationId: AcceptBlockTradeProposal
      summary: Accept Block Trade Proposal
      description: ' Endpoint for accepting a block trade proposal.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: block_trade_proposal_id
          in: path
          required: true
          description: Block trade proposal ID
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptBlockTradeProposalRequest'
      responses:
        '204':
          description: Block trade proposal accepted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfqs:
    get:
      operationId: GetRFQs
      summary: Get RFQs
      description: >-
        List RFQs. Pass pagination cursors back unchanged. A malformed cursor or
        invalid creator_user_id UUID returns HTTP 400. Use user_filter=self to
        filter by the authenticated user.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/MarketTickerQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
        - name: limit
          in: query
          description: Parameter to specify the number of results per page. Defaults to 100.
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
            default: 100
        - name: status
          in: query
          description: Filter RFQs by status
          schema:
            type: string
        - name: creator_user_id
          in: query
          description: Filter RFQs by creator user UUID. Use user_filter=self for the authenticated user.
          deprecated: true
          schema:
            type: string
        - name: user_filter
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/UserFilter'
            x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "omitempty,oneof=self"
      responses:
        '200':
          description: RFQs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      operationId: CreateRFQ
      summary: Create RFQ
      description: ' Endpoint for creating a new RFQ. You can have a maximum of 100 open RFQs at a time.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRFQRequest'
      responses:
        '201':
          description: RFQ created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRFQResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfqs/{rfq_id}:
    get:
      operationId: GetRFQ
      summary: Get RFQ
      description: ' Endpoint for getting a single RFQ by id'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
      responses:
        '200':
          description: RFQ retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      operationId: DeleteRFQ
      summary: Delete RFQ
      description: ' Endpoint for deleting an RFQ by ID'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
      responses:
        '204':
          description: RFQ deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfqs/{rfq_id}/quotes/{quote_id}:
    get:
      operationId: GetRFQQuote
      summary: Get RFQ Quote
      description: ' Endpoint for getting a particular quote scoped to its RFQ.'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
        - $ref: '#/components/parameters/QuoteIdPath'
      responses:
        '200':
          description: Quote retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetQuoteResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      operationId: DeleteRFQQuote
      summary: Delete RFQ Quote
      description: ' Endpoint for deleting a quote scoped to its RFQ, which means it can no longer be accepted.'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
        - $ref: '#/components/parameters/QuoteIdPath'
      responses:
        '204':
          description: Quote deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfqs/{rfq_id}/quotes/{quote_id}/accept:
    put:
      operationId: AcceptRFQQuote
      summary: Accept RFQ Quote
      description: ' Endpoint for accepting a quote scoped to its RFQ. This will require the quoter to confirm.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
        - $ref: '#/components/parameters/QuoteIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptQuoteRequest'
      responses:
        '204':
          description: Quote accepted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfqs/{rfq_id}/quotes/{quote_id}/confirm:
    put:
      operationId: ConfirmRFQQuote
      summary: Confirm RFQ Quote
      description: ' Endpoint for confirming a quote scoped to its RFQ. This will start a timer for order execution.'
      x-mint:
        content: |
          <Note>
          Rate limits are more favorable when providing the RFQ ID.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqIdPath'
        - $ref: '#/components/parameters/QuoteIdPath'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyResponse'
      responses:
        '204':
          description: Quote confirmed successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches:
    get:
      operationId: GetRFQBatches
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Get RFQ Batches
      description: >-
        List RFQ batches, most recently updated first, each with its child RFQs
        in request order. A page holds at most limit batches and stops before
        its child RFQs would exceed 100; a batch is never split across pages.
        Pass pagination cursors back unchanged; a malformed cursor returns
        HTTP 400. Use user_filter=self to list only your own batches.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
        - name: limit
          in: query
          description: Maximum number of batches per page. Defaults to 20. A page also stops before its child RFQs would exceed 100.
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 20
            default: 20
        - name: status
          in: query
          description: Filter RFQ batches by status
          schema:
            $ref: '#/components/schemas/RFQBatchStatus'
        - name: user_filter
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/UserFilter'
            x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "omitempty,oneof=self"
      responses:
        '200':
          description: RFQ batches retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQBatchesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      operationId: CreateRFQBatch
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Create RFQ Batch
      description: >-
        Request quotes on several combos at once, for example every parlay of a
        round robin. Each child is an ordinary RFQ on one combo market. Makers
        quote the whole batch, but each child is accepted from whichever maker
        quotes it best on your side, so the batch may fill from several makers.
        Accepting fills every child or none, and each child then executes as its
        own trade. Name each child's combo by its market ticker, or by its legs
        to look up or create the combo in mve_collection_ticker. Every child is
        sized the same way.
      x-mint:
        content: |
          <Note>
          A batch has 2 to 57 child RFQs drawn from at most 6 distinct legs, all
          combos on one exchange index. You can have at most 2 open RFQ
          batches (a batch being confirmed or executed no longer counts); with
          replace_existing, creating a batch closes your oldest open batch
          instead of failing.
          RFQ batches and single RFQs do not count against each other's limits.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRFQBatchRequest'
      responses:
        '201':
          description: RFQ batch created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRFQBatchResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}:
    get:
      operationId: GetRFQBatch
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Get RFQ Batch
      description: ' Endpoint for getting a single RFQ batch, with its child RFQs in request order.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      responses:
        '200':
          description: RFQ batch retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQBatchResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      operationId: DeleteRFQBatch
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Delete RFQ Batch
      description: >-
        Close an RFQ batch and all of its child RFQs. Open batch quotes on it
        are cancelled. An accepted batch can no longer be closed: it executes
        or expires as a unit.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      responses:
        '204':
          description: RFQ batch deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}/best_quotes:
    get:
      operationId: GetRFQBatchBestQuotes
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Get RFQ Batch Best Quotes
      description: >-
        Get the best open bid on each side of every child of your RFQ batch,
        across makers. Accepting the batch fills at these prices. Makers are not
        identified. Only the batch creator can read the best quotes, and a batch
        that is no longer open has none.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      responses:
        '200':
          description: Best quotes retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQBatchBestQuotesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}/accept:
    put:
      operationId: AcceptRFQBatch
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Accept RFQ Batch
      description: >-
        Accept every child RFQ of your RFQ batch on one side, each from the
        maker quoting it best on that side. Either every child is accepted or
        none is, and your balance must cover all of them. min_bids protects your
        price: give every child the best bid you were shown. If a child's best
        bid is now worse, the accept fails with rfq_batch_quotes_changed and
        lists that child; a better bid fills at the better price. Each winning
        maker then confirms its children. They execute once every winner has
        confirmed, and a missed confirmation closes the whole batch. An accepted
        batch cannot be cancelled.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptRFQBatchRequest'
      responses:
        '200':
          description: RFQ batch accepted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptRFQBatchResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}/quotes:
    get:
      operationId: GetRFQBatchQuotes
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Get RFQ Batch Quotes
      description: >-
        List the batch quotes on an RFQ batch that are visible to you. A maker
        sees its own batch quote; once the batch is accepted, it lists only the
        children that maker won. Once the batch is accepted, the batch creator
        sees each winning maker's batch quote on the children it won. While the
        batch is open, the creator reads the best quotes across makers with Get
        RFQ Batch Best Quotes instead.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      responses:
        '200':
          description: Batch quotes retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRFQBatchQuotesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      operationId: CreateRFQBatchQuote
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Create RFQ Batch Quote
      description: >-
        Quote every child RFQ of an RFQ batch, each exactly once. Each child is
        accepted from the maker bidding best on the requester's side, with ties
        going to the earliest bid, so you may win some children and not others;
        you then confirm the children you won. A new batch quote replaces your
        previous one on the same batch, and a child resent at an unchanged price
        keeps its time priority. A batch quote can win children only within 30
        seconds of when you last sent it, so resend it to stay eligible.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRFQBatchQuoteRequest'
      responses:
        '201':
          description: Batch quote created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRFQBatchQuoteResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}/quotes/{batch_quote_id}:
    delete:
      operationId: DeleteRFQBatchQuote
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Delete RFQ Batch Quote
      description: ' Endpoint for withdrawing one of your open batch quotes, which means it can no longer be accepted.'
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
        - $ref: '#/components/parameters/BatchQuoteIdPath'
      responses:
        '204':
          description: Batch quote deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/rfq_batches/{rfq_batch_id}/quotes/{batch_quote_id}/confirm:
    put:
      operationId: ConfirmRFQBatchQuote
      # Hidden from the published docs until RFQ batches launch.
      x-excluded: true
      summary: Confirm RFQ Batch Quote
      description: >-
        Confirm the children your batch quote won, all at once. Nothing executes
        until every winning maker of the batch has confirmed; the last
        confirmation starts the execution timer for every child, and each child
        executes as its own trade. If any winner misses the confirmation
        deadline, the whole batch closes without trading.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/RfqBatchIdPath'
        - $ref: '#/components/parameters/BatchQuoteIdPath'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyResponse'
      responses:
        '204':
          description: Batch quote confirmed successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/quotes:
    get:
      operationId: GetQuotes
      summary: Get Quotes
      description: >-
        List quotes. The rfq_id filter requires an RFQ UUID. Pass pagination
        cursors back unchanged; malformed RFQ IDs or cursors return HTTP 400.
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/CursorQuery'
        - name: min_ts
          in: query
          description: Restricts the response to quotes last updated after a timestamp, formatted as a Unix Timestamp
          schema:
            type: integer
            format: int64
        - name: max_ts
          in: query
          description: Restricts the response to quotes last updated before a timestamp, formatted as a Unix Timestamp
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: Parameter to specify the number of results per page. Defaults to 500.
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 500
            default: 500
        - name: status
          in: query
          description: Filter quotes by status
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: quote_creator_user_id
          in: query
          description: Filter quotes by quote creator user ID
          deprecated: true
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: user_filter
          in: query
          required: false
          description: Filter for quotes created by the authenticated user.
          schema:
            $ref: '#/components/schemas/UserFilter'
            x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "omitempty,oneof=self"
        - name: rfq_user_filter
          in: query
          required: false
          description: Filter for quotes responding to RFQs created by the authenticated user.
          schema:
            $ref: '#/components/schemas/UserFilter'
            x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "omitempty,oneof=self"
        - name: rfq_creator_user_id
          in: query
          description: Filter quotes by RFQ creator user ID
          deprecated: true
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: rfq_creator_subtrader_id
          in: query
          description: Filter quotes by RFQ creator subtrader ID (FCM members only)
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: rfq_id
          in: query
          description: Filter quotes by RFQ UUID. Pass the RFQ ID unchanged; malformed IDs return HTTP 400.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
      responses:
        '200':
          description: Quotes retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetQuotesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    post:
      operationId: CreateQuote
      summary: Create Quote
      description: ' Endpoint for creating a quote in response to an RFQ'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuoteRequest'
      responses:
        '201':
          description: Quote created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateQuoteResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/quotes/{quote_id}:
    get:
      operationId: GetQuote
      summary: Get Quote
      deprecated: true
      description: 'DEPRECATED: Use GET /communications/rfqs/{rfq_id}/quotes/{quote_id} instead. Endpoint for getting a particular quote.'
      x-mint:
        content: |
          <Warning>
          This endpoint is deprecated. Use `GET /communications/rfqs/{rfq_id}/quotes/{quote_id}` instead.
          </Warning>

          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/QuoteIdPath'
      responses:
        '200':
          description: Quote retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetQuoteResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

    delete:
      operationId: DeleteQuote
      summary: Delete Quote
      deprecated: true
      description: 'DEPRECATED: Use DELETE /communications/rfqs/{rfq_id}/quotes/{quote_id} instead. Endpoint for deleting a quote, which means it can no longer be accepted.'
      x-mint:
        content: |
          <Warning>
          This endpoint is deprecated. Use `DELETE /communications/rfqs/{rfq_id}/quotes/{quote_id}` instead.
          </Warning>

          <Note>
          **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/QuoteIdPath'
      responses:
        '204':
          description: Quote deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/quotes/{quote_id}/accept:
    put:
      operationId: AcceptQuote
      summary: Accept Quote
      deprecated: true
      description: 'DEPRECATED: Use PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/accept instead. Endpoint for accepting a quote. This will require the quoter to confirm.'
      x-mint:
        content: |
          <Warning>
          This endpoint is deprecated. Use `PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/accept` instead.
          </Warning>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/QuoteIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptQuoteRequest'
      responses:
        '204':
          description: Quote accepted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /communications/quotes/{quote_id}/confirm:
    put:
      operationId: ConfirmQuote
      summary: Confirm Quote
      deprecated: true
      description: 'DEPRECATED: Use PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/confirm instead. Endpoint for confirming a quote. This will start a timer for order execution.'
      x-mint:
        content: |
          <Warning>
          This endpoint is deprecated. Use `PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/confirm` instead.
          </Warning>

          <Note>
          Rate limits are more favorable when providing the RFQ ID.
          </Note>
      tags:
        - communications
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/QuoteIdPath'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyResponse'
      responses:
        '204':
          description: Quote confirmed successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  # Multivariate Event Collections endpoints
  /api_keys:
    get:
      operationId: GetApiKeys
      summary: Get API Keys
      description: ' Endpoint for retrieving all API keys associated with the authenticated user.  API keys allow programmatic access to the platform without requiring username/password authentication. Each key has a unique identifier and name.'
      tags:
        - api-keys
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: fcm_subtrader_id
          in: query
          required: false
          description: 'Return only API keys bound to this FCM subtrader. Spelled {your_user_id}_{suffix}; only FCM members hold bound keys. Omit to return every key.'
          schema:
            type: string
      responses:
        '200':
          description: List of API keys retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApiKeysResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

    post:
      operationId: CreateApiKey
      summary: Create API Key
      description: ' Endpoint for creating a new API key with a user-provided public key.  This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA or Ed25519 public key in PEM format. The platform will use this public key to verify signatures on API requests: RSA-PSS with SHA-256 for RSA keys, Ed25519 for Ed25519 keys.'
      tags:
        - api-keys
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponse'
        '400':
          description: Bad request - invalid input
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - insufficient API usage level, or fcm_subtrader_id from a non-FCM caller
        '409':
          description: Conflict - the bound FCM subtrader is not yet visible in the credential registry; retry after the subtrader create propagates
        '500':
          description: Internal server error

  /api_keys/generate:
    post:
      operationId: GenerateApiKey
      summary: Generate API Key
      description: ' Endpoint for generating a new API key with an automatically created key pair.  This endpoint generates a key pair of the requested key_type (RSA when omitted). The public key is stored on the platform, while the private key is returned to the user and must be stored securely. The private key cannot be retrieved again.'
      tags:
        - api-keys
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateApiKeyRequest'
      responses:
        '201':
          description: API key generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateApiKeyResponse'
        '400':
          description: Bad request - invalid input
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - fcm_subtrader_id requires an FCM member caller
        '409':
          description: Conflict - the bound FCM subtrader is not yet visible in the credential registry; retry after the subtrader create propagates
        '500':
          description: Internal server error

  /api_keys/{api_key}:
    delete:
      operationId: DeleteApiKey
      summary: Delete API Key
      description: ' Endpoint for deleting an existing API key.  This endpoint permanently deletes an API key. Once deleted, the key can no longer be used for authentication. This action cannot be undone.'
      tags:
        - api-keys
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: api_key
          in: path
          required: true
          description: API key ID to delete
          schema:
            type: string
      responses:
        '204':
          description: API key successfully deleted
        '400':
          description: Bad request - invalid API key ID
        '401':
          description: Unauthorized
        '404':
          description: API key not found
        '500':
          description: Internal server error

  /account/limits:
    get:
      operationId: GetAccountApiLimits
      summary: Get Account API Limits
      description: 'Endpoint to retrieve the authenticated user''s Predictions API usage tier and token-bucket limits. Public Predictions tiers include Basic, Advanced, Expert, Premier, Paragon, Prime, and Prestige.'
      tags:
        - account
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Account API tier limits retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountApiLimitsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /account/api_usage_level/upgrade:
    post:
      operationId: UpgradeAccountApiUsageLevel
      summary: Upgrade Account API Usage Level
      description: 'Grants a permanent Advanced API usage-level grant. Currently only the Predictions exchange instance is supported. Criteria: at least 1 of the user''s last 100 Predictions orders was created via API. Use Get Account API Limits to inspect the resulting usage tier and grants.'
      x-mint:
        content: |
          <Note>
          **Rate limit:** 30 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
          </Note>
      tags:
        - account
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '201':
          description: Advanced API usage-level grant created or refreshed successfully
        '401':
          description: Unauthorized
        '403':
          description: No API-created order was found in the user's latest 100 Predictions orders
        '429':
          description: Rate limit exceeded. This endpoint costs 30 tokens and uses the Predictions Write bucket.
        '500':
          description: Internal server error

  /account/api_usage_level/volume_progress:
    get:
      operationId: GetAccountApiUsageLevelVolumeProgress
      summary: Get Account API Usage Level Volume Progress
      description: 'Returns the authenticated user''s latest cron-computed trading volume progress toward volume-based API usage tiers for the predictions (event_contract) lane. Volume figures are reported as fixed-point contract counts.'
      tags:
        - account
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Account API usage level volume progress retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountApiUsageLevelVolumeProgressResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /account/endpoint_costs:
    get:
      operationId: GetAccountEndpointCosts
      summary: List Non-Default Endpoint Costs
      description: 'Lists API v2 endpoints whose configured token cost differs from the default cost. Endpoints that use the default cost are omitted.'
      tags:
        - account
      responses:
        '200':
          description: Non-default endpoint costs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountEndpointCostsResponse'
        '500':
          description: Internal server error

  /search/tags_by_categories:
    get:
      operationId: GetTagsForSeriesCategories
      summary: Get Tags for Series Categories
      description: |
        Retrieve tags organized by series categories.

        This endpoint returns a mapping of series categories to their associated tags, which can be used for filtering and search functionality.
      tags:
        - search
      responses:
        '200':
          description: Tags retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTagsForSeriesCategoriesResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /search/filters_by_sport:
    get:
      operationId: GetFiltersForSports
      summary: Get Filters for Sports
      description: |
        Retrieve available filters organized by sport.

        This endpoint returns filtering options available for each sport, including scopes and competitions. It also provides an ordered list of sports for display purposes.
      tags:
        - search
      responses:
        '200':
          description: Filters retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFiltersBySportsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /live_data/milestone/{milestone_id}:
    get:
      operationId: GetLiveDataByMilestone
      summary: Get Live Data
      description: >-
        Get live data for a specific milestone.
        The response's `live_data.details.status` is updated far more often than the milestone's own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `live_data.details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current.
      tags:
        - live-data
      parameters:
        - name: milestone_id
          in: path
          required: true
          description: Milestone ID
          schema:
            type: string
        - name: include_player_stats
          in: query
          required: false
          description: >-
            When true, includes player-level statistics in the live data response.
            Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
            Has no effect for other sports or milestones without player mappings.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Live data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLiveDataResponse'
        '404':
          description: Live data not found
        '500':
          description: Internal server error

  /live_data/{type}/milestone/{milestone_id}:
    get:
      operationId: GetLiveData
      summary: Get Live Data (with type)
      description: Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead.
      tags:
        - live-data
      parameters:
        - name: type
          in: path
          required: true
          description: Type of live data
          schema:
            type: string
        - name: milestone_id
          in: path
          required: true
          description: Milestone ID
          schema:
            type: string
        - name: include_player_stats
          in: query
          required: false
          description: >-
            When true, includes player-level statistics in the live data response.
            Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
            Has no effect for other sports or milestones without player mappings.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Live data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLiveDataResponse'
        '404':
          description: Live data not found
        '500':
          description: Internal server error

  /live_data/batch:
    get:
      operationId: GetLiveDatas
      summary: Get Multiple Live Data
      description: >-
        Get live data for multiple milestones.
        Each entry's `details.status` is updated far more often than the milestone's
        own `details.status` and is the preferred source for game status. It is not
        guaranteed to be current: if the provider feed falls behind, a cached board may
        still be served, with `details.live_data_delayed` set to `true` only once it is
        significantly stale (some feeds never set it), so a missing flag does not by
        itself mean the data is current.
      tags:
        - live-data
      parameters:
        - name: milestone_ids
          in: query
          required: true
          description: Array of milestone IDs
          schema:
            type: array
            items:
              type: string
            maxItems: 100
          style: form
          explode: true
        - name: include_player_stats
          in: query
          required: false
          description: >-
            When true, includes player-level statistics in the live data response.
            Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
            Has no effect for other sports or milestones without player mappings.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Live data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLiveDatasResponse'
        '500':
          description: Internal server error

  /live_data/milestone/{milestone_id}/game_stats:
    get:
      operationId: GetGameStats
      summary: Get Game Stats
      description: >-
        Get play-by-play game statistics for a specific milestone.
        Supported sports: Pro Football, College Football, Pro Basketball, College Men's Basketball, College Women's Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball.
        Returns null for unsupported milestone types or milestones without a Sportradar ID.
      tags:
        - live-data
      parameters:
        - name: milestone_id
          in: path
          required: true
          description: Milestone ID
          schema:
            type: string
      responses:
        '200':
          description: Game stats retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGameStatsResponse'
        '404':
          description: Game stats not found
        '500':
          description: Internal server error

  /live_data/events/{event_ticker}:
    get:
      operationId: GetEventLiveData
      summary: Get Event Live Data
      description: >-
        Get live data for an event by its event ticker. Serves event-keyed live
        data such as crypto price charts, commodity price timeseries, and
        weather observations. The `type` field in the response names the schema
        of the `details` object.
      tags:
        - live-data
      parameters:
        - name: event_ticker
          in: path
          required: true
          description: Event ticker
          schema:
            type: string
        - name: range
          in: query
          required: false
          description: >-
            Optional chart range hint (e.g. `15min`, `1h`, `1d`). When the
            underlying live data type supports it, restricts the returned
            timeseries to the requested window.
          schema:
            type: string
      responses:
        '200':
          description: Live data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventLiveDataResponse'
        '404':
          description: Live data not found
        '500':
          description: Internal server error


  /live_data/weather/{city}:
    get:
      operationId: GetWeatherIndex
      summary: Get Weather Index
      description: >-
        Get the Kalshi-computed city temperature index: the canonical
        minute-resolution series behind hourly temperature markets. City-keyed
        and independent of any event — the series exists whenever the city's
        index is configured. Values are Fahrenheit rounded to 0.01. Minutes
        where the index quorum failed carry no value and are never returned as
        points, so gaps in the series are real gaps. With `detailed=true` each
        point additionally carries every member station's reported reading and
        quality-control disposition — the pre-incorporation breakdown.
      tags:
        - live-data
      parameters:
        - name: city
          in: path
          required: true
          description: Index city ID (e.g. `miami`)
          schema:
            type: string
        - name: from
          in: query
          required: false
          description: >-
            Window start, unix milliseconds (inclusive). Defaults to `to`
            minus 24 hours. Must be paired with `to` unless `last_sec` is
            used.
          schema:
            type: integer
            format: int64
        - name: to
          in: query
          required: false
          description: Window end, unix milliseconds (inclusive). Defaults to now.
          schema:
            type: integer
            format: int64
        - name: last_sec
          in: query
          required: false
          description: >-
            Trailing window in seconds; equivalent to `from=now-last_sec`,
            `to=now`. Mutually exclusive with `from`/`to`.
          schema:
            type: integer
            format: int64
        - name: detailed
          in: query
          required: false
          description: Include per-station audit readings on every point.
          schema:
            type: boolean
      responses:
        '200':
          description: Weather index retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWeatherIndexResponse'
        '400':
          description: Unknown city or invalid window parameters
        '500':
          description: Internal server error


  /live_data/weather/{city}/calibrations:
    get:
      operationId: GetWeatherIndexCalibrations
      summary: Get Weather Index Calibrations
      description: >-
        Get a city's published weather-index configuration timeline: the
        launch configuration plus every weekly offset calibration and
        methodology update, ascending by effective time. Each record carries
        the station weights, station offsets (Celsius), and the city
        reference used to compute index values from the record's effective
        time until the next record — everything needed to reproduce published
        index values for minutes computed under that configuration version.
        Offsets are re-estimated weekly after each complete UTC week; weights
        never change through calibration. The timeline is append-only and
        complete: it is never trimmed.
      tags:
        - live-data
      parameters:
        - name: city
          in: path
          required: true
          description: Index city ID (e.g. `miami`)
          schema:
            type: string
      responses:
        '200':
          description: Calibration timeline retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWeatherIndexCalibrationsResponse'
        '400':
          description: Unknown city
        '500':
          description: Internal server error


  /structured_targets:
    get:
      operationId: GetStructuredTargets
      summary: Get Structured Targets
      description: 'Page size (min: 1, max: 2000)'
      tags:
        - structured-targets
      parameters:
        - name: ids
          in: query
          description: Filter by specific structured target IDs. Pass multiple IDs by repeating the parameter (e.g. `?ids=uuid1&ids=uuid2`).
          required: false
          schema:
            type: array
            maxItems: 2000
            items:
              type: string
          style: form
          explode: true
        - name: type
          in: query
          description: Filter by structured target type
          required: false
          schema:
            type: string
            example: basketball_player
        - name: competition
          in: query
          description: 'Filter by competition. Matches against the league, conference, division, or tour in the structured target details, or any entry in the details leagues array.'
          required: false
          schema:
            type: string
            example: NBA
        - name: page_size
          in: query
          description: Number of items per page (min 1, max 2000, default 100)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 2000
            default: 100
        - name: cursor
          in: query
          description: Pagination cursor
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Structured targets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStructuredTargetsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error

  /structured_targets/{structured_target_id}:
    get:
      operationId: GetStructuredTarget
      summary: Get Structured Target
      description: ' Endpoint for getting data about a specific structured target by its ID.'
      tags:
        - structured-targets
      parameters:
        - name: structured_target_id
          in: path
          required: true
          description: Structured target ID
          schema:
            type: string
      responses:
        '200':
          description: Structured target retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStructuredTargetResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error

  /milestones/{milestone_id}:
    get:
      operationId: GetMilestone
      summary: Get Milestone
      description: >-
        Endpoint for getting data about a specific milestone by its ID.
        The milestone's `details.status`, when present, is maintained by a periodic background job. It lags the game's live state and may be stale or inaccurate, for example remaining `live` after the game ends. For game status, prefer live data, which is updated far more often: `live_data.details.status` from `GET /live_data/milestone/{milestone_id}`, or each entry's `details.status` from `GET /live_data/batch`. Scores are in the sport-specific fields of that live data `details` object.
      tags:
        - milestone
      parameters:
        - name: milestone_id
          in: path
          required: true
          description: Milestone ID
          schema:
            type: string
      responses:
        '200':
          description: Milestone retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMilestoneResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Internal Server Error

  /milestones:
    get:
      operationId: GetMilestones
      summary: Get Milestones
      description: >-
        Endpoint for listing milestones.
        A milestone's `details.status`, when present, is maintained by a periodic background job. It lags the game's live state and may be stale or inaccurate, for example remaining `live` after the game ends. For game status, prefer live data, which is updated far more often: `live_data.details.status` from `GET /live_data/milestone/{milestone_id}`, or each entry's `details.status` from `GET /live_data/batch`. Scores are in the sport-specific fields of that live data `details` object.
      tags:
        - milestone
      parameters:
        - name: limit
          in: query
          description: Number of milestones to return per page
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 500
        - name: minimum_start_date
          in: query
          description: Minimum start date to filter milestones. Format RFC3339 timestamp
          required: false
          schema:
            type: string
            format: date-time
        - name: category
          in: query
          description: 'Filter by milestone category. E.g. Sports, Elections, Esports, Crypto.'
          required: false
          schema:
            type: string
            example: Sports
        - name: competition
          in: query
          description: 'Filter by competition. E.g. Pro Football, Pro Basketball (M), Pro Baseball, Pro Hockey, College Football.'
          required: false
          schema:
            type: string
            example: Pro Football
        - name: source_id
          in: query
          description: Filter by source id
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: 'Filter by milestone type. E.g. football_game, basketball_game, soccer_tournament_multi_leg, baseball_game, hockey_match, political_race.'
          required: false
          schema:
            type: string
            example: football_game
        - name: related_event_ticker
          in: query
          description: Filter by related event ticker
          required: false
          schema:
            type: string
        - name: cursor
          in: query
          description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results
          required: false
          schema:
            type: string
        - name: min_updated_ts
          in: query
          required: false
          description: Filter milestones with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Milestones retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMilestonesResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error

  # Communications endpoints
  /multivariate_event_collections/{collection_ticker}:
    get:
      operationId: GetMultivariateEventCollection
      summary: Get Multivariate Event Collection
      description: ' Endpoint for getting data about a multivariate event collection by its ticker.'
      tags:
        - multivariate
      parameters:
        - name: collection_ticker
          in: path
          required: true
          description: Collection ticker
          schema:
            type: string
      responses:
        '200':
          description: Collection retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMultivariateEventCollectionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: CreateMarketInMultivariateEventCollection
      summary: Create Market In Multivariate Event Collection
      description: 'Endpoint for creating an individual market in a multivariate event collection. This endpoint must be hit at least once before trading or looking up a market. Users are limited to 5000 creations per week.'
      tags:
        - multivariate
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: collection_ticker
          in: path
          required: true
          description: Collection ticker
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMarketInMultivariateEventCollectionRequest'
      responses:
        '200':
          description: Market created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateMarketInMultivariateEventCollectionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /multivariate_event_collections:
    get:
      operationId: GetMultivariateEventCollections
      summary: Get Multivariate Event Collections
      description: ' Endpoint for getting data about multivariate event collections.'
      tags:
        - multivariate
      parameters:
        - name: status
          in: query
          description: Only return collections of a certain status. Can be unopened, open, or closed.
          schema:
            type: string
            enum: [unopened, open, closed]
        - name: associated_event_ticker
          in: query
          description: Only return collections associated with a particular event ticker.
          schema:
            type: string
        - name: series_ticker
          in: query
          description: Only return collections with a particular series ticker.
          schema:
            type: string
        - name: limit
          in: query
          description: Specify the maximum number of results.
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 200
        - name: cursor
          in: query
          description: The Cursor represents a pointer to the next page of records in the pagination. This optional parameter, when filled, should be filled with the cursor string returned in a previous request to this end-point.
          schema:
            type: string
      responses:
        '200':
          description: Collections retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMultivariateEventCollectionsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /incentive_programs:
    get:
      operationId: GetIncentivePrograms
      summary: Get Incentives
      description: ' List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets.'
      tags:
        - incentive-programs
      parameters:
        - name: status
          in: query
          required: false
          description: 'Status filter. Can be "all", "active", "upcoming", "closed", or "paid_out". Default is "all".'
          schema:
            type: string
            enum: [all, active, upcoming, closed, paid_out]
        - name: type
          in: query
          required: false
          description: 'Type filter. Can be "all", "liquidity", "volume", "margin_maker_volume", or "margin_taker_volume". Default is "all".'
          schema:
            type: string
            enum: [all, liquidity, volume, margin_maker_volume, margin_taker_volume]
        - name: incentive_description
          in: query
          required: false
          description: Filter by exact incentive description.
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Number of results per page. Defaults to 100. Maximum value is 10000.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
        - name: cursor
          in: query
          required: false
          description: Cursor for pagination
          schema:
            type: string
      responses:
        '200':
          description: Incentive programs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIncentiveProgramsResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /fcm/fills:
    get:
      operationId: GetFCMFills
      summary: Get FCM Fills
      description: |
        Returns fills across the authenticated FCM's subtraders. Requires FCM member access.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Fills retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFcmFillsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - requires an unrestricted FCM member API key
        '500':
          description: Internal server error

  /fcm/orders:
    get:
      operationId: GetFCMOrders
      summary: Get FCM Orders
      description: |
        Endpoint for FCM members to get orders for their subtraders.
        This endpoint requires FCM member access level. At least one of `subtrader_id` or
        `client_order_ids` is required; supplying both returns only the orders matching both filters.
        API keys bound to a single FCM subtrader may also call this endpoint: `subtrader_id` may be
        omitted and defaults to the key's bound subtrader, and if supplied it must equal the bound
        subtrader or the request is rejected.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: subtrader_id
          in: query
          description: Restricts the response to orders for a specific subtrader (FCM members only). Required unless client_order_ids is supplied. For an API key bound to a subtrader, defaults to the bound subtrader when omitted and must equal it when supplied.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: client_order_ids
          in: query
          description: Client order IDs to filter by, as a comma-separated list (maximum 100). Only orders created within the last 24 hours are searched, and a min_ts earlier than that is raised to 24 hours ago. Client order IDs are only unique within a subtrader among live and recent orders, so a single ID can match orders across subtraders or across time. Required unless subtrader_id is supplied.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/TickerQuery'
        - name: min_ts
          in: query
          description: Restricts the response to orders after a timestamp, formatted as a Unix Timestamp
          schema:
            type: integer
            format: int64
        - name: max_ts
          in: query
          description: Restricts the response to orders before a timestamp, formatted as a Unix Timestamp
          schema:
            type: integer
            format: int64
        - name: status
          in: query
          description: Restricts the response to orders that have a certain status
          schema:
            type: string
            enum: [resting, canceled, executed]
        - name: limit
          in: query
          description: Parameter to specify the number of results per page. Defaults to 100
          schema:
            type: integer
            minimum: 1
            maximum: 1000
      responses:
        '200':
          description: Orders retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrdersResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - the API key is bound to a different FCM subtrader
        '404':
          description: Not found
        '500':
          description: Internal server error

  /fcm/subtraders:
    get:
      operationId: ListFCMSubtraders
      summary: List FCM Subtraders
      description: |
        Lists the authenticated FCM's event-contract subtraders, including accounts with
        no trades. Exchange metadata is asynchronous, so newly created accounts may not
        appear immediately. Trading block status includes firm-wide and Kalshi restrictions;
        fcm_trading_blocked identifies the FCM's own per-subtrader restriction.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Event-contract subtraders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFCMSubtradersResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: CreateFCMSubtrader
      summary: Create FCM Subtrader
      description: |
        Endpoint for FCM members to create a subtrader on the event-contract exchange. The
        subtrader is registered on every exchange shard that knows the FCM; a shard provisioned
        later registers it lazily on the subtrader's first order there. Re-creating an existing
        subtrader returns 409.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFCMSubtraderRequest'
      responses:
        '201':
          description: Subtrader created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateFCMSubtraderResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /fcm/subtraders/event_contract_daily_cap:
    get:
      operationId: GetFCMEventContractDailyCap
      summary: Get FCM Subtrader Event Contract Daily Cap
      description: |
        Returns the event-contract daily premium cap configured for an FCM member's subtrader,
        together with its live utilization. Executed utilization is the net premium deployed by
        fills today (sells and settlements credit back); resting and pending utilization reserve
        open and in-flight orders at their full worst-case cost plus fees. Executed utilization
        resets at midnight New York time on the returned cap date; resting and pending
        reservations persist for as long as their orders remain open, including across the reset.
        Returns 404 when the subtrader has no cap configured — in that state every order placed
        through the subtrader's bound API keys is rejected.
        API keys bound to a single FCM subtrader may also call this endpoint: `subtrader_id` may be
        omitted and defaults to the key's bound subtrader, and if supplied it must equal the bound
        subtrader or the request is rejected.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: subtrader_id
          in: query
          description: The subtrader whose daily cap should be returned. Must belong to the requesting FCM. Required unless the API key is bound to a subtrader, in which case it defaults to the bound subtrader when omitted and must equal it when supplied.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
      responses:
        '200':
          description: Daily cap retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFCMEventContractDailyCapResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      operationId: UpdateFCMEventContractDailyCap
      summary: Update FCM Subtrader Event Contract Daily Cap
      description: |
        Sets the event-contract daily premium cap for an FCM member's subtrader. The cap bounds
        the subtrader's net premium at risk per trading day. It is enforced on cap-reservation
        sessions — which every subtrader-bound API key uses — and is mandatory there: a subtrader
        with no cap cannot trade through its bound keys. Cap changes take effect immediately;
        existing resting orders are never cancelled by a cap change.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFCMEventContractDailyCapRequest'
      responses:
        '200':
          description: Daily cap updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: DeleteFCMEventContractDailyCap
      summary: Delete FCM Subtrader Event Contract Daily Cap
      description: |
        Removes the event-contract daily premium cap for an FCM member's subtrader. Removal
        closes the subtrader to new orders on cap-reservation sessions — every subtrader-bound
        API key — until a cap is set again. It does not stop orders your own unbound sessions
        submit on the subtrader's behalf; to stop the account entirely, block subtrader trading.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: subtrader_id
          in: query
          required: true
          description: The subtrader whose daily cap should be removed. Must belong to the requesting FCM.
          schema:
            type: string
      responses:
        '200':
          description: Daily cap deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /fcm/subtraders/blocked_categories:
    get:
      operationId: GetFCMSubtraderBlockedCategories
      summary: Get FCM Subtrader Blocked Categories
      description: |
        Returns the event categories an FCM member has blocked for one of its
        subtraders. The subtrader must belong to the requesting FCM. A subtrader
        with no blocks returns an empty list.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: subtrader_id
          in: query
          required: true
          description: The subtrader whose blocked categories should be returned. Must belong to the requesting FCM.
          schema:
            type: string
      responses:
        '200':
          description: Blocked categories retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFCMSubtraderBlockedCategoriesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      operationId: UpdateFCMSubtraderBlockedCategories
      summary: Update FCM Subtrader Blocked Categories
      description: |
        Adds one event category to, or removes one from, the set an FCM member
        has blocked for one of its subtraders. The subtrader must belong to the
        requesting FCM. Blocks apply prospectively: new orders the subtrader
        places through its bound API credentials are rejected in markets whose
        event belongs to a blocked category, while orders already resting are
        not cancelled. Returns the subtrader's full resulting blocked set.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFCMSubtraderBlockedCategoriesRequest'
      responses:
        '200':
          description: Blocked categories updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateFCMSubtraderBlockedCategoriesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /portfolio/target_balance_allocation:
    get:
      operationId: GetTargetBalanceAllocation
      summary: Get Target Balance Allocation
      description: |
        Retrieves the caller's target balance allocation across exchange indexes.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      responses:
        '200':
          description: Target balance allocation retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTargetBalanceAllocationResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: SetTargetBalanceAllocation
      summary: Set Target Balance Allocation
      description: |
        Replaces the caller's target balance allocation across exchange indexes.
        Percentages must total 100. Passing an empty allocations array disables automatic rebalancing.
      tags:
        - portfolio
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetTargetBalanceAllocationRequest'
      responses:
        '200':
          description: Target balance allocation updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /fcm/positions:
    get:
      operationId: GetFCMPositions
      summary: Get FCM Positions
      description: |
        Endpoint for FCM members to get market positions filtered by subtrader ID.
        This endpoint requires FCM member access level and allows filtering positions by subtrader ID.
        API keys bound to a single FCM subtrader may also call this endpoint: `subtrader_id` may be
        omitted and defaults to the key's bound subtrader, and if supplied it must equal the bound
        subtrader or the request is rejected.
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - name: subtrader_id
          in: query
          description: Restricts the response to positions for a specific subtrader (FCM members only). Required unless the API key is bound to a subtrader, in which case it defaults to the bound subtrader when omitted and must equal it when supplied.
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: ticker
          in: query
          description: Ticker of desired positions
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: event_ticker
          in: query
          description: Event ticker of desired positions
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - name: count_filter
          in: query
          description: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list
          schema:
            type: string
        - name: settlement_status
          in: query
          description: Settlement status of the markets to return. Defaults to unsettled
          schema:
            type: string
            enum: [all, unsettled, settled]
        - name: limit
          in: query
          description: Parameter to specify the number of results per page. Defaults to 100
          schema:
            type: integer
            minimum: 1
            maximum: 1000
        - name: cursor
          in: query
          description: The Cursor represents a pointer to the next page of records in the pagination
          schema:
            type: string
      responses:
        '200':
          description: Positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPositionsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - the API key is bound to a different FCM subtrader
        '404':
          description: Not found
        '500':
          description: Internal server error

  /fcm/positions/transfers:
    post:
      operationId: CreateFCMPositionTransfer
      summary: Create FCM Position Transfer
      description: |
        Endpoint for FCM members to move a position in one market from one of their subtraders into a
        subtrader under their FCM's error account.

        **This endpoint must be enabled for your FCM by Kalshi.** Kalshi enables it by configuring the
        error account that receives transferred positions and gives you that account's user id, which
        prefixes `target_subtrader_id`. Contact Kalshi to enable it; until then, requests return 400.

        - The destination is always your FCM's error account. `target_subtrader_id` picks the subtrader
          under it, which is created on first use.
        - Each request moves one market for one source subtrader. To move many positions, send one
          request per subtrader and market.
        - The transfer is booked like a trade at `price_centicents`, which is always the YES price, even
          when moving NO. No fee is charged and no fill is created. For YES, the error account pays the
          price per contract; for NO, it pays $1 minus the price per contract. The FCM receives the same
          amount. Use 0 for YES or 10000 for NO to move no cash. These amounts assume the source holds
          the side being moved and the target subtrader holds no opposite position in that market;
          otherwise the positions net like a trade and the balance changes differ.
        - The source's current position is not checked. A request for more than the source holds, or
          with the opposite sign, flips or grows the source's position.
        - Requests are not idempotent. After a timeout or 5xx, check the position before retrying.
        - The market must be open, neither account may be blocked, and the error account must have
          enough available balance on the market's exchange index to pay for the transfer. Otherwise
          the request returns 409.

        **Example: moving YES.** A customer subtrader holds 10 YES contracts. Send
        `position_centicount` 1000 and `price_centicents` 4500 (YES at 45 cents):
        - The customer subtrader goes from 10 YES to 0, and the error account subtrader from 0 to 10 YES.
        - The error account pays 10 x $0.45 = $4.50 and the FCM receives $4.50.
        - Sending `price_centicents` 0 instead moves the position with no cash.

        **Example: moving NO.** A customer subtrader holds 5 NO contracts. Send `position_centicount`
        -500 and `price_centicents` 7000 (YES at 70 cents, so NO at 30 cents):
        - The customer subtrader goes from 5 NO to 0, and the error account subtrader from 0 to 5 NO.
        - The error account pays 5 x $0.30 = $1.50 and the FCM receives $1.50.
        - Sending `price_centicents` 10000 instead moves the position with no cash. Sending 0 makes the
          error account pay the full $1 per contract ($5.00).
      tags:
        - fcm
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFCMPositionTransferRequest'
            examples:
              move_yes:
                summary: Move 10 YES at 45 cents
                value:
                  source_subtrader_id: 3f2a8c1e-5b7d-4e9a-8c6f-1d2b3a4e5f60_CUST123
                  target_subtrader_id: 9b8c7d6e-5f4a-4b3c-9d2e-1f0a9b8c7d6e_ERR1
                  market_ticker: KXEXAMPLE-26DEC31
                  position_centicount: 1000
                  price_centicents: 4500
              move_no:
                summary: Move 5 NO at 30 cents (YES price 70 cents)
                value:
                  source_subtrader_id: 3f2a8c1e-5b7d-4e9a-8c6f-1d2b3a4e5f60_CUST123
                  target_subtrader_id: 9b8c7d6e-5f4a-4b3c-9d2e-1f0a9b8c7d6e_ERR1
                  market_ticker: KXEXAMPLE-26DEC31
                  position_centicount: -500
                  price_centicents: 7000
      responses:
        '201':
          description: Position transferred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateFCMPositionTransferResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /historical/cutoff:
    get:
      operationId: GetHistoricalCutoff
      summary: Get Historical Cutoff Timestamps
      description: |
        Returns the archive's cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff.

        ## Cutoff fields
        - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`.
        - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`.
        - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`.
        - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`.
      tags:
        - historical
      responses:
        '200':
          description: Historical cutoff timestamps retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetHistoricalCutoffResponse'
        '500':
          description: Internal server error

  /historical/markets/{ticker}/candlesticks:
    get:
      operationId: GetMarketCandlesticksHistorical
      summary: Get Historical Market Candlesticks
      description: ' Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).'
      tags:
        - historical
      parameters:
        - name: ticker
          in: path
          required: true
          description: Market ticker - unique identifier for the specific market
          schema:
            type: string
        - name: start_ts
          in: query
          required: true
          description: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
          schema:
            type: integer
            format: int64
        - name: end_ts
          in: query
          required: true
          description: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
          schema:
            type: integer
            format: int64
        - name: period_interval
          in: query
          required: true
          description: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
          schema:
            type: integer
            enum: [1, 60, 1440]
          x-oapi-codegen-extra-tags:
            validate: "required,oneof=1 60 1440"
      responses:
        '200':
          description: Candlesticks retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketCandlesticksHistoricalResponse'
        '400':
          description: Bad request
        '404':
          description: Not found
        '500':
          description: Internal server error

  /historical/fills:
    get:
      operationId: GetFillsHistorical
      summary: Get Historical Fills
      description: |
        Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched.
        API keys restricted to a subaccount return only that subaccount's fills. If supplied, `subaccount` must match the key's restriction.
        Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope.
      tags:
        - historical
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
        - kalshiOauthAccessToken: []
      parameters:
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Fills retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFillsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          description: Internal server error

  /historical/orders:
    get:
      operationId: GetHistoricalOrders
      summary: Get Historical Orders
      description: |
        Endpoint for getting orders that have been archived to the historical database.
        API keys restricted to a subaccount return only that subaccount's orders. If supplied, `subaccount` must match the key's restriction.
      tags:
        - historical
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/SubaccountQuery'
      responses:
        '200':
          description: Historical orders retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrdersResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /historical/positions:
    get:
      operationId: GetHistoricalPositions
      summary: Get Historical Positions
      description: 'Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`.'
      tags:
        - historical
      security:
        - kalshiAccessKey: []
          kalshiAccessSignature: []
          kalshiAccessTimestamp: []
      parameters:
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/SubaccountQueryDefaultPrimary'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          description: Historical positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPositionsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /historical/trades:
    get:
      operationId: GetTradesHistorical
      summary: Get Historical Trades
      description: ' Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.'
      tags:
        - historical
      parameters:
        - $ref: '#/components/parameters/TickerQuery'
        - $ref: '#/components/parameters/MinTsQuery'
        - $ref: '#/components/parameters/MaxTsQuery'
        - $ref: '#/components/parameters/MarketLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/IsBlockTradeQuery'
      responses:
        '200':
          description: Historical trades retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTradesResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /historical/markets:
    get:
      operationId: GetHistoricalMarkets
      summary: Get Historical Markets
      description: |
        Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive.
      tags:
        - historical
      parameters:
        - $ref: '#/components/parameters/MarketLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
        - $ref: '#/components/parameters/TickersQuery'
        - $ref: '#/components/parameters/SingleEventTickerQuery'
        - $ref: '#/components/parameters/SeriesTickerQuery'
        - $ref: '#/components/parameters/MveHistoricalFilterQuery'
      responses:
        '200':
          description: Historical markets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /historical/markets/{ticker}:
    get:
      operationId: GetHistoricalMarket
      summary: Get Historical Market
      description: ' Endpoint for getting data about a specific market by its ticker from the historical database.'
      tags:
        - historical
      parameters:
        - $ref: '#/components/parameters/TickerPath'
      responses:
        '200':
          description: Historical market retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketResponse'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'

components:
  securitySchemes:
    kalshiOauthAccessToken:
      type: http
      scheme: bearer
      description: User OAuth access token with read::compliance_partner, issued to an explicitly authorized partner. Accepted only on current and historical fills and current portfolio positions endpoints; generic read and partner client-credentials tokens do not grant access.
    kalshiAccessKey:
      type: apiKey
      in: header
      name: KALSHI-ACCESS-KEY
      description: Your API key ID
    kalshiAccessSignature:
      type: apiKey
      in: header
      name: KALSHI-ACCESS-SIGNATURE
      description: Base64 signature of the pre-sign text (timestamp + method + path) made with the API key's algorithm - RSA-PSS with SHA-256 for RSA keys, Ed25519 for Ed25519 keys
    kalshiAccessTimestamp:
      type: apiKey
      in: header
      name: KALSHI-ACCESS-TIMESTAMP
      description: Request timestamp in milliseconds

  responses:
    BadRequestError:
      description: Bad request - invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Unauthorized - authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailableError:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenError:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ConflictError:
      description: Conflict - resource already exists or cannot be modified
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimitError:
      description: 'Rate limit exceeded. The default cost is 10 tokens per request. Use GET /trade-api/v2/account/endpoint_costs to list non-default endpoint costs.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

  parameters:
    LimitQuery:
      name: limit
      in: query
      description: Number of results per page. Defaults to 100.
      schema:
        type: integer
        format: int64
        minimum: 1
        maximum: 1000
        default: 100
        x-oapi-codegen-extra-tags:
          validate: "omitempty,min=1,max=1000"

    WithdrawalLimitQuery:
      name: limit
      in: query
      description: Number of results per page. Defaults to 100. Maximum value is 500.
      schema:
        type: integer
        format: int64
        minimum: 1
        maximum: 500
        default: 100
        x-oapi-codegen-extra-tags:
          validate: "omitempty,min=1,max=500"

    TransfersLimitQuery:
      name: limit
      in: query
      description: Number of results per page. Defaults to 100. Maximum value is 500.
      schema:
        type: integer
        format: int64
        minimum: 1
        maximum: 500
        default: 100
        x-go-type-skip-optional-pointer: true
        x-oapi-codegen-extra-tags:
          validate: "omitempty,min=1,max=500"

    MarketLimitQuery:
      name: limit
      in: query
      description: Number of results per page. Defaults to 100. Maximum value is 1000.
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 1000
        default: 100
        x-oapi-codegen-extra-tags:
          validate: omitempty,gte=0,lte=1000

    CursorQuery:
      name: cursor
      in: query
      description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    StatusQuery:
      name: status
      in: query
      description: Filter by status. Possible values depend on the endpoint.
      schema:
        type: string

    OrderGroupIdPath:
      name: order_group_id
      in: path
      required: true
      description: Order group ID
      schema:
        type: string

    RfqIdPath:
      name: rfq_id
      in: path
      required: true
      description: RFQ UUID returned when the RFQ was created. Pass it unchanged; malformed IDs return HTTP 400.
      schema:
        type: string

    QuoteIdPath:
      name: quote_id
      in: path
      required: true
      description: Quote UUID. Pass the ID exactly as received when the quote was created; malformed IDs return HTTP 400.
      schema:
        type: string

    RfqBatchIdPath:
      name: rfq_batch_id
      in: path
      required: true
      description: RFQ batch UUID returned when the batch was created. Pass it unchanged; malformed IDs return HTTP 400.
      schema:
        type: string

    BatchQuoteIdPath:
      name: batch_quote_id
      in: path
      required: true
      description: Batch quote UUID returned when the batch quote was created. Pass it unchanged; malformed IDs return HTTP 400.
      schema:
        type: string

    MarketTickerQuery:
      name: market_ticker
      in: query
      description: Filter by market ticker
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    TickerQuery:
      name: ticker
      in: query
      description: Filter by market ticker
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    IsBlockTradeQuery:
      name: is_block_trade
      in: query
      description: |
        Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades.
      schema:
        type: boolean

    SingleEventTickerQuery:
      name: event_ticker
      in: query
      description: Event ticker to filter by. Only a single event ticker is supported.
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    MultipleEventTickerQuery:
      name: event_ticker
      in: query
      description: Event tickers to filter by, as a comma-separated list (maximum 10).
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    PositionsCursorQuery:
      name: cursor
      in: query
      description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.
      schema:
        type: string

    PositionsLimitQuery:
      name: limit
      in: query
      description: Parameter to specify the number of results per page. Defaults to 100.
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 1000
        default: 100

    CountFilterQuery:
      name: count_filter
      in: query
      description: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded
      schema:
        type: string

    PositionSettlementStatusQuery:
      name: settlement_status
      in: query
      description: Return unsettled positions by default, settled positions that have not yet been archived, or all positions in the live data set.
      schema:
        type: string
        enum: [unsettled, settled, all]
        default: unsettled

    OrderIdQuery:
      name: order_id
      in: query
      description: Filter by order ID
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    MinTsQuery:
      name: min_ts
      in: query
      description: Filter items after this Unix timestamp
      schema:
        type: integer
        format: int64

    MaxTsQuery:
      name: max_ts
      in: query
      description: Filter items before this Unix timestamp
      schema:
        type: integer
        format: int64

    SubaccountQuery:
      name: subaccount
      in: query
      required: false
      description: Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts.
      schema:
        type: integer
        minimum: 0

    SubaccountQueryDefaultPrimary:
      name: subaccount
      in: query
      required: false
      description: Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount.
      schema:
        type: integer
        minimum: 0

    ExchangeIndexQuery:
      name: exchange_index
      in: query
      description: Identifier for an exchange shard. Defaults to 0.
      schema:
        $ref: '#/components/schemas/ExchangeIndex'
      x-go-type-skip-optional-pointer: true

    ExchangeIndexFilterQuery:
      name: exchange_index
      in: query
      description: Filter results by exchange shard. Omit to return results from all exchange shards.
      schema:
        type: integer
        format: int32
        minimum: 0
        x-oapi-codegen-extra-tags:
          validate: "omitempty,gte=0"

    OrderIdPath:
      name: order_id
      in: path
      required: true
      description: Order ID
      schema:
        type: string

    TickerPath:
      name: ticker
      in: path
      required: true
      description: Market ticker
      schema:
        type: string

    SeriesTickerQuery:
      name: series_ticker
      in: query
      description: Filter by series ticker
      schema:
        type: string
        x-go-type-skip-optional-pointer: true

    MinCreatedTsQuery:
      name: min_created_ts
      in: query
      description: Filter items that created after this Unix timestamp
      schema:
        type: integer
        format: int64

    MaxCreatedTsQuery:
      name: max_created_ts
      in: query
      description: Filter items that created before this Unix timestamp
      schema:
        type: integer
        format: int64

    MinUpdatedTsQuery:
      name: min_updated_ts
      in: query
      description: Return markets with metadata updated later than this Unix timestamp (in seconds). Tracks non-trading changes only. May be combined with max_updated_ts and mve_filter=exclude. May also be combined with series_ticker, which requires mve_filter=exclude. Incompatible with other filters.
      schema:
        type: integer
        format: int64

    MaxUpdatedTsQuery:
      name: max_updated_ts
      in: query
      description: Return markets with metadata updated at or before this Unix timestamp (in seconds). Tracks non-trading changes only. May be combined with min_updated_ts and mve_filter=exclude. May also be combined with series_ticker, which requires mve_filter=exclude. Incompatible with other filters.
      schema:
        type: integer
        format: int64

    MaxCloseTsQuery:
      name: max_close_ts
      in: query
      description: Filter items that close before this Unix timestamp
      schema:
        type: integer
        format: int64

    MinCloseTsQuery:
      name: min_close_ts
      in: query
      description: Filter items that close after this Unix timestamp
      schema:
        type: integer
        format: int64

    MinSettledTsQuery:
      name: min_settled_ts
      in: query
      description: Filter items that settled after this Unix timestamp
      schema:
        type: integer
        format: int64

    MaxSettledTsQuery:
      name: max_settled_ts
      in: query
      description: Filter items that settled before this Unix timestamp
      schema:
        type: integer
        format: int64

    MarketStatusQuery:
      name: status
      in: query
      description: Filter by market status. Leave empty to return markets with any status.
      schema:
        type: string
        enum: [unopened, open, paused, closed, settled]

    TickersQuery:
      name: tickers
      in: query
      description: Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
      schema:
        type: string

    EventTickersQuery:
      name: tickers
      in: query
      description: Filter by specific event tickers. Comma-separated list of event tickers to retrieve.
      schema:
        type: string

    MveFilterQuery:
      name: mve_filter
      in: query
      description: Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.
      schema:
        type: string
        enum: ['only', 'exclude']

    MveHistoricalFilterQuery:
      name: mve_filter
      in: query
      description: Filter by multivariate events (combos). By default, MVE markets are included.
      schema:
        type: string
        enum: ['exclude']
        nullable: true
        default: null

  schemas:
    # Common schemas
    FixedPointDollars:
      type: string
      description: Fixed-point US dollar string. Most request fields accept 2-4 decimal places (e.g., "0.56", "0.5600"); responses emit up to 6. Valid quote intervals for a given market are constrained by that market's price level structure.
      example: "0.5600"

    FixedPointCount:
      type: string
      description: Fixed-point contract count string (2 decimals, e.g., "10.00"; referred to as "fp" in field names). Requests accept 0-2 decimal places (e.g., "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional contract values (e.g., "2.50") are supported; the minimum granularity is 0.01 contracts.
      example: "10.00"

    ExchangeIndex:
      type: integer
      description: "Identifier for an exchange shard."
      example: 0

    FeeType:
      type: string
      enum: [quadratic, quadratic_with_maker_fees, quadratic_with_combo_maker_fees, flat]
      x-enum-varnames:
        - FeeTypeQuadratic
        - FeeTypeQuadraticWithMakerFees
        - FeeTypeQuadraticWithComboMakerFees
        - FeeTypeFlat
      description: Fee type for a series or scheduled fee override.

    GetMarketCandlesticksHistoricalResponse:
      type: object
      required:
        - ticker
        - candlesticks
      properties:
        ticker:
          type: string
          description: Unique identifier for the market.
        candlesticks:
          type: array
          description: Array of candlestick data points for the specified time range.
          items:
            $ref: '#/components/schemas/MarketCandlestickHistorical'

    MarketCandlestickHistorical:
      type: object
      required:
        - end_period_ts
        - yes_bid
        - yes_ask
        - price
        - volume
        - open_interest
      properties:
        end_period_ts:
          type: integer
          format: int64
          description: Unix timestamp for the inclusive end of the candlestick period.
        yes_bid:
          $ref: '#/components/schemas/BidAskDistributionHistorical'
          description: Open, high, low, close (OHLC) data for YES buy offers on the market during the candlestick period.
        yes_ask:
          $ref: '#/components/schemas/BidAskDistributionHistorical'
          description: Open, high, low, close (OHLC) data for YES sell offers on the market during the candlestick period.
        price:
          $ref: '#/components/schemas/PriceDistributionHistorical'
          description: Open, high, low, close (OHLC) and more data for trade YES contract prices on the market during the candlestick period.
        volume:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought on the market during the candlestick period.
        open_interest:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought on the market by end of the candlestick period (end_period_ts).

    BidAskDistributionHistorical:
      type: object
      required:
        - open
        - low
        - high
        - close
      properties:
        open:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Offer price on the market at the start of the candlestick period (in dollars).
        low:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Lowest offer price on the market during the candlestick period (in dollars).
        high:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Highest offer price on the market during the candlestick period (in dollars).
        close:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Offer price on the market at the end of the candlestick period (in dollars).

    PriceDistributionHistorical:
      type: object
      required:
        - open
        - low
        - high
        - close
        - mean
        - previous
      properties:
        open:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Price of the first trade during the candlestick period (in dollars). Null if no trades occurred.
        low:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Lowest trade price during the candlestick period (in dollars). Null if no trades occurred.
        high:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Highest trade price during the candlestick period (in dollars). Null if no trades occurred.
        close:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Price of the last trade during the candlestick period (in dollars). Null if no trades occurred.
        mean:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Volume-weighted average price during the candlestick period (in dollars). Null if no trades occurred.
        previous:
          allOf:
            - $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Close price from the previous candlestick period (in dollars). Null if this is the first candlestick or no prior trade exists.

    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
        details:
          type: string
          description: Additional details about the error, if available

    SelfTradePreventionType:
      type: string
      enum: ['taker_at_cross', 'maker']
      description: |
        The self-trade prevention type for orders. `taker_at_cross` cancels the taker order when it would trade against another order from the same user; execution stops and any partial fills already matched are executed. `maker` cancels the resting maker order and continues matching.

    BookSide:
      type: string
      enum: ['bid', 'ask']
      description: 'Side of the book for an order or trade. For event markets, this refers to the YES leg only: `bid` means buy YES, `ask` means sell YES. (Selling YES is economically equivalent to buying NO at `1 - price`, but this endpoint quotes everything from the YES side.)'

    OrderStatus:
      type: string
      enum: ['resting', 'canceled', 'executed']
      description: The status of an order

    ExchangeInstance:
      type: string
      enum: ['event_contract', 'margined']
      description: The exchange instance type

    UserFilter:
      type: string
      enum: ['self']
      x-enum-varnames: ['UserFilterSelf']
      description: Omit or leave empty to return all results. Use `self` to filter by the authenticated user.

    ApiKeyScope:
      type: string
      enum: ['read', 'write', 'read::block_trade_accept', 'read::portfolio_balance', 'write::trade', 'write::transfer', 'write::fcm_risk', 'write::block_trade_accept']
      x-enum-varnames: ['ApiKeyScopeRead', 'ApiKeyScopeWrite', 'ApiKeyScopeReadBlockTradeAccept', 'ApiKeyScopeReadPortfolioBalance', 'ApiKeyScopeWriteTrade', 'ApiKeyScopeWriteTransfer', 'ApiKeyScopeWriteFCMRisk', 'ApiKeyScopeWriteBlockTradeAccept']
      description: Scope granted to an API key. Parent scopes grant broad access; for example, `read` grants all read endpoints and `write` grants all write endpoints. Child scopes such as `read::block_trade_accept`, `read::portfolio_balance`, `write::trade`, `write::transfer`, `write::fcm_risk` (FCM subtrader creation, trading blocks, daily premium caps, and margin caps), and `write::block_trade_accept` grant only their specific endpoint group and can be granted without the parent scope.

    ApiKeyType:
      type: string
      enum: ['rsa', 'ed25519']
      x-enum-varnames: ['ApiKeyTypeRsa', 'ApiKeyTypeEd25519']
      description: Signature algorithm of an API key pair. `rsa` - 2048-bit RSA; requests are signed with RSA-PSS SHA-256. `ed25519` - Ed25519 (RFC 8032) signatures over the same pre-sign text, with lower client-side signing cost. Defaults to `rsa` when omitted from a generate request, for compatibility with existing clients.

    ApiKey:
      type: object
      required:
        - api_key_id
        - name
        - scopes
      properties:
        api_key_id:
          type: string
          description: Unique identifier for the API key
        name:
          type: string
          description: User-provided name for the API key
        scopes:
          type: array
          description: List of scopes granted to this API key.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
        subaccount:
          type: integer
          nullable: true
          minimum: 0
          maximum: 63
          description: If set, the API key is restricted to this single sub-account and may only read and trade on it. Absent/null means the key is unrestricted.
        fcm_subtrader_id:
          type: string
          nullable: true
          description: If set, the API key is bound to this single FCM subtrader ({fcm_user_id}_{suffix}) and is usable only as that institution's trading credential - FIX sessions and subtrader-scoped margin WebSocket sessions; every REST endpoint is denied. Absent/null means the key carries no subtrader binding.

    GetApiKeysResponse:
      type: object
      required:
        - api_keys
      properties:
        api_keys:
          type: array
          description: List of all API keys associated with the user
          items:
            $ref: '#/components/schemas/ApiKey'
        api_key_region_expiration_ts:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp (seconds) when the account's location attestation for API key requests expires; a past value means the attestation has lapsed. Absent when the account has never attested.

    CreateApiKeyRequest:
      type: object
      required:
        - name
        - public_key
      properties:
        name:
          type: string
          description: Name for the API key. This helps identify the key's purpose
        public_key:
          type: string
          description: RSA or Ed25519 public key in PEM format (`-----BEGIN PUBLIC KEY-----`). This will be used to verify signatures on API requests - RSA-PSS with SHA-256 for RSA keys, Ed25519 for Ed25519 keys
        scopes:
          type: array
          description: List of scopes to grant to the API key. If the broad `write` parent scope is included, `read` must also be included. Child scopes may be granted without the broad parent scope. Defaults to full access (`read`, `write`) if not provided.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
        subaccount:
          type: integer
          minimum: 0
          maximum: 63
          description: If set, restricts the API key to a single sub-account (0-63) that you own. A restricted key may only read and trade on that sub-account; it cannot act on other sub-accounts, transfer funds between sub-accounts, or create sub-accounts. Omit to leave the key unrestricted. Mutually exclusive with fcm_subtrader_id.
        fcm_subtrader_id:
          type: string
          description: FCM members only. If set, binds the API key to a single FCM subtrader that you own, spelled {your_user_id}_{suffix} with a suffix of 1-16 case-sensitive ASCII alphanumeric characters. The subtrader must already exist. A bound key is the institution's trading credential for that subtrader - FIX order-entry and market-data sessions, plus margin WebSocket sessions scoped to the subtrader's own data - and is denied on every REST endpoint, including key management. Mutually exclusive with subaccount.

    CreateApiKeyResponse:
      type: object
      required:
        - api_key_id
      properties:
        api_key_id:
          type: string
          description: Unique identifier for the newly created API key
        warning:
          type: string
          nullable: true
          description: Present only when the minted key is bound to an FCM subtrader that is missing a per-subtrader risk control - the initial-margin cap (margin lane) or the event-contract daily cap. The mint still succeeds; the warning names each missing control - an event-contract subtrader without a daily cap has its event-contract orders rejected until one is set, while a margin subtrader without an initial-margin cap is bounded only by firm-level risk limits.

    GenerateApiKeyRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name for the API key. This helps identify the key's purpose
        key_type:
          $ref: '#/components/schemas/ApiKeyType'
        scopes:
          type: array
          description: List of scopes to grant to the API key. If the broad `write` parent scope is included, `read` must also be included. Child scopes may be granted without the broad parent scope. Defaults to full access (`read`, `write`) if not provided.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
        subaccount:
          type: integer
          minimum: 0
          maximum: 63
          description: If set, restricts the API key to a single sub-account (0-63) that you own. A restricted key may only read and trade on that sub-account; it cannot act on other sub-accounts, transfer funds between sub-accounts, or create sub-accounts. Omit to leave the key unrestricted. Mutually exclusive with fcm_subtrader_id.
        fcm_subtrader_id:
          type: string
          description: FCM members only. If set, binds the API key to a single FCM subtrader that you own, spelled {your_user_id}_{suffix} with a suffix of 1-16 case-sensitive ASCII alphanumeric characters. The subtrader must already exist. A bound key is the institution's trading credential for that subtrader - FIX order-entry and market-data sessions, plus margin WebSocket sessions scoped to the subtrader's own data - and is denied on every REST endpoint, including key management. Mutually exclusive with subaccount.

    GenerateApiKeyResponse:
      type: object
      required:
        - api_key_id
        - private_key
      properties:
        api_key_id:
          type: string
          description: Unique identifier for the newly generated API key
        key_type:
          $ref: '#/components/schemas/ApiKeyType'
        private_key:
          type: string
          description: Private key in PEM format - PKCS#1 (`-----BEGIN RSA PRIVATE KEY-----`) for `rsa`, PKCS#8 (`-----BEGIN PRIVATE KEY-----`) for `ed25519`. This must be stored securely and cannot be retrieved again after this response
        warning:
          type: string
          nullable: true
          description: Present only when the minted key is bound to an FCM subtrader that is missing a per-subtrader risk control - the initial-margin cap (margin lane) or the event-contract daily cap. The mint still succeeds; the warning names each missing control - an event-contract subtrader without a daily cap has its event-contract orders rejected until one is set, while a margin subtrader without an initial-margin cap is bounded only by firm-level risk limits.

    GetTagsForSeriesCategoriesResponse:
      type: object
      required:
        - tags_by_categories
      properties:
        tags_by_categories:
          type: object
          description: Mapping of series categories to their associated tags
          additionalProperties:
            type: array
            items:
              type: string

    ScopeList:
      type: object
      required:
        - scopes
      properties:
        scopes:
          type: array
          description: List of scopes
          items:
            type: string

    SportFilterDetails:
      type: object
      required:
        - scopes
        - competitions
      properties:
        scopes:
          type: array
          description: List of scopes available for this sport
          items:
            type: string
        competitions:
          type: object
          description: Mapping of competitions to their scope lists
          additionalProperties:
            $ref: '#/components/schemas/ScopeList'

    GetFiltersBySportsResponse:
      type: object
      required:
        - filters_by_sports
        - sport_ordering
      properties:
        filters_by_sports:
          type: object
          description: Mapping of sports to their filter details
          additionalProperties:
            $ref: '#/components/schemas/SportFilterDetails'
        sport_ordering:
          type: array
          description: Ordered list of sports for display
          items:
            type: string
    
    BucketLimit:
      type: object
      description: |
        Token-bucket budget for one rate-limit bucket. Each request deducts
        tokens equal to its endpoint cost; the bucket refills at refill_rate
        tokens per second up to bucket_capacity. A request is allowed if the
        bucket holds enough tokens to cover its cost; otherwise the request
        is rejected with HTTP 429.
      required:
        - refill_rate
        - bucket_capacity
      properties:
        refill_rate:
          type: integer
          description: Tokens added to the bucket per second.
        bucket_capacity:
          type: integer
          description: |
            Maximum tokens the bucket can hold. When equal to refill_rate the
            bucket holds one second of budget; larger values represent burst
            headroom that idle clients accumulate and can spend in a single
            pulse (e.g. write buckets at non-Basic tiers hold two seconds of
            budget).

    GetAccountApiLimitsResponse:
      type: object
      required:
        - usage_tier
        - read
        - write
        - grants
      properties:
        usage_tier:
          type: string
          description: User's effective Predictions API usage tier for these limits (for example, basic, advanced, expert, premier, paragon, prime, or prestige).
          example: expert
        read:
          $ref: '#/components/schemas/BucketLimit'
        write:
          $ref: '#/components/schemas/BucketLimit'
        grants:
          type: array
          description: The caller's active API usage level grants across exchange lanes, where each grant applies to its exchange_instance and usage_tier reflects the effective tier for the lane reported by this endpoint.
          items:
            $ref: '#/components/schemas/ApiUsageLevelGrant'

    ApiUsageLevelGrant:
      type: object
      required:
        - exchange_instance
        - level
        - source
      properties:
        exchange_instance:
          $ref: '#/components/schemas/ExchangeInstance'
        level:
          type: string
          description: API usage level this grant confers (for example, expert, premier, paragon, prime, or prestige).
          example: prestige
        expires_ts:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp (seconds) when the grant expires. Absent for permanent grants.
        source:
          type: string
          description: 'How the grant was created: "volume" (earned from trading volume) or "manual" (assigned by Kalshi).'

    GetAccountApiUsageLevelVolumeProgressResponse:
      type: object
      required:
        - volume_progress
      properties:
        volume_progress:
          type: array
          description: Latest cron-computed trading volume progress toward volume-based API usage tiers for the predictions (event_contract) lane. Volume-based public tiers are Expert, Premier, Paragon, Prime, and Prestige.
          items:
            $ref: '#/components/schemas/AccountApiUsageLevelVolumeProgress'

    AccountApiUsageLevelVolumeProgress:
      type: object
      required:
        - computed_ts
        - trailing_30d_volume_fp
        - goals
      properties:
        computed_ts:
          type: integer
          format: int64
          description: 'Unix timestamp (seconds) when this progress was computed; trailing_30d_volume_fp covers the trailing 30 days ending at this time.'
        trailing_30d_volume_fp:
          $ref: '#/components/schemas/FixedPointCount'
        goals:
          type: array
          items:
            $ref: '#/components/schemas/AccountApiUsageLevelVolumeGoal'

    AccountApiUsageLevelVolumeGoal:
      type: object
      required:
        - level
        - earn_volume_goal_fp
        - keep_volume_goal_fp
      properties:
        level:
          type: string
          description: API usage level for this Predictions volume goal.
          example: expert
        earn_volume_goal_fp:
          $ref: '#/components/schemas/FixedPointCount'
        keep_volume_goal_fp:
          $ref: '#/components/schemas/FixedPointCount'

    EndpointTokenCost:
      type: object
      required:
        - method
        - path
        - cost
      properties:
        method:
          type: string
          description: HTTP method for the endpoint.
        path:
          type: string
          description: API route path for the endpoint.
        cost:
          type: integer
          description: Configured token cost for an endpoint whose cost differs from the default cost.

    GetAccountEndpointCostsResponse:
      type: object
      required:
        - default_cost
        - endpoint_costs
      properties:
        default_cost:
          type: integer
          description: Default token cost applied to endpoints that are not listed in `endpoint_costs`. This is currently 10.
        endpoint_costs:
          type: array
          description: API v2 endpoints whose configured token cost differs from `default_cost`. Endpoints that use the default cost are omitted.
          items:
            $ref: '#/components/schemas/EndpointTokenCost'

    ExchangeStatus:
      type: object
      required:
        - exchange_active
        - trading_active
      properties:
        exchange_active:
          type: boolean
          description: False if the core Kalshi exchange is no longer taking any state changes at all. This includes but is not limited to trading, new users, and transfers. True unless we are under maintenance.
        trading_active:
          type: boolean
          description: True if we are currently permitting trading on the exchange. This is true during trading hours and false outside exchange hours. Kalshi reserves the right to pause at any time in case issues are detected.
        intra_exchange_transfers_active:
          type: boolean
          description: True if intra-exchange transfers are currently permitted. False when transfers are temporarily blocked.
        exchange_estimated_resume_time:
          type: string
          format: date-time
          description: Estimated downtime for the current exchange maintenance window. However, this is not guaranteed and can be extended.
          nullable: true
        exchange_index_statuses:
          type: array
          description: Status of each exchange index. The top-level fields above reflect the default exchange index (0). Absent when the per-index breakdown is unavailable.
          items:
            $ref: '#/components/schemas/ExchangeIndexStatus'

    ExchangeIndexStatus:
      type: object
      required:
        - exchange_index
        - description
        - exchange_active
        - trading_active
        - intra_exchange_transfers_active
      properties:
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        description:
          type: string
          description: Description of this exchange shard.
        exchange_active:
          type: boolean
          description: False if this exchange index is no longer taking any state changes at all. True unless under maintenance.
        trading_active:
          type: boolean
          description: True if trading is currently permitted on this exchange index. False outside exchange hours or during pauses.
        intra_exchange_transfers_active:
          type: boolean
          description: True if intra-exchange transfers are currently permitted on this exchange index. False when transfers are temporarily blocked.

    GetExchangeScheduleResponse:
      type: object
      required:
        - schedule
      properties:
        schedule:
          $ref: '#/components/schemas/Schedule'

    Schedule:
      type: object
      required:
        - standard_hours
        - maintenance_windows
      properties:
        standard_hours:
          type: array
          description: The standard operating hours of the exchange. All times are expressed in ET. Outside of these times trading will be unavailable.
          items:
            $ref: '#/components/schemas/WeeklySchedule'
        maintenance_windows:
          type: array
          description: Scheduled maintenance windows, during which the exchange may be unavailable.
          items:
            $ref: '#/components/schemas/MaintenanceWindow'

    WeeklySchedule:
      type: object
      required:
        - start_time
        - end_time
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
        - sunday
      properties:
        start_time:
          type: string
          format: date-time
          description: Start date and time for when this weekly schedule is effective.
        end_time:
          type: string
          format: date-time
          description: End date and time for when this weekly schedule is no longer effective.
        monday:
          type: array
          description: Trading hours for Monday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        tuesday:
          type: array
          description: Trading hours for Tuesday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        wednesday:
          type: array
          description: Trading hours for Wednesday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        thursday:
          type: array
          description: Trading hours for Thursday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        friday:
          type: array
          description: Trading hours for Friday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        saturday:
          type: array
          description: Trading hours for Saturday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'
        sunday:
          type: array
          description: Trading hours for Sunday. May contain multiple sessions.
          items:
            $ref: '#/components/schemas/DailySchedule'

    DailySchedule:
      type: object
      required:
        - open_time
        - close_time
      properties:
        open_time:
          type: string
          description: Opening time in ET (Eastern Time) format HH:MM.
        close_time:
          type: string
          description: Closing time in ET (Eastern Time) format HH:MM.

    MaintenanceWindow:
      type: object
      required:
        - start_datetime
        - end_datetime
      properties:
        start_datetime:
          type: string
          format: date-time
          description: Start date and time of the maintenance window.
        end_datetime:
          type: string
          format: date-time
          description: End date and time of the maintenance window.

    GetHistoricalCutoffResponse:
      type: object
      required:
        - market_settled_ts
        - trades_created_ts
        - orders_updated_ts
      properties:
        market_settled_ts:
          type: string
          format: date-time
          description: |
            Cutoff based on **market settlement time**. Markets and their candlesticks that settled before this timestamp must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`.
        trades_created_ts:
          type: string
          format: date-time
          description: |
            Cutoff based on **trade fill time**. Fills that occurred before this timestamp must be accessed via `GET /historical/fills`.
        orders_updated_ts:
          type: string
          format: date-time
          description: |
            Cutoff based on **order cancellation or execution time**. Orders canceled or fully executed before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`.
        market_positions_last_updated_ts:
          type: string
          format: date-time
          description: |
            Cutoff based on **position last-update time**. Settled positions archived from the live data set before this timestamp are served through the historical section of position reads.

    GetUserDataTimestampResponse:
      type: object
      required:
        - as_of_time
      properties:
        as_of_time:
          type: string
          format: date-time
          description: Timestamp when user data was last updated.

    GetMarketCandlesticksResponse:
      type: object
      required:
        - ticker
        - candlesticks
      properties:
        ticker:
          type: string
          description: Unique identifier for the market.
        candlesticks:
          type: array
          description: Array of candlestick data points for the specified time range.
          items:
            $ref: '#/components/schemas/MarketCandlestick'

    GetEventCandlesticksResponse:
      type: object
      required:
        - market_tickers
        - market_candlesticks
        - adjusted_end_ts
      properties:
        market_tickers:
          type: array
          description: Array of market tickers in the event.
          items:
            type: string
        market_candlesticks:
          type: array
          description: Array of market candlestick arrays, one for each market in the event.
          items:
            type: array
            items:
              $ref: '#/components/schemas/MarketCandlestick'
        adjusted_end_ts:
          type: integer
          format: int64
          description: Adjusted end timestamp if the requested candlesticks would be larger than maxAggregateCandidates.

    BatchGetMarketCandlesticksResponse:
      type: object
      required:
        - markets
      properties:
        markets:
          type: array
          description: Array of market candlestick data, one entry per requested market.
          items:
            $ref: '#/components/schemas/MarketCandlesticksResponse'

    MarketCandlesticksResponse:
      type: object
      required:
        - market_ticker
        - candlesticks
      properties:
        market_ticker:
          type: string
          description: Market ticker string (e.g., 'INXD-24JAN01').
        candlesticks:
          type: array
          description: Array of candlestick data points for the market. Includes an initial data point at the start timestamp when available.
          items:
            $ref: '#/components/schemas/MarketCandlestick'

    MarketCandlestick:
      type: object
      required:
        - end_period_ts
        - yes_bid
        - yes_ask
        - price
        - volume_fp
        - open_interest_fp
      properties:
        end_period_ts:
          type: integer
          format: int64
          description: Unix timestamp for the inclusive end of the candlestick period.
        yes_bid:
          $ref: '#/components/schemas/BidAskDistribution'
          description: Open, high, low, close (OHLC) data for YES buy offers on the market during the candlestick period.
        yes_ask:
          $ref: '#/components/schemas/BidAskDistribution'
          description: Open, high, low, close (OHLC) data for YES sell offers on the market during the candlestick period.
        price:
          $ref: '#/components/schemas/PriceDistribution'
          description: Open, high, low, close (OHLC) and more data for trade YES contract prices on the market during the candlestick period.
        volume_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought on the market during the candlestick period.
        open_interest_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought on the market by end of the candlestick period (end_period_ts).

    BidAskDistribution:
      type: object
      required:
        - open_dollars
        - low_dollars
        - high_dollars
        - close_dollars
      properties:
        open_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Offer price on the market at the start of the candlestick period (in dollars).
        low_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Lowest offer price on the market during the candlestick period (in dollars).
        high_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Highest offer price on the market during the candlestick period (in dollars).
        close_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Offer price on the market at the end of the candlestick period (in dollars).

    PriceDistribution:
      type: object
      properties:
        open_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: First traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
        low_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Lowest traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
        high_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Highest traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
        close_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Last traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
        mean_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Mean traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
        previous_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Last traded YES contract price on the market before the candlestick period (in dollars). May be null if there were no trades before the period.
        min_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Minimum close price of any market during the candlestick period (in dollars).
        max_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          description: Maximum close price of any market during the candlestick period (in dollars).

    # Live Data schemas
    LiveData:
      type: object
      required:
        - type
        - details
        - milestone_id
      properties:
        type:
          type: string
          description: Type of live data
        details:
          type: object
          additionalProperties: true
          description: Live data details as a flexible object
        milestone_id:
          type: string
          description: Milestone ID

    GetLiveDataResponse:
      type: object
      required:
        - live_data
      properties:
        live_data:
          $ref: '#/components/schemas/LiveData'

    GetLiveDatasResponse:
      type: object
      required:
        - live_datas
      properties:
        live_datas:
          type: array
          items:
            $ref: '#/components/schemas/LiveData'

    EventLiveData:
      type: object
      required:
        - type
        - details
      properties:
        type:
          type: string
          description: Type of live data. Names the schema of the details object.
        details:
          type: object
          additionalProperties: true
          description: Live data details as a flexible object whose shape depends on the type.
        is_historical:
          type: boolean
          description: >-
            Present for crypto live data. True when the event has matured and
            the payload is a frozen historical snapshot.
        default_range:
          type: string
          description: >-
            Chart range the client should default to (e.g. `15min`, `1h`).
            Omitted when unset.
        range_options:
          type: array
          items:
            type: string
          description: Chart range menu options. Omitted when unset.

    GetEventLiveDataResponse:
      type: object
      required:
        - live_data
      properties:
        live_data:
          $ref: '#/components/schemas/EventLiveData'

    GetWeatherIndexResponse:
      type: object
      required:
        - city
        - units
        - timeseries
      properties:
        city:
          type: string
          description: Index city ID.
        config_version:
          type: string
          description: >-
            Index configuration version of the newest returned point (e.g.
            `miami-temperature-v1.0`). Empty when no points matched the
            window.
        units:
          type: string
          description: Always `fahrenheit`.
        timeseries:
          type: array
          items:
            $ref: '#/components/schemas/WeatherIndexPoint'

    WeatherIndexPoint:
      type: object
      required:
        - t
        - status
      properties:
        t:
          type: integer
          format: int64
          description: Event minute, unix milliseconds UTC.
        v:
          type: number
          format: double
          description: >-
            Published index value, Fahrenheit rounded to 0.01. Absent on
            `incomplete` points, which have no canonical value yet.
        status:
          type: string
          description: >-
            `normal` (every member contributed its exact-minute primary
            observation) or `degraded` (a member was absent, fallback-fed, or
            substituted by quality control; the value is equally
            settlement-eligible). With `detailed=true`, trailing minutes still
            inside their receipt deadline are additionally served as
            `incomplete`: no value, and stations carrying the raw readings
            recorded so far (code `pending`, not yet quality-controlled — more
            readings may still arrive, and the canonical value may differ).
        contributors:
          type: integer
          description: >-
            Number of accepted member stations backing the point. Absent on
            `incomplete` points.
        receipt_basis:
          type: string
          description: >-
            Present only on points produced by the labelled historical
            backfill that seeds a city's series for the period before it went
            live. `synoptic_latency` means the receipt-deadline test used
            `observation_time + Synoptic ingest latency` in place of Kalshi's
            local receipt clock. Absent on canonical points, which are the
            only settlement-eligible ones.
        stations:
          type: array
          description: >-
            Per-station audit readings (only with `detailed=true`), sorted by
            station ID — every configured member's reported value and QC
            disposition before incorporation into the index.
          items:
            $ref: '#/components/schemas/WeatherIndexStationReading'

    WeatherIndexStationReading:
      type: object
      required:
        - station_id
        - code
      properties:
        station_id:
          type: string
          description: Member station (e.g. `KMIA1M`) or its official fallback ID.
        code:
          type: string
          description: >-
            Disposition: `ok` (accepted), `missing` (no eligible
            observation), `late` (received after the deadline; diagnostic
            only), a QC rejection (`range`, `rate_spatial`, `extreme`), or
            `pending` (raw reading on an `incomplete` minute, not yet
            quality-controlled).
        source:
          type: string
          description: >-
            `hf_asos` (exact-minute primary) or `metar` (carried-forward
            official observation). Absent when no reading was available.
        temp_f:
          type: number
          format: double
          description: >-
            Raw reported temperature in Fahrenheit (unrounded — only the
            published index value carries output rounding). Absent for
            `missing` members.
        obs_time_ms:
          type: integer
          format: int64
          description: >-
            Observation time for carried-forward fallbacks (differs from the
            event minute). Absent for exact-minute primaries.
        received_at_ms:
          type: integer
          format: int64
          description: Local wire-receipt time backing the eligibility deadline.
        primary_code:
          type: string
          description: >-
            Why the primary observation was passed over when a fallback was
            selected instead.

    GetWeatherIndexCalibrationsResponse:
      type: object
      required:
        - city
        - units
        - calibrations
      properties:
        city:
          type: string
          description: Index city ID.
        units:
          type: string
          description: >-
            Always `celsius` — offsets and the city reference are Celsius
            quantities from the index methodology (the published index value
            itself is Fahrenheit).
        calibrations:
          type: array
          description: Configuration records, ascending by effective time.
          items:
            $ref: '#/components/schemas/WeatherIndexCalibration'

    WeatherIndexCalibration:
      type: object
      required:
        - config_version
        - effective_at_ms
        - city_reference_c
        - stations
      properties:
        config_version:
          type: string
          description: >-
            Configuration version (e.g.
            `miami-temperature-v1.0-cal-20260831`). Index points report the
            version they were computed under in their `config_version` field.
        published_at_ms:
          type: integer
          format: int64
          description: When the record was published, unix milliseconds UTC.
        effective_at_ms:
          type: integer
          format: int64
          description: >-
            The record governs event minutes at or after this time (unix
            milliseconds UTC), until superseded by the next record.
        change_reason:
          type: string
          description: Why the configuration changed.
        calibration_window_start_ms:
          type: integer
          format: int64
          description: >-
            Start of the trailing observation window the offsets were
            estimated from. Absent on records not derived from a calibration
            window (the launch configuration).
        calibration_window_end_ms:
          type: integer
          format: int64
          description: End of the calibration window (exclusive).
        city_reference_c:
          type: number
          format: double
          description: >-
            City reference B_c in Celsius: the weight-dot-offset sum over all
            configured member stations.
        stations:
          type: array
          description: Configured member stations, in configuration order.
          items:
            $ref: '#/components/schemas/WeatherIndexCalibrationStation'

    WeatherIndexCalibrationStation:
      type: object
      required:
        - station_id
        - weight
        - offset_c
      properties:
        station_id:
          type: string
          description: Member station ID (e.g. `KMIA1M`).
        weight:
          type: number
          format: double
          description: Base weight (weights sum to 1.0 across members).
        offset_c:
          type: number
          format: double
          description: Station offset in Celsius (positive = station normally runs warmer than its peers).
        update_note:
          type: string
          description: >-
            Weekly-calibration disposition, present only on weekly
            calibration records: `updated ...` with the residual count,
            target, and applied adjustment, or `insufficient ...` when the
            prior offset was retained.

    GetGameStatsResponse:
      type: object
      properties:
        pbp:
          $ref: '#/components/schemas/PlayByPlay'

    PlayByPlay:
      type: object
      description: Play-by-play data organized by period.
      properties:
        periods:
          type: array
          items:
            type: object
            properties:
              events:
                type: array
                items:
                  type: object
                  additionalProperties: true

    IndexedBalance:
      type: object
      required:
        - exchange_index
        - balance
      properties:
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        balance:
          $ref: '#/components/schemas/FixedPointDollars'

    GetBalanceResponse:
      type: object
      required:
        - balance
        - balance_dollars
        - portfolio_value
        - updated_ts
      properties:
        balance:
          type: integer
          format: int64
          description: Member's available balance in cents for the requested account and exchange index. It includes all exchange indexes when `exchange_index` is omitted.
        balance_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Member's available balance as a fixed-point dollar string for the requested account and exchange index. It includes all exchange indexes when `exchange_index` is omitted.
        portfolio_value:
          type: integer
          format: int64
          description: Member's portfolio value in cents for the requested account and exchange index. It includes all exchange indexes when `exchange_index` is omitted.
        updated_ts:
          type: integer
          format: int64
          description: Unix timestamp of the last update to the balance.
        balance_breakdown:
          type: array
          items:
            $ref: '#/components/schemas/IndexedBalance'
          description: 'User balance breakdown per exchange instance, omitted only when using a subaccount-restricted API key.'

    CreateSubaccountRequest:
      type: object
      properties:
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: "Identifier for an exchange shard. Defaults to 0 if unspecified."
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "gte=0"

    CreateSubaccountResponse:
      type: object
      required:
        - subaccount_number
      properties:
        subaccount_number:
          type: integer
          description: The sequential number assigned to this subaccount (1-63).

    ApplySubaccountTransferRequest:
      type: object
      required:
        - client_transfer_id
        - from_subaccount
        - to_subaccount
        - amount_cents
      properties:
        client_transfer_id:
          type: string
          format: uuid
          description: Unique client-provided transfer ID for idempotency.
          x-oapi-codegen-extra-tags:
            validate: "required"
        from_subaccount:
          type: integer
          description: Source subaccount number (0 for primary, 1-63 for numbered subaccounts).
        to_subaccount:
          type: integer
          description: Destination subaccount number (0 for primary, 1-63 for numbered subaccounts).
        amount_cents:
          type: integer
          format: int64
          description: Amount to transfer in cents.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: "Identifier for an exchange shard. Defaults to 0 if unspecified."
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: "gte=0"

    ApplySubaccountTransferResponse:
      type: object
      description: Empty response indicating successful transfer.

    GetSubaccountBalancesResponse:
      type: object
      required:
        - subaccount_balances
      properties:
        subaccount_balances:
          type: array
          items:
            $ref: '#/components/schemas/SubaccountBalance'

    SubaccountBalance:
      type: object
      required:
        - subaccount_number
        - exchange_index
        - balance
        - updated_ts
      properties:
        subaccount_number:
          type: integer
          description: Subaccount number (0 for primary, 1-63 for subaccounts).
        exchange_index:
          type: integer
          description: Exchange index the balance is held on.
        balance:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Balance in dollars.
        updated_ts:
          type: integer
          format: int64
          description: Unix timestamp of last balance update.

    GetSubaccountTransfersResponse:
      type: object
      required:
        - transfers
      properties:
        transfers:
          type: array
          items:
            $ref: '#/components/schemas/SubaccountTransfer'
        cursor:
          type: string
          description: Cursor for the next page of results.

    SubaccountTransfer:
      type: object
      required:
        - transfer_id
        - from_subaccount
        - to_subaccount
        - amount_cents
        - created_ts
        - exchange_index
      properties:
        transfer_id:
          type: string
          description: Unique identifier for this transfer.
        from_subaccount:
          type: integer
          description: Source subaccount number (0 for primary, 1-63 for subaccounts).
        to_subaccount:
          type: integer
          description: Destination subaccount number (0 for primary, 1-63 for subaccounts).
        amount_cents:
          type: integer
          format: int64
          description: Cash transfer amount in cents.
        created_ts:
          type: integer
          format: int64
          description: Unix timestamp when the transfer was created.
        exchange_index:
          type: integer
          description: Exchange index the transfer was applied on.

    UpdateSubaccountNettingRequest:
      type: object
      required:
        - subaccount_number
        - enabled
      properties:
        subaccount_number:
          type: integer
          description: Subaccount number (0 for primary, 1-63 for subaccounts).
        enabled:
          type: boolean
          description: Whether netting is enabled for this subaccount.

    GetSubaccountNettingResponse:
      type: object
      required:
        - netting_configs
      properties:
        netting_configs:
          type: array
          items:
            $ref: '#/components/schemas/SubaccountNettingConfig'

    SubaccountNettingConfig:
      type: object
      required:
        - subaccount_number
        - enabled
        - exchange_index
      properties:
        subaccount_number:
          type: integer
          description: Subaccount number (0 for primary, 1-63 for subaccounts).
        enabled:
          type: boolean
          description: Whether netting is enabled for this subaccount.
        exchange_index:
          type: integer
          description: Exchange index of the subaccount.

    # Portfolio schemas (specific to portfolio endpoints, not shared with IB)
    GetSettlementsResponse:
      type: object
      required:
        - settlements
      properties:
        settlements:
          type: array
          items:
            $ref: '#/components/schemas/Settlement'
        cursor:
          type: string

    Settlement:
      type: object
      required:
        - ticker
        - exchange_index
        - event_ticker
        - market_result
        - yes_count_fp
        - yes_total_cost_dollars
        - no_count_fp
        - no_total_cost_dollars
        - revenue
        - settled_time
        - fee_cost
      properties:
        ticker:
          type: string
          description: The ticker symbol of the market that was settled.
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        event_ticker:
          type: string
          description: The event ticker symbol of the market that was settled.
        market_result:
          type: string
          enum: ['yes', 'no', 'scalar']
          description: The outcome of the market settlement. 'yes' = market resolved to YES, 'no' = market resolved to NO, 'scalar' = scalar market settled at a specific value.
        yes_count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of YES contracts owned at the time of settlement.
        yes_total_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total cost basis of all YES contracts in fixed-point dollars.
        no_count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of NO contracts owned at the time of settlement.
        no_total_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total cost basis of all NO contracts in fixed-point dollars.
        revenue:
          type: integer
          description: Total revenue earned from this settlement in cents (winning contracts pay out 100 cents each).
        settled_time:
          type: string
          format: date-time
          description: Timestamp when the market was settled and payouts were processed.
        fee_cost:
          $ref: '#/components/schemas/FixedPointDollars'
          example: "0.3400"
          description: Total fees paid in fixed point dollars.
        value:
          type: integer
          nullable: true
          description: Payout of a single yes contract in cents.

    GetPortfolioRestingOrderTotalValueResponse:
      type: object
      required:
        - total_resting_order_value
        - resting_order_value_breakdown
      properties:
        total_resting_order_value:
          type: integer
          description: Total value of resting orders in cents
        resting_order_value_breakdown:
          type: array
          items:
            $ref: '#/components/schemas/IndexedBalance'
          description: Total value of resting orders broken down by exchange index, with each balance expressed as a fixed-point dollar string.

    GetDepositsResponse:
      type: object
      required:
        - deposits
      properties:
        deposits:
          type: array
          items:
            $ref: '#/components/schemas/Deposit'
        cursor:
          type: string

    Deposit:
      type: object
      required:
        - id
        - status
        - type
        - amount_cents
        - fee_cents
        - created_ts
      properties:
        id:
          type: string
          description: Unique identifier for the deposit.
        status:
          type: string
          enum:
            - pending
            - applied
            - failed
            - returned
          x-enum-varnames:
            - DepositStatusPending
            - DepositStatusApplied
            - DepositStatusFailed
            - DepositStatusReturned
          description: Current status of the deposit. 'applied' means funds are reflected in balance.
        type:
          type: string
          enum:
            - ach
            - wire
            - crypto
            - debit
            - apm
          description: Payment method used for the deposit.
        amount_cents:
          type: integer
          format: int64
          description: Deposit amount in cents.
        fee_cents:
          type: integer
          format: int64
          description: Fee charged for the deposit in cents.
        created_ts:
          type: integer
          format: int64
          description: Unix timestamp of when the deposit was created.
        finalized_ts:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp of when the deposit was finalized (applied, failed, or returned).

    GetWithdrawalsResponse:
      type: object
      required:
        - withdrawals
      properties:
        withdrawals:
          type: array
          items:
            $ref: '#/components/schemas/Withdrawal'
        cursor:
          type: string

    Withdrawal:
      type: object
      required:
        - id
        - status
        - type
        - amount_cents
        - fee_cents
        - created_ts
      properties:
        id:
          type: string
          description: Unique identifier for the withdrawal.
        status:
          type: string
          enum:
            - pending
            - applied
            - failed
            - returned
          x-enum-varnames:
            - WithdrawalStatusPending
            - WithdrawalStatusApplied
            - WithdrawalStatusFailed
            - WithdrawalStatusReturned
          description: Current status of the withdrawal. 'applied' means funds have been deducted from balance.
        type:
          type: string
          enum:
            - ach
            - wire
            - crypto
            - debit
            - apm
          description: Payment type used for the withdrawal.
        amount_cents:
          type: integer
          format: int64
          description: Withdrawal amount in cents.
        fee_cents:
          type: integer
          format: int64
          description: Fee charged for the withdrawal in cents.
        created_ts:
          type: integer
          format: int64
          description: Unix timestamp of when the withdrawal was created.
        finalized_ts:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp of when the withdrawal was finalized (applied, failed, or returned).

    # FCM schemas
    Order:
      type: object
      required:
        - order_id
        - user_id
        - client_order_id
        - ticker
        - outcome_side
        - book_side
        - type
        - status
        - yes_price_dollars
        - no_price_dollars
        - fill_count_fp
        - remaining_count_fp
        - initial_count_fp
        - taker_fees_dollars
        - maker_fees_dollars
        - taker_fill_cost_dollars
        - maker_fill_cost_dollars
      properties:
        order_id:
          type: string
        user_id:
          type: string
          description: Unique identifier for users
        client_order_id:
          type: string
        ticker:
          type: string
        side:
          type: string
          enum: ['yes', 'no']
          deprecated: true
          x-go-type-skip-optional-pointer: true
          description: |
            Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
        action:
          type: string
          enum: [buy, sell]
          deprecated: true
          x-go-type-skip-optional-pointer: true
          description: |
            Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
        outcome_side:
          type: string
          enum: ['yes', 'no']
          description: |
            The outcome side this order is positioned for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.

            `outcome_side` describes directional exposure only; it does not change the order's price. An order at price `p` with `outcome_side=no` is matched by an order at the same price `p` with `outcome_side=yes` — both parties trade at the same price, just on opposite directions.

            `outcome_side` and `book_side` will become the canonical way to determine order direction. The legacy `action`, `side`, and `is_yes` fields will be deprecated in a future release — please migrate to these new fields.
        book_side:
          $ref: '#/components/schemas/BookSide'
          description: |
            Same directional bit as outcome_side in book vocabulary. 'bid' is equivalent to outcome_side 'yes'; 'ask' is equivalent to outcome_side 'no'.

            `outcome_side` and `book_side` will become the canonical way to determine order direction. The legacy `action`, `side`, and `is_yes` fields will be deprecated in a future release — please migrate to these new fields.
        type:
          type: string
          enum: [limit, market]
        status:
          $ref: '#/components/schemas/OrderStatus'
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The yes price for this order in fixed-point dollars
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The no price for this order in fixed-point dollars
        fill_count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts that have been filled
        remaining_count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the remaining contracts for this order
        initial_count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the initial size of the order (contract units)
        taker_fill_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The cost of filled taker orders in dollars
        maker_fill_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The cost of filled maker orders in dollars
        taker_fees_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fees paid on filled taker contracts, in dollars
        maker_fees_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fees paid on filled maker contracts, in dollars
        expiration_time:
          type: string
          format: date-time
          nullable: true
        created_time:
          type: string
          format: date-time
          nullable: true
          x-omitempty: false
        last_update_time:
          type: string
          format: date-time
          nullable: true
          x-omitempty: true
          description: The last update to an order (modify, cancel, fill)
        self_trade_prevention_type:
          $ref: '#/components/schemas/SelfTradePreventionType'
          nullable: true
          x-omitempty: false
        order_group_id:
          type: string
          nullable: true
          description: The order group this order is part of
        cancel_order_on_pause:
          type: boolean
          description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
        subaccount_number:
          type: integer
          nullable: true
          x-omitempty: true
          description: Subaccount number (0 for primary, 1-63 for subaccounts).
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    Milestone:
      type: object
      required:
        - id
        - category
        - type
        - start_date
        - related_event_tickers
        - title
        - notification_message
        - details
        - primary_event_tickers
        - last_updated_ts
      properties:
        id:
          type: string
          description: Unique identifier for the milestone.
        category:
          type: string
          description: 'Category of the milestone. E.g. Sports, Elections, Esports, Crypto.'
          example: Sports
        type:
          type: string
          description: 'Type of the milestone. E.g. football_game, basketball_game, soccer_tournament_multi_leg, baseball_game, hockey_match, golf_tournament, political_race.'
          example: football_game
        start_date:
          type: string
          format: date-time
          description: Start date of the milestone.
        end_date:
          type: string
          format: date-time
          nullable: true
          description: End date of the milestone, if any.
        related_event_tickers:
          type: array
          items:
            type: string
          description: List of event tickers related to this milestone.
        title:
          type: string
          description: Title of the milestone.
        notification_message:
          type: string
          description: Notification message for the milestone.
        source_id:
          type: string
          nullable: true
          description: Source id of milestone if available.
        source_ids:
          type: object
          additionalProperties:
            type: string
          description: Source ids of milestone if available.
        details:
          type: object
          additionalProperties: true
          description: >-
            Additional details about the milestone.
            `details.status`, when present, is maintained by a periodic background job. It lags the game's live state and may be stale or inaccurate, for example remaining `live` after the game ends. For game status, prefer live data, which is updated far more often: `live_data.details.status` from `GET /live_data/milestone/{milestone_id}`, or each entry's `details.status` from `GET /live_data/batch`. Scores are in the sport-specific fields of that live data `details` object.
        primary_event_tickers:
          type: array
          items:
            type: string
          description: List of event tickers directly related to the outcome of this milestone.
        last_updated_ts:
          type: string
          format: date-time
          description: Last time this structured target was updated.

    GetMilestoneResponse:
      type: object
      required:
        - milestone
      properties:
        milestone:
          $ref: '#/components/schemas/Milestone'
          description: The milestone data.

    GetMilestonesResponse:
      type: object
      required:
        - milestones
      properties:
        milestones:
          type: array
          items:
            $ref: '#/components/schemas/Milestone'
          description: List of milestones.
        cursor:
          type: string
          description: Cursor for pagination.

    GetOrdersResponse:
      type: object
      required:
        - orders
        - cursor
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
        cursor:
          type: string

    GetOrderQueuePositionResponse:
      type: object
      required:
        - queue_position_fp
      properties:
        queue_position_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: The number of preceding shares before the order in the queue.

    OrderQueuePosition:
      type: object
      required:
        - order_id
        - market_ticker
        - queue_position_fp
      properties:
        order_id:
          type: string
          description: The order ID
        market_ticker:
          type: string
          description: The market ticker
        queue_position_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: The number of preceding shares before the order in the queue.

    GetOrderQueuePositionsResponse:
      type: object
      required:
        - queue_positions
      properties:
        queue_positions:
          type: array
          description: Queue positions for all matching orders
          items:
            $ref: '#/components/schemas/OrderQueuePosition'

    MarketPosition:
      type: object
      required:
        - ticker
        - exchange_index
        - total_traded_dollars
        - position_fp
        - market_exposure_dollars
        - realized_pnl_dollars
        - fees_paid_dollars
        - last_updated_ts
      properties:
        ticker:
          type: string
          description: Unique identifier for the market
          x-go-type-skip-optional-pointer: true
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        total_traded_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total spent on this market in dollars
        position_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought in this market. Negative means NO contracts and positive means YES contracts
        market_exposure_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Cost of the aggregate market position in dollars
        realized_pnl_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Locked in profit and loss, in dollars
        fees_paid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fees paid on fill orders, in dollars
        last_updated_ts:
          type: string
          format: date-time
          description: Last time the position is updated

    EventPosition:
      type: object
      required:
        - event_ticker
        - total_cost_dollars
        - total_cost_shares_fp
        - event_exposure_dollars
        - realized_pnl_dollars
        - fees_paid_dollars
      properties:
        event_ticker:
          type: string
          description: Unique identifier for events
        total_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total spent on this event in dollars
        total_cost_shares_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the total number of shares traded on this event (including both YES and NO contracts)
        event_exposure_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Cost of the aggregate event position in dollars
        realized_pnl_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Locked in profit and loss, in dollars
        fees_paid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fees paid on fill orders, in dollars

    GetPositionsResponse:
      type: object
      required:
        - market_positions
        - event_positions
      properties:
        cursor:
          type: string
          description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned here in the cursor query parameter for this end-point to get the next page containing limit records. An empty value of this field indicates there is no next page.
        market_positions:
          type: array
          items:
            $ref: '#/components/schemas/MarketPosition'
          description: List of market positions
        event_positions:
          type: array
          items:
            $ref: '#/components/schemas/EventPosition'
          description: List of event positions

    Trade:
      type: object
      required:
        - trade_id
        - ticker
        - count_fp
        - yes_price_dollars
        - no_price_dollars
        - taker_outcome_side
        - taker_book_side
        - created_time
        - is_block_trade
      properties:
        trade_id:
          type: string
          description: Unique identifier for this trade
        ticker:
          type: string
          description: Unique identifier for the market
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought or sold in this trade
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Yes price for this trade in dollars
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: No price for this trade in dollars
        taker_side:
          type: string
          enum: ['yes', 'no']
          x-enum-varnames: ['TradeTakerSideYes', 'TradeTakerSideNo']
          deprecated: true
          x-go-type-skip-optional-pointer: true
          description: |
            Deprecated. Use `taker_outcome_side` (or `taker_book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
        taker_outcome_side:
          type: string
          enum: ['yes', 'no']
          x-enum-varnames: ['TradeTakerOutcomeSideYes', 'TradeTakerOutcomeSideNo']
          description: |
            The outcome side the taker is positioned for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.

            `taker_outcome_side` describes directional exposure only; it does not change the trade's price. A trade at price `p` with `taker_outcome_side=no` is matched against the maker at the same price `p` with the opposite direction — both parties trade at the same price.

            `taker_outcome_side` and `taker_book_side` will become the canonical way to determine trade direction. The legacy `taker_side` field will be deprecated in a future release — please migrate to these new fields.
        taker_book_side:
          $ref: '#/components/schemas/BookSide'
          description: |
            Same directional bit as taker_outcome_side in book vocabulary. 'bid' is equivalent to taker_outcome_side 'yes'; 'ask' is equivalent to taker_outcome_side 'no'.

            `taker_outcome_side` and `taker_book_side` will become the canonical way to determine trade direction. The legacy `taker_side` field will be deprecated in a future release — please migrate to these new fields.
        created_time:
          type: string
          format: date-time
          description: Timestamp when this trade was executed
        is_block_trade:
          type: boolean
          description: True if this trade was matched off-book as a block trade (e.g. via RFQ / negotiated block proposal); false for trades that filled on the standard order book.

    GetIncentiveProgramsResponse:
      type: object
      required:
        - incentive_programs
      properties:
        incentive_programs:
          type: array
          items:
            $ref: '#/components/schemas/IncentiveProgram'
        next_cursor:
          type: string
          description: Cursor for pagination to get the next page of results

    IncentiveProgram:
      type: object
      required:
        - id
        - market_id
        - market_ticker
        - incentive_type
        - incentive_description
        - start_date
        - end_date
        - period_reward
        - paid_out
      properties:
        id:
          type: string
          description: Unique identifier for the incentive program
        market_id:
          type: string
          description: The unique identifier of the market associated with this incentive program
        market_ticker:
          type: string
          description: The ticker symbol of the market associated with this incentive program
        incentive_type:
          type: string
          enum: ['liquidity', 'volume', 'margin_maker_volume', 'margin_taker_volume']
          description: Type of incentive program
        incentive_description:
          type: string
          description: Plain text description of the incentive program
        start_date:
          type: string
          format: date-time
          description: Start date of the incentive program
        end_date:
          type: string
          format: date-time
          description: End date of the incentive program
        period_reward:
          type: integer
          format: int64
          description: Total reward for the period in centi-cents
        paid_out:
          type: boolean
          description: Whether the incentive has been paid out
        discount_factor_bps:
          type: integer
          format: int32
          nullable: true
          description: Discount factor in basis points (optional)
        target_size_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the target size for the incentive program (optional)
        max_reward_per_account:
          type: integer
          format: int64
          nullable: true
          description: Maximum reward per account in centi-cents (optional)

    GetTradesResponse:
      type: object
      required:
        - trades
        - cursor
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/Trade'
        cursor:
          type: string

    OutcomeSide:
      type: string
      enum: ['yes', 'no']
      x-enum-varnames: ['OutcomeSideYes', 'OutcomeSideNo']
      description: Outcome side.

    Fill:
      type: object
      required:
        - fill_id
        - exchange_index
        - trade_id
        - order_id
        - ticker
        - market_ticker
        - outcome_side
        - book_side
        - count_fp
        - yes_price_dollars
        - no_price_dollars
        - is_taker
        - fee_cost
      properties:
        fill_id:
          type: string
          description: Unique identifier for this fill
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        trade_id:
          type: string
          description: Unique identifier for this fill (legacy field name, same as fill_id)
        order_id:
          type: string
          description: Unique identifier for the order that resulted in this fill
        ticker:
          type: string
          description: Unique identifier for the market
        market_ticker:
          type: string
          description: Unique identifier for the market (legacy field name, same as ticker)
        side:
          type: string
          enum: ['yes', 'no']
          deprecated: true
          x-go-type-skip-optional-pointer: true
          description: |
            Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
        action:
          type: string
          enum: ['buy', 'sell']
          deprecated: true
          x-go-type-skip-optional-pointer: true
          description: |
            Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
        outcome_side:
          $ref: '#/components/schemas/OutcomeSide'
          description: |
            The outcome side this fill positioned the user for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.

            `outcome_side` describes directional exposure only; it does not change the fill's price. A fill at price `p` with `outcome_side=no` is matched against an order at the same price `p` with `outcome_side=yes` — both parties trade at the same price, just on opposite directions.

            `outcome_side` and `book_side` will become the canonical way to determine fill direction. The legacy `action` and `side` fields will be deprecated in a future release — please migrate to these new fields.
        book_side:
          $ref: '#/components/schemas/BookSide'
          description: |
            Same directional bit as outcome_side in book vocabulary. 'bid' is equivalent to outcome_side 'yes'; 'ask' is equivalent to outcome_side 'no'.

            `outcome_side` and `book_side` will become the canonical way to determine fill direction. The legacy `action` and `side` fields will be deprecated in a future release — please migrate to these new fields.
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought or sold in this fill
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fill price for the yes side in fixed-point dollars
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fill price for the no side in fixed-point dollars
        is_taker:
          type: boolean
          description: If true, this fill was a taker (removed liquidity from the order book)
        created_time:
          type: string
          format: date-time
          description: Timestamp when this fill was executed
        fee_cost:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Fee cost in fixed-point dollars
        subaccount_number:
          type: integer
          nullable: true
          x-omitempty: true
          description: Subaccount number (0 for primary, 1-63 for subaccounts). Present for direct users.
        ts:
          type: integer
          format: int64
          description: Unix timestamp when this fill was executed (legacy field name)

    FcmFill:
      type: object
      required:
        - fill_id
        - exchange_index
        - ticker
        - taker_outcome_side
        - count_fp
        - yes_price_dollars
      properties:
        fill_id:
          type: string
          description: Fill ID.
        exchange_index:
          $ref: '#/components/schemas/ExchangeIndex'
        ticker:
          type: string
          description: Market ticker.
        taker_outcome_side:
          $ref: '#/components/schemas/OutcomeSide'
          description: Taker outcome side. The maker has the opposite outcome.
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Filled contract count.
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: YES price in dollars.
        created_time:
          type: string
          format: date-time
          description: Fill execution time.
        maker_order_id:
          type: string
          description: Maker order ID when owned by the FCM.
        maker_subtrader_id:
          type: string
          description: Maker subtrader ID when owned by the FCM.
        maker_fee_cost:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Maker fee in dollars when owned by the FCM.
        taker_order_id:
          type: string
          description: Taker order ID when owned by the FCM.
        taker_subtrader_id:
          type: string
          description: Taker subtrader ID when owned by the FCM.
        taker_fee_cost:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Taker fee in dollars when owned by the FCM.

    GetFillsResponse:
      type: object
      required:
        - fills
        - cursor
      properties:
        fills:
          type: array
          items:
            $ref: '#/components/schemas/Fill'
        cursor:
          type: string

    GetFcmFillsResponse:
      type: object
      required:
        - fills
        - cursor
      properties:
        fills:
          type: array
          items:
            $ref: '#/components/schemas/FcmFill'
        cursor:
          type: string

    # Structured Target schemas
    StructuredTarget:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the structured target.
        name:
          type: string
          description: Name of the structured target.
        type:
          type: string
          description: Type of the structured target.
        details:
          type: object
          description: Additional details about the structured target. Contains flexible JSON data specific to the target type.
        source_id:
          type: string
          description: External source identifier for the structured target, if available (e.g., third-party data provider ID).
        source_ids:
          type: object
          additionalProperties:
            type: string
          description: Source ids of structured target if available.
        last_updated_ts:
          type: string
          format: date-time
          description: Timestamp when this structured target was last updated.

    GetStructuredTargetsResponse:
      type: object
      properties:
        structured_targets:
          type: array
          items:
            $ref: '#/components/schemas/StructuredTarget'
        cursor:
          type: string
          description: Pagination cursor for the next page. Empty if there are no more results.

    GetStructuredTargetResponse:
      type: object
      properties:
        structured_target:
          $ref: '#/components/schemas/StructuredTarget'

    # Order Group schemas
    FCMSubtrader:
      type: object
      required:
        - subtrader_id
        - exchange_indices
        - trading_blocked
        - fcm_trading_blocked
        - propagation_pending
      properties:
        subtrader_id:
          type: string
          description: Full subtrader identifier owned by the authenticated FCM.
        exchange_indices:
          type: array
          description: Exchange indices where this subtrader has been observed.
          items:
            type: integer
            format: int32
        trading_blocked:
          type: boolean
          description: Effective trading block, including firm-wide and Kalshi restrictions.
        fcm_trading_blocked:
          type: boolean
          description: Whether an FCM-owned per-subtrader trading block is configured.
        propagation_pending:
          type: boolean
          description: Whether a configured per-subtrader block is awaiting engine application.

    ListFCMSubtradersResponse:
      type: object
      required:
        - subtraders
      properties:
        subtraders:
          type: array
          items:
            $ref: '#/components/schemas/FCMSubtrader'

    CreateFCMSubtraderRequest:
      type: object
      required:
        - subtrader_suffix
      properties:
        subtrader_suffix:
          type: string
          description: Suffix for the new subtrader, 1-16 case-sensitive ASCII alphanumeric characters ([A-Za-z0-9]). The full subtrader id becomes {your_account_id}_{suffix}.

    CreateFCMSubtraderResponse:
      type: object
      required:
        - subtrader_id
      properties:
        subtrader_id:
          type: string
          description: The full id of the created subtrader.

    CreateFCMPositionTransferRequest:
      type: object
      required:
        - source_subtrader_id
        - target_subtrader_id
        - market_ticker
        - position_centicount
        - price_centicents
      properties:
        source_subtrader_id:
          type: string
          description: Full id of the FCM subtrader giving up the position, as returned by `GET /fcm/subtraders`.
          x-oapi-codegen-extra-tags:
            validate: required
        target_subtrader_id:
          type: string
          description: Subtrader under your error account that receives the position, `{error_account_id}_{suffix}` with a 1-16 character alphanumeric suffix. Created if it does not exist.
          x-oapi-codegen-extra-tags:
            validate: required
        market_ticker:
          type: string
          description: Ticker of the market whose position is moved.
          x-oapi-codegen-extra-tags:
            validate: required
        position_centicount:
          type: integer
          format: int64
          description: Contracts to move, in centicounts (contracts x 100). Positive moves YES, negative moves NO. Must be a non-zero whole number of contracts, e.g. 1000 for 10 YES or -500 for 5 NO.
          x-oapi-codegen-extra-tags:
            validate: required,ne=0
        price_centicents:
          type: integer
          format: int64
          minimum: 0
          maximum: 10000
          description: YES price per contract in centicents (cents x 100), in whole cents, even when moving NO. For example, 4500 is 45 cents.
          x-oapi-codegen-extra-tags:
            validate: gte=0,lte=10000

    CreateFCMPositionTransferResponse:
      type: object
      required:
        - position_transfer_id
      properties:
        position_transfer_id:
          type: string
          description: Id of the executed transfer. Store it; no Trade API endpoint lists past transfers.

    GetFCMEventContractDailyCapResponse:
      type: object
      required:
        - subtrader_id
        - limit
        - executed_utilization
        - resting_order_utilization
        - pending_order_utilization
        - cap_date
      properties:
        subtrader_id:
          type: string
        limit:
          $ref: '#/components/schemas/FixedPointDollars'
        executed_utilization:
          $ref: '#/components/schemas/FixedPointDollars'
        resting_order_utilization:
          $ref: '#/components/schemas/FixedPointDollars'
        pending_order_utilization:
          $ref: '#/components/schemas/FixedPointDollars'
        cap_date:
          type: string
          description: The New York calendar date the executed utilization applies to. Executed utilization resets at midnight New York time; resting and pending reservations persist while their orders remain open.

    UpdateFCMEventContractDailyCapRequest:
      type: object
      required:
        - subtrader_id
        - limit
      properties:
        subtrader_id:
          type: string
          description: The subtrader whose daily cap should be set. Must belong to the requesting FCM.
        limit:
          $ref: '#/components/schemas/FixedPointDollars'

    GetFCMSubtraderBlockedCategoriesResponse:
      type: object
      required:
        - categories
      properties:
        categories:
          type: array
          description: The event categories blocked for the subtrader, sorted ascending. Empty when no categories are blocked.
          items:
            type: string

    UpdateFCMSubtraderBlockedCategoriesRequest:
      type: object
      required:
        - subtrader_id
        - category
        - blocked
      properties:
        subtrader_id:
          type: string
          description: The subtrader whose blocked categories should be updated. Must belong to the requesting FCM.
        category:
          type: string
          description: A single event category to add to or remove from the blocked set, 1-100 characters (e.g. "Politics").
        blocked:
          type: boolean
          description: True adds the category to the blocked set; false removes it. Removing a category that is not blocked is a no-op.

    UpdateFCMSubtraderBlockedCategoriesResponse:
      type: object
      required:
        - categories
      properties:
        categories:
          type: array
          description: The subtrader's full resulting blocked set, sorted ascending.
          items:
            type: string

    EmptyResponse:
      type: object
      description: An empty response body

    TargetBalanceAllocation:
      type: object
      required:
        - exchange_index
        - percent
      properties:
        exchange_index:
          type: integer
          minimum: 0
          description: Exchange index that receives this percentage of sweepable balance
        percent:
          type: integer
          minimum: 0
          maximum: 100
          description: Target percentage of sweepable balance for the exchange index

    TargetBalanceAllocationInput:
      type: object
      required:
        - exchange_index
        - percent
      properties:
        exchange_index:
          type: integer
          minimum: 0
          description: Exchange index that receives this percentage of sweepable balance
          x-go-type: '*int'
          x-oapi-codegen-extra-tags:
            validate: required,gte=0
        percent:
          type: integer
          minimum: 0
          maximum: 100
          description: Target percentage of sweepable balance for the exchange index
          x-go-type: '*int'
          x-oapi-codegen-extra-tags:
            validate: required,gte=0,lte=100

    RestingMarginReservation:
      type: string
      enum: [none, max, sum]
      x-enum-varnames: [RestingMarginReservationNone, RestingMarginReservationMax, RestingMarginReservationSum]
      description: |
        Collateral an automatic rebalance leaves behind for resting orders. `none` reserves no
        collateral for resting orders. `max` reserves the
        largest single market-side commitment. `sum` reserves the summed margin of every resting order.

    GetTargetBalanceAllocationResponse:
      type: object
      required:
        - allocations
        - resting_margin_reservation
      properties:
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/TargetBalanceAllocation'
        resting_margin_reservation:
          $ref: '#/components/schemas/RestingMarginReservation'

    SetTargetBalanceAllocationRequest:
      type: object
      required:
        - allocations
      properties:
        allocations:
          type: array
          maxItems: 101
          x-oapi-codegen-extra-tags:
            validate: max=101,dive
          items:
            $ref: '#/components/schemas/TargetBalanceAllocationInput'
        resting_margin_reservation:
          allOf:
            - $ref: '#/components/schemas/RestingMarginReservation'
          description: Defaults to `sum` when omitted.
          x-oapi-codegen-extra-tags:
            validate: omitempty,oneof=none max sum
          x-go-type-skip-optional-pointer: true

    IntraExchangeInstanceTransferRequest:
      type: object
      required:
        - source
        - destination
        - amount
      properties:
        client_transfer_id:
          type: string
          format: uuid
          description: |
            Client ID for duplicate prevention. Reuse only to retry the same request: if a transfer from the same source exchange instance and shard was already accepted with this ID, the request returns 409 and creates no new transfer. The returned transfer_id is always generated by Kalshi.
            Only supported for primary accounts. Transfers involving numbered subaccounts reject this field. If omitted, each request creates a new transfer.
        source:
          $ref: '#/components/schemas/ExchangeInstance'
          description: The source exchange instance
        destination:
          $ref: '#/components/schemas/ExchangeInstance'
          description: The destination exchange instance
        amount:
          type: integer
          format: int64
          description: The amount to transfer in centicents
        source_exchange_shard:
          type: integer
          minimum: 0
          maximum: 100
          default: 0
          x-go-type-skip-optional-pointer: true
          description: Source exchange shard index (default 0)
          x-oapi-codegen-extra-tags:
            validate: "gte=0,lte=100"
        destination_exchange_shard:
          type: integer
          minimum: 0
          maximum: 100
          default: 0
          x-go-type-skip-optional-pointer: true
          description: Destination exchange shard index (default 0)
          x-oapi-codegen-extra-tags:
            validate: "gte=0,lte=100"
        source_subaccount:
          type: integer
          default: 0
          x-go-type-skip-optional-pointer: true
          description: Source subaccount number (default 0 for the primary account). Only supported for event contract to event contract transfers.
          x-oapi-codegen-extra-tags:
            validate: "gte=0"
        destination_subaccount:
          type: integer
          default: 0
          x-go-type-skip-optional-pointer: true
          description: Destination subaccount number (default 0 for the primary account). Only supported for event contract to event contract transfers.
          x-oapi-codegen-extra-tags:
            validate: "gte=0"

    IntraExchangeInstanceTransferResponse:
      type: object
      required:
        - transfer_id
      properties:
        transfer_id:
          type: string
          description: The ID of the transfer that was created

    IntraExchangeInstanceTransferStatus:
      type: string
      enum: ['pending', 'complete']
      x-enum-varnames: ['IntraExchangeInstanceTransferStatusPending', 'IntraExchangeInstanceTransferStatusComplete']
      description: Transfer status.

    IntraExchangeInstanceTransfer:
      type: object
      required:
        - transfer_id
        - source
        - destination
        - source_exchange_shard
        - destination_exchange_shard
        - amount
        - status
        - created_ts
      properties:
        transfer_id:
          type: string
          description: Unique transfer id
        client_transfer_id:
          type: string
          x-go-type-skip-optional-pointer: true
          description: The client_transfer_id provided when the transfer was created. Omitted if none was provided.
        source:
          $ref: '#/components/schemas/ExchangeInstance'
          description: Source exchange instance
        destination:
          $ref: '#/components/schemas/ExchangeInstance'
          description: Destination exchange instance
        source_exchange_shard:
          type: integer
          description: Source exchange shard index
        destination_exchange_shard:
          type: integer
          description: Destination exchange shard index
        amount:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Transfer amount in dollars
        status:
          $ref: '#/components/schemas/IntraExchangeInstanceTransferStatus'
        created_ts:
          type: integer
          format: int64
          description: Unix timestamp when the transfer was created

    GetIntraExchangeInstanceTransfersResponse:
      type: object
      required:
        - transfers
      properties:
        transfers:
          type: array
          items:
            $ref: '#/components/schemas/IntraExchangeInstanceTransfer'
        cursor:
          type: string
          description: Cursor for the next page of results. Omitted when there are no further pages.

    GetIntraExchangeInstanceTransferResponse:
      type: object
      required:
        - transfer
      properties:
        transfer:
          $ref: '#/components/schemas/IntraExchangeInstanceTransfer'

    OrderGroup:
      type: object
      required:
        - id
        - is_auto_cancel_enabled
      properties:
        id:
          type: string
          description: Unique identifier for the order group
          x-go-type-skip-optional-pointer: true
        contracts_limit_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the current maximum contracts allowed over a rolling 15-second window.
          x-go-type-skip-optional-pointer: true
        is_auto_cancel_enabled:
          type: boolean
          description: Whether auto-cancel is enabled for this order group
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    GetOrderGroupsResponse:
      type: object
      properties:
        order_groups:
          type: array
          items:
            $ref: '#/components/schemas/OrderGroup'
          x-go-type-skip-optional-pointer: true

    GetOrderGroupResponse:
      type: object
      required:
        - is_auto_cancel_enabled
        - orders
      properties:
        is_auto_cancel_enabled:
          type: boolean
          description: Whether auto-cancel is enabled for this order group
        contracts_limit_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the current maximum contracts allowed over a rolling 15-second window.
          x-go-type-skip-optional-pointer: true
        orders:
          type: array
          items:
            type: string
          description: List of order IDs that belong to this order group
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    CreateOrderGroupRequest:
      type: object
      properties:
        subaccount:
          type: integer
          minimum: 0
          description: Optional subaccount number to use for this order group (0 for primary, 1-63 for subaccounts). Subaccount-restricted API keys must omit this field or pass their locked subaccount.
        contracts_limit:
          type: integer
          format: int64
          minimum: 1
          description: Specifies the maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: omitempty,gte=1
        contracts_limit_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          default: 0
          description: Identifier for an exchange shard. Defaults to 0.
          x-go-type-skip-optional-pointer: true

    UpdateOrderGroupLimitRequest:
      type: object
      properties:
        contracts_limit:
          type: integer
          format: int64
          minimum: 1
          description: New maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: omitempty,gte=1
        contracts_limit_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the new maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.

    CreateOrderGroupResponse:
      type: object
      required:
        - order_group_id
        - subaccount
      properties:
        order_group_id:
          type: string
          description: The unique identifier for the created order group
        subaccount:
          type: integer
          minimum: 0
          description: Subaccount number that owns the created order group (0 for primary, 1-63 for subaccounts).
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    GetCommunicationsIDResponse:
      type: object
      required:
        - communications_id
      properties:
        communications_id:
          type: string
          description: A public communications ID which is used to identify the user

    BlockTradeProposal:
      type: object
      required:
        - id
        - proposer_user_id
        - buyer_user_id
        - seller_user_id
        - market_ticker
        - price_centi_cents
        - centicount
        - maker_side
        - expiration_ts
        - status
        - created_ts
        - updated_ts
        - buyer_accepted
        - seller_accepted
      properties:
        id:
          type: string
          description: Unique identifier for the block trade proposal
        proposer_user_id:
          type: string
          description: User ID of the proposal creator
        buyer_user_id:
          type: string
          description: User ID of the buyer. Empty when the authenticated user is not the buyer.
        buyer_subtrader_id:
          type: string
          description: Subtrader ID of the buyer. Empty when the authenticated user is not the buyer.
          x-go-type-skip-optional-pointer: true
        seller_user_id:
          type: string
          description: User ID of the seller. Empty when the authenticated user is not the seller.
        seller_subtrader_id:
          type: string
          description: Subtrader ID of the seller. Empty when the authenticated user is not the seller.
          x-go-type-skip-optional-pointer: true
        market_ticker:
          type: string
          description: The ticker of the market for this block trade
        price_centi_cents:
          type: integer
          format: int64
          description: Price in centi-cents
        centicount:
          type: integer
          format: int64
          description: Number of contracts in centicounts
        maker_side:
          type: string
          description: The maker side of the trade
          enum: ['yes', 'no']
        expiration_ts:
          type: string
          format: date-time
          description: Expiration time of the proposal
        status:
          type: string
          description: Current status of the proposal
        created_ts:
          type: string
          format: date-time
          description: Timestamp when the proposal was created
        updated_ts:
          type: string
          format: date-time
          description: Timestamp when the proposal was last updated
        buyer_accepted:
          type: boolean
          description: Whether the buyer has accepted the proposal
        seller_accepted:
          type: boolean
          description: Whether the seller has accepted the proposal
        buyer_accepted_ts:
          type: string
          format: date-time
          description: Timestamp when the buyer accepted
        seller_accepted_ts:
          type: string
          format: date-time
          description: Timestamp when the seller accepted
        executed_ts:
          type: string
          format: date-time
          description: Timestamp when the proposal was executed
        buyer_order_id:
          type: string
          description: Order ID for the buyer after the proposal is executed
          x-go-type-skip-optional-pointer: true
        seller_order_id:
          type: string
          description: Order ID for the seller after the proposal is executed
          x-go-type-skip-optional-pointer: true

    GetBlockTradeProposalsResponse:
      type: object
      required:
        - block_trade_proposals
      properties:
        block_trade_proposals:
          type: array
          items:
            $ref: '#/components/schemas/BlockTradeProposal'
          description: List of block trade proposals
        cursor:
          type: string
          description: Cursor for pagination to get the next page of results
          x-go-type-skip-optional-pointer: true

    ProposeBlockTradeRequest:
      type: object
      required:
        - buyer_user_id
        - seller_user_id
        - market_ticker
        - price_centi_cents
        - centicount
        - maker_side
        - expiration_ts
      properties:
        buyer_user_id:
          type: string
          description: User ID of the buyer
          x-oapi-codegen-extra-tags:
            validate: required
        buyer_subtrader_id:
          type: string
          description: Subtrader ID of the buyer. Provide either this or buyer_subaccount, not both.
          x-go-type-skip-optional-pointer: true
        buyer_subaccount:
          type: integer
          minimum: 0
          maximum: 63
          description: User-managed subaccount number of the buyer (0 for primary, 1-63 for numbered subaccounts). Provide either this or buyer_subtrader_id, not both.
        seller_user_id:
          type: string
          description: User ID of the seller
          x-oapi-codegen-extra-tags:
            validate: required
        seller_subtrader_id:
          type: string
          description: Subtrader ID of the seller. Provide either this or seller_subaccount, not both.
          x-go-type-skip-optional-pointer: true
        seller_subaccount:
          type: integer
          minimum: 0
          maximum: 63
          description: User-managed subaccount number of the seller (0 for primary, 1-63 for numbered subaccounts). Provide either this or seller_subtrader_id, not both.
        market_ticker:
          type: string
          description: The ticker of the market for this block trade
          x-oapi-codegen-extra-tags:
            validate: required
        price_centi_cents:
          type: integer
          format: int64
          minimum: 1
          description: Price in centi-cents
          x-oapi-codegen-extra-tags:
            validate: required,gt=0
        centicount:
          type: integer
          format: int64
          minimum: 1
          description: Number of contracts in centicounts
          x-oapi-codegen-extra-tags:
            validate: required,gt=0
        maker_side:
          type: string
          description: The maker side of the trade
          enum: ['yes', 'no']
          x-oapi-codegen-extra-tags:
            validate: required,oneof=yes no
        expiration_ts:
          type: string
          format: date-time
          description: Expiration time of the proposal
          x-oapi-codegen-extra-tags:
            validate: required

    ProposeBlockTradeResponse:
      type: object
      required:
        - block_trade_proposal_id
      properties:
        block_trade_proposal_id:
          type: string
          description: The ID of the newly created block trade proposal

    AcceptBlockTradeProposalRequest:
      type: object
      properties:
        subtrader_id:
          type: string
          description: Subtrader ID to accept as. Provide either this or subaccount, not both.
          x-go-type-skip-optional-pointer: true
        subaccount:
          type: integer
          minimum: 0
          maximum: 63
          description: User-managed subaccount number to accept as (0 for primary, 1-63 for numbered subaccounts). Provide either this or subtrader_id, not both.

    RFQ:
      type: object
      required:
        - id
        - creator_id
        - contracts_fp
        - market_ticker
        - status
        - created_ts
      properties:
        id:
          type: string
          description: UUID of the RFQ. Preserve the exact returned string.
        creator_id:
          type: string
          description: Public communications ID of the RFQ creator (pseudonymous). When obscure_creator_id is enabled, other users receive the shared placeholder "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" (SHA-256 of empty input). The creator sees their normal ID. After successful quote execution, subsequent RFQ responses show the normal public communications ID to all viewers.
        market_ticker:
          type: string
          description: The ticker of the market this RFQ is for
        contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts requested in the RFQ
        target_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total value of the RFQ in dollars
        target_cost_excludes_fees:
          type: boolean
          description: >-
            True when the target cost is principal-only and quote sizes are
            computed without reserving taker fees (fees are charged on top).
          x-go-type-skip-optional-pointer: true
        status:
          type: string
          description: Current status of the RFQ (open, closed)
          enum: [open, closed]
        created_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ was created
        mve_collection_ticker:
          type: string
          description: Ticker of the MVE collection this market belongs to
          x-go-type-skip-optional-pointer: true
        mve_selected_legs:
          type: array
          x-omitempty: true
          items:
            $ref: '#/components/schemas/MveSelectedLeg'
          description: Selected legs for the MVE collection
          x-go-type-skip-optional-pointer: true
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of the RFQ after execution
        cancellation_reason:
          type: string
          description: Reason for RFQ cancellation if cancelled
          x-go-type-skip-optional-pointer: true
        creator_user_id:
          type: string
          description: User ID of the RFQ creator (private field)
          x-go-type-skip-optional-pointer: true
        creator_subaccount:
          type: integer
          description: Subaccount number of the RFQ creator (visible when the caller is the RFQ creator)
        cancelled_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ was cancelled
        updated_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ was last updated

    GetRFQsResponse:
      type: object
      required:
        - rfqs
      properties:
        rfqs:
          type: array
          items:
            $ref: '#/components/schemas/RFQ'
          description: List of RFQs matching the query criteria
        cursor:
          type: string
          description: Cursor for pagination to get the next page of results
          x-go-type-skip-optional-pointer: true

    GetRFQResponse:
      type: object
      required:
        - rfq
      properties:
        rfq:
          $ref: '#/components/schemas/RFQ'
          description: The details of the requested RFQ

    CreateRFQRequest:
      type: object
      required:
        - market_ticker
        - rest_remainder
      properties:
        market_ticker:
          type: string
          description: The ticker of the market for which to create an RFQ
        contracts:
          type: integer
          description: Whole-contract count for the RFQ. Use contracts_fp for partial contract values; if both are provided, they must match.
          x-go-type-skip-optional-pointer: true
        contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: Fixed-point number of contracts for the RFQ. Supports partial contracts in 0.01-contract increments; if contracts is also provided, both values must match.
        target_cost_centi_cents:
          type: integer
          format: int64
          description: 'DEPRECATED: The target cost for the RFQ in centi-cents. Use target_cost_dollars instead.'
          deprecated: true
          x-go-type-skip-optional-pointer: true
        target_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The target cost for the RFQ in dollars
          x-go-type-skip-optional-pointer: true
        target_cost_excludes_fees:
          type: boolean
          description: >-
            Sizes quotes against the target cost as principal only (contracts =
            target cost / price), with your taker fees charged on top of the
            target cost. By default (false) the target cost caps principal plus
            Kalshi fees, and quote sizes are reduced to make room for the fees.
            Only valid together with a target cost.
          x-go-type-skip-optional-pointer: true
        obscure_creator_id:
          type: boolean
          description: Replace the RFQ creator's public communications ID with a shared empty-input SHA-256 hash for other users. Applies to RFQ responses and broadcasts, and to quotes before successful execution. Successful execution reveals the normal ID in subsequent RFQ responses and in the executed quote. Accepting or confirming a quote does not reveal the ID. The creator always sees their normal ID. See the RFQ guide for the placeholder and visibility rules.
          default: false
          x-go-type-skip-optional-pointer: true
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of the RFQ after execution
        replace_existing:
          type: boolean
          description: Whether to delete existing RFQs as part of this RFQ's creation
          default: false
          x-go-type-skip-optional-pointer: true
        subtrader_id:
          type: string
          description: The subtrader to create the RFQ for (FCM members only)
          x-go-type-skip-optional-pointer: true
        subaccount:
          type: integer
          description: The subaccount number to create the RFQ for (direct members only; 0 for primary, 1-63 for subaccounts)

    CreateRFQResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: UUID of the newly created RFQ. Pass it unchanged in subsequent requests.

    Quote:
      type: object
      required:
        - id
        - rfq_id
        - creator_id
        - rfq_creator_id
        - market_ticker
        - contracts_fp
        - yes_bid_dollars
        - no_bid_dollars
        - created_ts
        - updated_ts
        - status
      properties:
        id:
          type: string
          description: UUID of the quote. Preserve the exact returned string.
        rfq_id:
          type: string
          description: UUID of the RFQ this quote is responding to.
        creator_id:
          type: string
          description: Public communications ID of the quote creator
        rfq_creator_id:
          type: string
          description: Public communications ID of the RFQ creator (pseudonymous). When obscure_creator_id is enabled, other users receive the shared placeholder "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" (SHA-256 of empty input). The creator sees their normal ID. After this quote executes successfully, its counterparty sees the normal public communications ID.
          x-go-type-skip-optional-pointer: true
        market_ticker:
          type: string
          description: The ticker of the market this quote is for
        contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts in the quote
        yes_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Bid price for YES contracts, in dollars
        no_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Bid price for NO contracts, in dollars
        created_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was created
        updated_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was last updated
        status:
          type: string
          description: Current status of the quote
          enum: [open, accepted, confirmed, executed, cancelled]
        accepted_side:
          type: string
          description: The side that was accepted (yes or no)
          enum: ['yes', 'no']
        accepted_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was accepted
        confirmed_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was confirmed
        executed_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was executed
        cancelled_ts:
          type: string
          format: date-time
          description: Timestamp when the quote was cancelled
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of the quote after execution
        post_only:
          type: boolean
          description: Whether the quote creator's order is post-only (visible when the caller is the quote creator)
        cancellation_reason:
          type: string
          description: Reason for quote cancellation if cancelled
          x-go-type-skip-optional-pointer: true
        creator_user_id:
          type: string
          description: User ID of the quote creator (private field)
          x-go-type-skip-optional-pointer: true
        rfq_creator_user_id:
          type: string
          description: User ID of the RFQ creator (private field)
          x-go-type-skip-optional-pointer: true
        rfq_target_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Total value requested in the RFQ in dollars
        target_cost_excludes_fees:
          type: boolean
          description: >-
            True when the RFQ's target cost is principal-only and the
            contracts-offered sizes were computed without reserving taker fees
            (fees are charged on top of the target cost).
          x-go-type-skip-optional-pointer: true
        rfq_creator_order_id:
          type: string
          description: Order ID for the RFQ creator (private field)
          x-go-type-skip-optional-pointer: true
        creator_order_id:
          type: string
          description: Order ID for the quote creator (private field)
          x-go-type-skip-optional-pointer: true
        creator_subaccount:
          type: integer
          description: Subaccount number of the quote creator (visible when the caller is the quote creator)
        rfq_creator_subaccount:
          type: integer
          description: Subaccount number of the RFQ creator (visible when the caller is the RFQ creator)
        yes_contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of YES contracts offered in the quote (fixed-point)
        no_contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of NO contracts offered in the quote (fixed-point)

    GetQuotesResponse:
      type: object
      required:
        - quotes
      properties:
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/Quote'
          description: List of quotes matching the query criteria
        cursor:
          type: string
          description: Cursor for pagination to get the next page of results
          x-go-type-skip-optional-pointer: true

    GetQuoteResponse:
      type: object
      required:
        - quote
      properties:
        quote:
          $ref: '#/components/schemas/Quote'
          description: The details of the requested quote

    CreateQuoteRequest:
      type: object
      required:
        - rfq_id
        - yes_bid
        - no_bid
        - rest_remainder
      properties:
        rfq_id:
          type: string
          description: The UUID of the RFQ to quote on. Pass the RFQ ID unchanged; malformed IDs return HTTP 400.
        yes_bid:
          type: string
          $ref: '#/components/schemas/FixedPointDollars'
          description: The bid price for YES contracts, in dollars
        no_bid:
          type: string
          $ref: '#/components/schemas/FixedPointDollars'
          description: The bid price for NO contracts, in dollars
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of the quote after execution
        post_only:
          type: boolean
          description: If true, the quote creator's resting order will be cancelled rather than crossed if it would take liquidity. Defaults to false.
        subaccount:
          type: integer
          description: Optional subaccount number to place the quote under (0 for primary, 1-63 for subaccounts)

    CreateQuoteResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: UUID of the newly created quote. Pass it unchanged in subsequent requests.

    AcceptQuoteRequest:
      type: object
      required:
        - accepted_side
      properties:
        accepted_side:
          type: string
          description: The side of the quote to accept (yes or no)
          enum: ['yes', 'no']

    RFQBatchStatus:
      type: string
      description: Status of an RFQ batch. An open batch takes batch quotes; an accepted batch is waiting for its winning makers to confirm or is executing; a closed batch is finished.
      enum: [open, accepted, closed]

    RFQBatch:
      type: object
      required:
        - id
        - creator_id
        - status
        - created_ts
        - rfqs
      properties:
        id:
          type: string
          description: UUID of the RFQ batch. Preserve the exact returned string.
        creator_id:
          type: string
          description: Public communications ID of the batch creator, obscured for other users like RFQ.creator_id when obscure_creator_id was set. It is revealed once a child RFQ executes.
        status:
          $ref: '#/components/schemas/RFQBatchStatus'
        created_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ batch was created
        accepted_ts:
          type: string
          format: date-time
          description: Timestamp when a batch quote on the batch was accepted
        closed_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ batch closed
        rfqs:
          type: array
          items:
            $ref: '#/components/schemas/RFQ'
          description: The child RFQs, in the order they were requested
        updated_ts:
          type: string
          format: date-time
          description: Timestamp when the RFQ batch was last updated (visible to the batch creator)
        close_reason:
          type: string
          description: Why the RFQ batch closed, for example executed, partially executed, or cancelled (visible to the batch creator)
          x-go-type-skip-optional-pointer: true
        client_batch_id:
          type: string
          description: The client_batch_id given at creation (visible to the batch creator)
          x-go-type-skip-optional-pointer: true
        creator_user_id:
          type: string
          description: User ID of the batch creator (private field)
          x-go-type-skip-optional-pointer: true
        creator_subaccount:
          type: integer
          description: Subaccount number of the batch creator (visible to the batch creator)

    GetRFQBatchResponse:
      type: object
      required:
        - rfq_batch
      properties:
        rfq_batch:
          $ref: '#/components/schemas/RFQBatch'

    GetRFQBatchesResponse:
      type: object
      required:
        - rfq_batches
      properties:
        rfq_batches:
          type: array
          items:
            $ref: '#/components/schemas/RFQBatch'
          description: RFQ batches matching the query criteria
        cursor:
          type: string
          description: Cursor for pagination to get the next page of results
          x-go-type-skip-optional-pointer: true

    CreateRFQBatchChild:
      type: object
      description: One combo to request quotes on. Set exactly one of market_ticker and selected_markets.
      properties:
        market_ticker:
          type: string
          description: Ticker of an existing combo market
          x-go-type-skip-optional-pointer: true
        selected_markets:
          type: array
          maxItems: 6
          items:
            $ref: '#/components/schemas/TickerPair'
          description: Legs of the combo, at most 6, looked up or created in the request's mve_collection_ticker as POST /multivariate_event_collections/{collection_ticker} does.
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: omitempty,max=6,dive

    CreateRFQBatchRequest:
      type: object
      required:
        - children
      properties:
        children:
          type: array
          minItems: 2
          maxItems: 57
          items:
            $ref: '#/components/schemas/CreateRFQBatchChild'
          description: The combos to request quotes on, one child RFQ each. Children must be distinct combos.
          x-oapi-codegen-extra-tags:
            validate: required,min=2,max=57,dive
        mve_collection_ticker:
          type: string
          description: Collection in which children given by selected_markets are looked up or created. Required when any child uses selected_markets.
          x-go-type-skip-optional-pointer: true
        contracts_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: Number of contracts requested on every child. Provide exactly one of contracts_fp and target_cost_dollars.
        target_cost_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Target cost of every child, in dollars. Provide exactly one of contracts_fp and target_cost_dollars.
          x-go-type-skip-optional-pointer: true
        target_cost_excludes_fees:
          type: boolean
          description: Same as on Create RFQ, applied to every child. Only valid together with target_cost_dollars.
          x-go-type-skip-optional-pointer: true
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of each child RFQ after execution
          default: false
          x-go-type-skip-optional-pointer: true
        replace_existing:
          type: boolean
          description: Close your oldest open RFQ batches as needed so this one can be created. Single RFQs are never replaced.
          default: false
          x-go-type-skip-optional-pointer: true
        obscure_creator_id:
          type: boolean
          description: Same as on Create RFQ, applied to the batch and every child.
          default: false
          x-go-type-skip-optional-pointer: true
        client_batch_id:
          type: string
          maxLength: 64
          x-oapi-codegen-extra-tags:
            validate: "omitempty,max=64"
          description: Optional key for this batch, unique among your RFQ batches, including those closed within the last seven days. Reusing one returns HTTP 409.
          x-go-type-skip-optional-pointer: true
        subtrader_id:
          type: string
          description: The subtrader to create the RFQ batch for (FCM members only)
          x-go-type-skip-optional-pointer: true
        subaccount:
          type: integer
          description: The subaccount number to create the RFQ batch for (direct members only; 0 for primary, 1-63 for subaccounts)

    CreateRFQBatchResponse:
      type: object
      required:
        - rfq_batch
      properties:
        rfq_batch:
          $ref: '#/components/schemas/RFQBatch'

    RFQBatchQuoteStatus:
      type: string
      description: Status of a batch quote. A partially_executed batch quote executed some children and failed others.
      enum: [open, accepted, confirmed, executed, partially_executed, cancelled]

    RFQBatchQuote:
      type: object
      description: One maker's quote on an RFQ batch. Once the batch is accepted, quotes lists only the children this maker won.
      required:
        - id
        - rfq_batch_id
        - creator_id
        - rfq_creator_id
        - status
        - created_ts
        - updated_ts
        - quotes
      properties:
        id:
          type: string
          description: UUID of the batch quote. Preserve the exact returned string.
        rfq_batch_id:
          type: string
          description: UUID of the RFQ batch this batch quote prices
        creator_id:
          type: string
          description: Public communications ID of the batch quote creator
        rfq_creator_id:
          type: string
          description: Public communications ID of the RFQ batch creator, obscured like Quote.rfq_creator_id
        status:
          $ref: '#/components/schemas/RFQBatchQuoteStatus'
        created_ts:
          type: string
          format: date-time
          description: Timestamp when the batch quote was created
        updated_ts:
          type: string
          format: date-time
          description: Timestamp when the batch quote was last updated
        accepted_side:
          type: string
          description: The side that was accepted on this maker's children (yes or no)
          enum: ['yes', 'no']
          x-enum-varnames: ['RFQBatchQuoteAcceptedSideYes', 'RFQBatchQuoteAcceptedSideNo']
        accepted_ts:
          type: string
          format: date-time
          description: Timestamp when the batch quote was accepted
        confirmed_ts:
          type: string
          format: date-time
          description: Timestamp when the batch quote was confirmed
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/Quote'
          description: One quote per child RFQ, or once accepted one per child this maker won; match them to children by rfq_id. Each accepted child quote executes as its own trade.
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of each child quote after execution (visible to the batch quote creator)
        post_only:
          type: boolean
          description: Whether the batch quote creator's orders are post-only (visible to the batch quote creator)
        creator_user_id:
          type: string
          description: User ID of the batch quote creator (private field)
          x-go-type-skip-optional-pointer: true
        creator_subaccount:
          type: integer
          description: Subaccount number of the batch quote creator (visible to the batch quote creator)
        rfq_creator_user_id:
          type: string
          description: User ID of the RFQ batch creator (private field)
          x-go-type-skip-optional-pointer: true
        rfq_creator_subaccount:
          type: integer
          description: Subaccount number of the RFQ batch creator (visible to the RFQ batch creator)

    GetRFQBatchQuotesResponse:
      type: object
      required:
        - batch_quotes
      properties:
        batch_quotes:
          type: array
          items:
            $ref: '#/components/schemas/RFQBatchQuote'
          description: Batch quotes on the RFQ batch visible to you

    RFQBatchQuoteEntry:
      type: object
      required:
        - rfq_id
        - yes_bid
        - no_bid
      properties:
        rfq_id:
          type: string
          description: UUID of the child RFQ to price. Pass it unchanged; malformed IDs return HTTP 400.
        yes_bid:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The bid price for YES contracts on this child, in dollars
        no_bid:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The bid price for NO contracts on this child, in dollars

    CreateRFQBatchQuoteRequest:
      type: object
      required:
        - quotes
        - rest_remainder
      properties:
        quotes:
          type: array
          minItems: 2
          maxItems: 57
          items:
            $ref: '#/components/schemas/RFQBatchQuoteEntry'
          description: Prices for every child RFQ of the batch, one entry per child.
          x-oapi-codegen-extra-tags:
            validate: required,min=2,max=57,dive
        rest_remainder:
          type: boolean
          description: Whether to rest the remainder of each child quote after execution
        post_only:
          type: boolean
          description: If true, your resting orders are cancelled rather than crossed if they would take liquidity. Defaults to false.
        subaccount:
          type: integer
          description: Optional subaccount number to place the batch quote under (0 for primary, 1-63 for subaccounts)

    CreateRFQBatchQuoteResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: UUID of the newly created batch quote. Pass it unchanged in subsequent requests.

    RFQBatchBestQuote:
      type: object
      required:
        - rfq_id
        - market_ticker
      properties:
        rfq_id:
          type: string
          description: UUID of the child RFQ
        market_ticker:
          type: string
          description: The child's combo market
        yes_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Best YES bid across makers, in dollars; absent when no maker bids YES
        no_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Best NO bid across makers, in dollars; absent when no maker bids NO
        yes_contracts_offered_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Contracts the best YES bid offers
        no_contracts_offered_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Contracts the best NO bid offers

    RFQBatchBestQuotes:
      type: object
      required:
        - rfq_batch_id
        - status
        - version
        - yes_complete
        - no_complete
        - rfqs
      properties:
        rfq_batch_id:
          type: string
          description: UUID of the RFQ batch
        status:
          $ref: '#/components/schemas/RFQBatchStatus'
        version:
          type: integer
          format: int64
          description: Increases whenever a best bid changes
        updated_ts:
          type: string
          format: date-time
          description: When a best bid last changed
        yes_complete:
          type: boolean
          description: Whether every child has a YES bid, so the batch can be accepted on the yes side
        no_complete:
          type: boolean
          description: Whether every child has a NO bid, so the batch can be accepted on the no side
        rfqs:
          type: array
          items:
            $ref: '#/components/schemas/RFQBatchBestQuote'
          description: One entry per child RFQ, in batch order

    GetRFQBatchBestQuotesResponse:
      type: object
      required:
        - best_quotes
      properties:
        best_quotes:
          $ref: '#/components/schemas/RFQBatchBestQuotes'

    RFQBatchAcceptLimit:
      type: object
      required:
        - rfq_id
        - bid_dollars
      properties:
        rfq_id:
          type: string
          description: UUID of the child RFQ. Pass it unchanged; malformed IDs return HTTP 400.
        bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The lowest bid you take on this child on the accepted side, normally the best bid you were shown

    AcceptRFQBatchRequest:
      type: object
      required:
        - accepted_side
        - min_bids
      properties:
        accepted_side:
          type: string
          description: The side to accept on every child (yes or no)
          enum: ['yes', 'no']
          x-enum-varnames: ['AcceptRFQBatchRequestAcceptedSideYes', 'AcceptRFQBatchRequestAcceptedSideNo']
        min_bids:
          type: array
          minItems: 2
          maxItems: 57
          items:
            $ref: '#/components/schemas/RFQBatchAcceptLimit'
          description: Price protection, exactly one entry per child. A child whose best bid on the accepted side is now below its entry fails the accept.
          x-oapi-codegen-extra-tags:
            validate: required,min=2,max=57,dive
        client_order_id:
          type: string
          description: Optional idempotency key. Retrying an accept with the same client_order_id returns the result of the accept that succeeded.
          x-go-type-skip-optional-pointer: true

    AcceptRFQBatchResponse:
      type: object
      required:
        - accepted_side
        - quotes
      properties:
        accepted_side:
          type: string
          description: The side accepted on every child (yes or no)
          enum: ['yes', 'no']
          x-enum-varnames: ['AcceptRFQBatchResponseAcceptedSideYes', 'AcceptRFQBatchResponseAcceptedSideNo']
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/Quote'
          description: The quote each child was accepted from, in batch order. Each winning maker then confirms its children.

    # Order schemas
    GetOrderResponse:
      type: object
      required:
        - order
      properties:
        order:
          $ref: '#/components/schemas/Order'

    CreateOrderRequest:
      type: object
      required:
        - ticker
        - side
        - action
      properties:
        ticker:
          type: string
          x-oapi-codegen-extra-tags:
            validate: required,min=1
        client_order_id:
          type: string
          x-go-type-skip-optional-pointer: true
        side:
          type: string
          enum: ['yes', 'no']
          x-oapi-codegen-extra-tags:
            validate: required,oneof=yes no
        action:
          type: string
          enum: ['buy', 'sell']
          x-oapi-codegen-extra-tags:
            validate: required,oneof=buy sell
        count:
          type: integer
          minimum: 1
          description: Order quantity in contracts (whole contracts only). Provide count or count_fp; if both provided they must match.
          x-go-type-skip-optional-pointer: true
          x-oapi-codegen-extra-tags:
            validate: omitempty,gte=1
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the order quantity in contracts. Provide count or count_fp; if both provided they must match.
        yes_price:
          type: integer
          minimum: 1
          maximum: 99
          x-go-type-skip-optional-pointer: true
        no_price:
          type: integer
          minimum: 1
          maximum: 99
          x-go-type-skip-optional-pointer: true
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Submitting price of the Yes side in fixed-point dollars
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Submitting price of the No side in fixed-point dollars
        expiration_ts:
          type: integer
          format: int64
          description: |
            Optional Unix timestamp in seconds for when the order expires. To place
            an expiring order, set `time_in_force` to `good_till_canceled` and
            provide this `expiration_ts`. `GTT` is an internal execution type and is
            not a valid API value for `time_in_force`. The `immediate_or_cancel`
            time-in-force value cannot be combined with `expiration_ts`.
        time_in_force:
          type: string
          description: |
            Specifies how long the order remains active. Use `good_till_canceled`
            with `expiration_ts` for an order that should rest until a specific
            expiration time; without `expiration_ts`, `good_till_canceled` is a
            true good-till-canceled order. `GTT` is not a valid API value.
          enum: ['fill_or_kill', 'good_till_canceled', 'immediate_or_cancel']
          x-oapi-codegen-extra-tags:
            validate: omitempty,oneof=fill_or_kill good_till_canceled immediate_or_cancel
          x-go-type-skip-optional-pointer: true
        buy_max_cost:
          type: integer
          description: Maximum cost in cents. When specified, the order will automatically have Fill-or-Kill (FoK) behavior.
        post_only:
          type: boolean
        reduce_only:
          type: boolean
        sell_position_floor:
          type: integer
          description: "Deprecated: Use reduce_only instead. Only accepts value of 0."
        self_trade_prevention_type:
          allOf:
            - $ref: '#/components/schemas/SelfTradePreventionType'
          x-oapi-codegen-extra-tags:
            validate: omitempty,oneof=taker_at_cross maker
          x-go-type-skip-optional-pointer: true
        order_group_id:
          type: string
          description: The order group this order is part of
          x-go-type-skip-optional-pointer: true
        cancel_order_on_pause:
          type: boolean
          description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
        subaccount:
          type: integer
          minimum: 0
          default: 0
          description: The subaccount number to use for this order. 0 is the primary subaccount.
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          default: 0
          description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
          x-go-type-skip-optional-pointer: true

    CreateOrderResponse:
      type: object
      required:
        - order
      properties:
        order:
          $ref: '#/components/schemas/Order'

    BatchCreateOrdersRequest:
      type: object
      required:
        - orders
      properties:
        orders:
          type: array
          x-oapi-codegen-extra-tags:
            validate: required,dive
          items:
            $ref: '#/components/schemas/CreateOrderRequest'

    BatchCreateOrdersResponse:
      type: object
      required:
        - orders
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/BatchCreateOrdersIndividualResponse'

    BatchCreateOrdersIndividualResponse:
      type: object
      properties:
        client_order_id:
          type: string
          nullable: true
        order:
          allOf:
           - $ref: '#/components/schemas/Order'
          nullable: true
        error:
          allOf:
           - $ref: '#/components/schemas/ErrorResponse'
          nullable: true

    BatchCancelOrdersRequest:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: An array of order IDs to cancel
          deprecated: true
        orders:
          type: array
          items:
            $ref: '#/components/schemas/BatchCancelOrdersRequestOrder'
          description: An array of orders to cancel, each optionally specifying a subaccount

    BatchCancelOrdersRequestOrder:
      type: object
      required:
        - order_id
      properties:
        order_id:
          type: string
          description: Order ID to cancel
        subaccount:
          type: integer
          minimum: 0
          default: 0
          description: Optional subaccount number to use for this cancellation (0 for primary, 1-63 for subaccounts)
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          default: 0
          description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
          x-go-type-skip-optional-pointer: true
        market_ticker:
          type: string
          description: Market ticker. Required when exchange_index is -1 (auto).
          x-go-type-skip-optional-pointer: true

    BatchCancelOrdersResponse:
      type: object
      required:
        - orders
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/BatchCancelOrdersIndividualResponse'

    BatchCancelOrdersIndividualResponse:
      type: object
      required:
        - order_id
        - reduced_by_fp
      properties:
        order_id:
          type: string
          description: The order ID to identify which order had an error during batch cancellation
        order:
          allOf:
            - $ref: '#/components/schemas/Order'
          nullable: true
        reduced_by_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts that were successfully canceled from this order
        error:
          allOf:
            - $ref: '#/components/schemas/ErrorResponse'
          nullable: true

    AmendOrderRequest:
      type: object
      required:
        - ticker
        - side
        - action
      properties:
        subaccount:
          type: integer
          minimum: 0
          description: Optional subaccount number to use for this amendment (0 for primary, 1-63 for subaccounts)
          default: 0
          x-go-type-skip-optional-pointer: true
        ticker:
          type: string
          description: Market ticker
        side:
          type: string
          enum: ["yes", "no"]
          description: Side of the order
        action:
          type: string
          enum: ["buy", "sell"]
          description: Action of the order
        client_order_id:
          type: string
          description: The original client-specified order ID to be amended
          x-go-type-skip-optional-pointer: true
        updated_client_order_id:
          type: string
          description: The new client-specified order ID after amendment
          x-go-type-skip-optional-pointer: true
        yes_price:
          type: integer
          minimum: 1
          maximum: 99
          description: Updated yes price for the order in cents
        no_price:
          type: integer
          minimum: 1
          maximum: 99
          description: Updated no price for the order in cents
        yes_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Updated yes price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
        no_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Updated no price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
        count:
          type: integer
          minimum: 1
          description: Updated quantity for the order (whole contracts only). If updating quantity, provide count or count_fp; if both provided they must match.
        count_fp:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the updated quantity for the order. If updating quantity, provide count or count_fp; if both provided they must match.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          default: 0
          description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
          x-go-type-skip-optional-pointer: true

    AmendOrderResponse:
      type: object
      required:
        - old_order
        - order
      properties:
        old_order:
          $ref: '#/components/schemas/Order'
          description: The order before amendment
        order:
          $ref: '#/components/schemas/Order'
          description: The order after amendment

    CreateOrderV2Request:
      type: object
      required:
        - ticker
        - side
        - count
        - price
        - time_in_force
        - self_trade_prevention_type
      example:
        ticker: HIGHNY-24JAN01-T60
        client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
        side: bid
        count: "10.00"
        price: "0.5600"
        time_in_force: good_till_canceled
        self_trade_prevention_type: taker_at_cross
        post_only: false
        cancel_order_on_pause: false
        reduce_only: false
        subaccount: 0
        exchange_index: 0
      properties:
        ticker:
          type: string
          x-oapi-codegen-extra-tags:
            validate: required,min=1
        client_order_id:
          type: string
          x-go-type-skip-optional-pointer: true
        side:
          $ref: '#/components/schemas/BookSide'
          x-oapi-codegen-extra-tags:
            validate: required,oneof=bid ask
        count:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the order quantity in contracts.
        price:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the order in fixed-point dollars.
          x-go-type-skip-optional-pointer: true
        expiration_time:
          type: integer
          format: int64
          description: |
            Optional Unix timestamp in seconds for when the order expires. To place
            an expiring order, set `time_in_force` to `good_till_canceled` and
            provide this `expiration_time`. `GTT` is an internal execution type and
            is not a valid API value for `time_in_force`. The
            `immediate_or_cancel` time-in-force value cannot be combined with
            `expiration_time`.
        time_in_force:
          type: string
          description: |
            Specifies how long the order remains active. Use `good_till_canceled`
            with `expiration_time` for an order that should rest until a specific
            expiration time; without `expiration_time`, `good_till_canceled` is a
            true good-till-canceled order. `GTT` is not a valid API value.
          enum: ['fill_or_kill', 'good_till_canceled', 'immediate_or_cancel']
          x-oapi-codegen-extra-tags:
            validate: required,oneof=fill_or_kill good_till_canceled immediate_or_cancel
          x-go-type-skip-optional-pointer: true
        post_only:
          type: boolean
        self_trade_prevention_type:
          allOf:
            - $ref: '#/components/schemas/SelfTradePreventionType'
          x-oapi-codegen-extra-tags:
            validate: required,oneof=taker_at_cross maker
          x-go-type-skip-optional-pointer: true
        cancel_order_on_pause:
          type: boolean
          description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
        reduce_only:
          type: boolean
          description: Specifies whether the order place count should be capped by the member's current position. Orders with reduce_only set to true will be rejected unless time_in_force is immediate_or_cancel.
        subaccount:
          type: integer
          minimum: 0
          description: The subaccount number to use for this order. 0 is the primary subaccount. Subaccount-restricted API keys must omit this field or pass their locked subaccount.
        order_group_id:
          type: string
          description: The order group this order is part of
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: "Exchange shard index. If omitted, auto-routes when ticker is provided; otherwise defaults to 0. Use -1 to require auto-routing by ticker."

    CreateOrderV2Response:
      type: object
      required:
        - order_id
        - fill_count
        - remaining_count
        - ts_ms
      example:
        order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
        client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
        fill_count: "0.00"
        remaining_count: "10.00"
        ts_ms: 1715793600123
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        fill_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts filled immediately upon placement.
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts remaining after placement. For IOC orders, this reflects the final state after unfilled contracts are canceled.
        average_fill_price:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Volume-weighted average fill price. Only present when fill_count > 0.
        average_fee_paid:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Volume-weighted average fee paid per contract for fills resulting from this request. Only present when fill_count > 0.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the order was processed, as Unix epoch milliseconds.

    CancelOrderV2Response:
      type: object
      required:
        - order_id
        - reduced_by
        - ts_ms
      example:
        order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
        client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
        reduced_by: "10.00"
        ts_ms: 1715793660456
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        reduced_by:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts that were canceled (i.e. the remaining count at time of cancellation).
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the cancellation was processed, as Unix epoch milliseconds.

    DecreaseOrderV2Request:
      type: object
      example:
        reduce_by: "2.00"
        exchange_index: 0
      properties:
        reduce_by:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the number of contracts to reduce by. Exactly one of `reduce_by` or `reduce_to` must be provided.
        reduce_to:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          description: String representation of the number of contracts to reduce to. Exactly one of `reduce_by` or `reduce_to` must be provided.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: "Exchange shard index. If omitted, auto-routes when market_ticker is provided; otherwise defaults to 0. Use -1 to require auto-routing by market ticker."
        market_ticker:
          type: string
          description: Market ticker used for auto-routing when exchange_index is omitted or -1.
          x-go-type-skip-optional-pointer: true

    DecreaseOrderV2Response:
      type: object
      required:
        - order_id
        - remaining_count
        - ts_ms
      example:
        order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
        client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
        remaining_count: "8.00"
        ts_ms: 1715793680789
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Number of contracts remaining after the decrease.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the decrease was processed, as Unix epoch milliseconds.

    AmendOrderV2Request:
      type: object
      required:
        - ticker
        - side
        - price
        - count
      example:
        ticker: HIGHNY-24JAN01-T60
        side: bid
        price: "0.5700"
        count: "8.00"
        client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
        updated_client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
        exchange_index: 0
      properties:
        ticker:
          type: string
          description: Market ticker
          x-oapi-codegen-extra-tags:
            validate: required,min=1
        side:
          $ref: '#/components/schemas/BookSide'
          description: Side of the order
          x-oapi-codegen-extra-tags:
            validate: required,oneof=bid ask
        price:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Updated price for the order in fixed-point dollars.
          x-go-type-skip-optional-pointer: true
        count:
          $ref: '#/components/schemas/FixedPointCount'
          description: Updated total/max fillable count for the order. Set this to the order's already filled count plus the desired resting remaining count after the amend.
          x-go-type-skip-optional-pointer: true
        client_order_id:
          type: string
          description: The original client-specified order ID to be amended
          x-go-type-skip-optional-pointer: true
        updated_client_order_id:
          type: string
          description: The new client-specified order ID after amendment
          x-go-type-skip-optional-pointer: true
        expiration_time:
          type: integer
          format: int64
          minimum: 0
          description: >-
            New Unix expiration timestamp in seconds. Omit to preserve the current
            expiry, or use 0 to remove it (good-till-canceled). A nonzero expiry
            must be in the future. Send the current price and total quantity for
            an expiry-only amendment; this preserves queue position.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: "Exchange shard index. If omitted, auto-routes when ticker is provided; otherwise defaults to 0. Use -1 to require auto-routing by ticker."

    AmendOrderV2Response:
      type: object
      required:
        - order_id
        - ts_ms
      example:
        order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
        client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
        remaining_count: "8.00"
        fill_count: "0.00"
        ts_ms: 1715793690123
      properties:
        order_id:
          type: string
        client_order_id:
          type: string
        remaining_count:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          x-omitempty: false
          description: Number of resting contracts remaining after the amend. This is the actual post-amend resting quantity, not the request's total/max fillable count. Only present when the amend caused a fill or changed the resting size.
        fill_count:
          $ref: '#/components/schemas/FixedPointCount'
          nullable: true
          x-omitempty: false
          description: Number of contracts filled as a result of the amend crossing the book. Only present when fills occurred or remaining size changed.
        average_fill_price:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          x-omitempty: false
          description: Volume-weighted average fill price for fills resulting from the amend. Only present when fills occurred.
        average_fee_paid:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          x-omitempty: false
          description: Volume-weighted average fee paid per contract for fills resulting from the amend. Only present when fills occurred.
        ts_ms:
          type: integer
          format: int64
          description: Matching engine timestamp at which the amend was processed, as Unix epoch milliseconds.

    BatchCreateOrdersV2Request:
      type: object
      required:
        - orders
      example:
        orders:
          - ticker: HIGHNY-24JAN01-T60
            client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
            side: bid
            count: "10.00"
            price: "0.5600"
            time_in_force: good_till_canceled
            self_trade_prevention_type: taker_at_cross
            exchange_index: 0
          - ticker: HIGHNY-24JAN01-T60
            client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
            side: ask
            count: "5.00"
            price: "0.5800"
            time_in_force: immediate_or_cancel
            self_trade_prevention_type: maker
            exchange_index: 0
      properties:
        orders:
          type: array
          x-oapi-codegen-extra-tags:
            validate: required,dive
          items:
            $ref: '#/components/schemas/CreateOrderV2Request'

    BatchCreateOrdersV2Response:
      type: object
      required:
        - orders
      example:
        orders:
          - order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
            client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
            fill_count: "0.00"
            remaining_count: "10.00"
            ts_ms: 1715793600123
          - order_id: a6d6010d-6d5f-40a1-a7e7-5501386bb621
            client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
            fill_count: "5.00"
            remaining_count: "0.00"
            average_fill_price: "0.5800"
            average_fee_paid: "0.0012"
            ts_ms: 1715793600456
      properties:
        orders:
          type: array
          items:
            type: object
            properties:
              order_id:
                type: string
              client_order_id:
                type: string
                nullable: true
              fill_count:
                $ref: '#/components/schemas/FixedPointCount'
                nullable: true
                x-omitempty: false
                description: Number of contracts filled immediately upon placement.
              remaining_count:
                $ref: '#/components/schemas/FixedPointCount'
                nullable: true
                x-omitempty: false
                description: Number of contracts remaining after placement.
              average_fill_price:
                $ref: '#/components/schemas/FixedPointDollars'
                nullable: true
                x-omitempty: false
                description: Volume-weighted average fill price. Only present when fill_count > 0.
              average_fee_paid:
                $ref: '#/components/schemas/FixedPointDollars'
                nullable: true
                x-omitempty: false
                description: Volume-weighted average fee paid per contract. Only present when fill_count > 0.
              ts_ms:
                type: integer
                format: int64
                nullable: true
                x-omitempty: false
                description: Matching engine timestamp at which the order was processed, as Unix epoch milliseconds. Absent when the request errored.
              error:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                nullable: true

    BatchCancelOrdersV2Request:
      type: object
      required:
        - orders
      example:
        orders:
          - order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
            subaccount: 0
            exchange_index: 0
          - order_id: a6d6010d-6d5f-40a1-a7e7-5501386bb621
            subaccount: 0
            exchange_index: 0
      properties:
        orders:
          type: array
          x-oapi-codegen-extra-tags:
            validate: required,dive
          description: An array of orders to cancel, each optionally specifying a subaccount.
          items:
            type: object
            required:
              - order_id
            properties:
              order_id:
                type: string
                description: Order ID to cancel.
              subaccount:
                type: integer
                minimum: 0
                description: Optional subaccount number to use for this cancellation (0 for primary, 1-63 for subaccounts). Subaccount-restricted API keys must omit this field or pass their locked subaccount.
              exchange_index:
                allOf:
                  - $ref: '#/components/schemas/ExchangeIndex'
                description: "Exchange shard index. If omitted, auto-routes when market_ticker is provided; otherwise defaults to 0. Use -1 to require auto-routing. The market_ticker field is required for auto-routing."
              market_ticker:
                type: string
                description: Market ticker. Required for auto-routing when exchange_index is omitted or -1.
                x-go-type-skip-optional-pointer: true

    BatchCancelOrdersV2Response:
      type: object
      required:
        - orders
      example:
        orders:
          - order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
            client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
            reduced_by: "10.00"
            ts_ms: 1715793660456
          - order_id: a6d6010d-6d5f-40a1-a7e7-5501386bb621
            client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
            reduced_by: "5.00"
            ts_ms: 1715793660789
      properties:
        orders:
          type: array
          items:
            type: object
            required:
              - order_id
              - reduced_by
            properties:
              order_id:
                type: string
                description: The order ID identifying which order this entry corresponds to.
              client_order_id:
                type: string
                nullable: true
              reduced_by:
                $ref: '#/components/schemas/FixedPointCount'
                description: Number of contracts that were canceled (i.e. the remaining count at time of cancellation). Zero if the cancel errored.
              ts_ms:
                type: integer
                format: int64
                nullable: true
                x-omitempty: false
                description: Matching engine timestamp at which the cancellation was processed, as Unix epoch milliseconds. Absent when the cancel errored.
              error:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                nullable: true

    # Multivariate Event Collection schemas
    AssociatedEvent:
      type: object
      required:
        - ticker
        - is_yes_only
        - active_quoters
      properties:
        ticker:
          type: string
          description: The event ticker.
        is_yes_only:
          type: boolean
          description: Whether only the 'yes' side can be used for this event.
        size_max:
          type: integer
          format: int32
          nullable: true
          description: Maximum number of markets from this event (inclusive). Null means no limit.
        size_min:
          type: integer
          format: int32
          nullable: true
          description: Minimum number of markets from this event (inclusive). Null means no limit.
        active_quoters:
          type: array
          items:
            type: string
          description: List of active quoters for this event.

    MultivariateEventCollection:
      type: object
      required:
        - collection_ticker
        - series_ticker
        - title
        - description
        - open_date
        - close_date
        - associated_events
        - associated_event_tickers
        - is_ordered
        - is_single_market_per_event
        - is_all_yes
        - size_min
        - size_max
        - functional_description
        - price_level_structure
        - price_ranges
      properties:
        collection_ticker:
          type: string
          description: Unique identifier for the collection.
        series_ticker:
          type: string
          description: Series associated with the collection. Events produced in the collection will be associated with this series.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          description: Exchange index inherited from the collection's series.
          x-go-type-skip-optional-pointer: true
          x-omitempty: false
        title:
          type: string
          description: Title of the collection.
        description:
          type: string
          description: Short description of the collection.
        open_date:
          type: string
          format: date-time
          description: The open date of the collection. Before this time, the collection cannot be interacted with.
        close_date:
          type: string
          format: date-time
          description: The close date of the collection. After this time, the collection cannot be interacted with.
        associated_events:
          type: array
          items:
            $ref: '#/components/schemas/AssociatedEvent'
          description: List of events with their individual configuration.
        associated_event_tickers:
          type: array
          items:
            type: string
          description: '[DEPRECATED - Use associated_events instead] A list of events associated with the collection. Markets in these events can be passed as inputs to the Lookup and Create endpoints.'
        is_ordered:
          type: boolean
          description: Whether the collection is ordered. If true, the order of markets passed into Lookup/Create affects the output. If false, the order does not matter.
        is_single_market_per_event:
          type: boolean
          description: '[DEPRECATED - Use associated_events instead] Whether the collection accepts multiple markets from the same event passed into Lookup/Create.'
        is_all_yes:
          type: boolean
          description: '[DEPRECATED - Use associated_events instead] Whether the collection requires that only the market side of ''yes'' may be used.'
        size_min:
          type: integer
          format: int32
          description: The minimum number of markets that must be passed into Lookup/Create (inclusive).
        size_max:
          type: integer
          format: int32
          description: The maximum number of markets that must be passed into Lookup/Create (inclusive).
        functional_description:
          type: string
          description: A functional description of the collection describing how inputs affect the output.
        price_level_structure:
          type: string
          description: Price level structure used for new markets created in this collection. Existing markets may differ; use the market's price_level_structure and price_ranges for its current pricing.
        price_ranges:
          type: array
          description: Price bands and tick sizes in fixed-point dollars for new markets created in this collection. Use these ranges to determine valid prices rather than hardcoding the structure name.
          items:
            $ref: '#/components/schemas/PriceRange'

    GetMultivariateEventCollectionResponse:
      type: object
      required:
        - multivariate_contract
      properties:
        multivariate_contract:
          $ref: '#/components/schemas/MultivariateEventCollection'
          description: The multivariate event collection.

    GetMultivariateEventCollectionsResponse:
      type: object
      required:
        - multivariate_contracts
      properties:
        multivariate_contracts:
          type: array
          items:
            $ref: '#/components/schemas/MultivariateEventCollection'
          description: List of multivariate event collections.
        cursor:
          type: string
          description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned here in the cursor query parameter for this end-point to get the next page containing limit records. An empty value of this field indicates there is no next page.
          x-go-type-skip-optional-pointer: true

    TickerPair:
      type: object
      required:
        - market_ticker
        - event_ticker
        - side
      properties:
        market_ticker:
          type: string
          description: Market ticker identifier.
        event_ticker:
          type: string
          description: Event ticker identifier.
        side:
          type: string
          enum: ['yes', 'no']
          description: Side of the market (yes or no).
          x-oapi-codegen-extra-tags:
            validate: required,oneof=yes no

    CreateMarketInMultivariateEventCollectionRequest:
      type: object
      required:
        - selected_markets
      properties:
        selected_markets:
          type: array
          items:
            $ref: '#/components/schemas/TickerPair'
          description: List of selected markets that act as parameters to determine which market is created.
          x-oapi-codegen-extra-tags:
            validate: required,dive
        with_market_payload:
          type: boolean
          description: Whether to include the market payload in the response.

    CreateMarketInMultivariateEventCollectionResponse:
      type: object
      required:
        - event_ticker
        - market_ticker
      properties:
        event_ticker:
          type: string
          description: Event ticker for the created market.
        market_ticker:
          type: string
          description: Market ticker for the created market.
        market:
          $ref: '#/components/schemas/Market'
          description: Market payload of the created market.
    # Market Orderbook schemas
    PriceLevelDollarsCountFp:
      type: array
      minItems: 2
      maxItems: 2
      example: ["0.1500", "100.00"]
      items:
        type: string
      description: Price level in dollars represented as [dollars_string, fp] where dollars_string is like "0.1500" and fp is a FixedPointCount string (fixed-point contract count). The second element is the contract quantity (not price).

    OrderbookCountFp:
      type: object
      required:
        - yes_dollars
        - no_dollars
      properties:
        yes_dollars:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevelDollarsCountFp'
        no_dollars:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevelDollarsCountFp'
      description: Orderbook with fixed-point contract counts (fp) in all dollar price levels.

    GetMarketOrderbooksResponse:
      type: object
      required:
        - orderbooks
      properties:
        orderbooks:
          type: array
          items:
            $ref: '#/components/schemas/MarketOrderbookFp'

    MarketOrderbookFp:
      type: object
      required:
        - ticker
        - orderbook_fp
      properties:
        ticker:
          type: string
        orderbook_fp:
          $ref: '#/components/schemas/OrderbookCountFp'

    GetMarketOrderbookResponse:
      type: object
      required:
        - orderbook_fp
      properties:
        orderbook_fp:
          $ref: '#/components/schemas/OrderbookCountFp'
          description: Orderbook with fixed-point contract counts (fp) in all price levels.

    GetEventsResponse:
      type: object
      required:
        - events
        - cursor
      properties:
        events:
          type: array
          description: Array of events matching the query criteria.
          items:
            $ref: '#/components/schemas/EventData'
        milestones:
          type: array
          description: Array of milestones related to the events.
          items:
            $ref: '#/components/schemas/Milestone'
        cursor:
          type: string
          description: Pagination cursor for the next page. Empty if there are no more results.

    GetMultivariateEventsResponse:
      type: object
      required:
        - events
        - cursor
      properties:
        events:
          type: array
          description: Array of multivariate events matching the query criteria.
          items:
            $ref: '#/components/schemas/EventData'
        cursor:
          type: string
          description: Pagination cursor for the next page. Empty if there are no more results.

    EventFeeChange:
      type: object
      required:
        - id
        - event_ticker
        - series_ticker
        - fee_type_override
        - fee_multiplier_override
        - scheduled_ts
      properties:
        id:
          type: string
          description: Unique identifier for this fee change
        event_ticker:
          type: string
          description: Event ticker this fee change applies to
        series_ticker:
          type: string
          description: Series ticker for the event
        fee_type_override:
          allOf:
            - $ref: '#/components/schemas/FeeType'
          nullable: true
          example: quadratic
          description: New fee type override for the event. When null, the event clears any prior override and falls back to the parent series' fee structure.
        fee_multiplier_override:
          type: number
          format: double
          nullable: true
          description: New fee multiplier override for the event. When null, the event clears any prior override and falls back to the parent series' fee multiplier.
        scheduled_ts:
          type: string
          format: date-time
          description: Timestamp when this fee change is scheduled to take effect

    GetEventFeeChangesResponse:
      type: object
      required:
        - event_fee_changes
        - cursor
      properties:
        event_fee_changes:
          type: array
          items:
            $ref: '#/components/schemas/EventFeeChange'
        cursor:
          type: string
          description: Pagination cursor for the next page. Empty if there are no more results.

    GetEventResponse:
      type: object
      required:
        - event
        - markets
      properties:
        event:
          $ref: '#/components/schemas/EventData'
          description: Data for the event.
        markets:
          type: array
          description: Data for the markets in this event. This field is deprecated in favour of the "markets" field inside the event. Which will be filled with the same value if you use the query parameter "with_nested_markets=true".
          items:
            $ref: '#/components/schemas/Market'

    MarketMetadata:
      type: object
      required:
        - market_ticker
        - image_url
        - color_code
      properties:
        market_ticker:
          type: string
          description: The ticker of the market.
        image_url:
          type: string
          description: A path to an image that represents this market.
        color_code:
          type: string
          description: The color code for the market.

    GetEventMetadataResponse:
      type: object
      required:
        - image_url
        - settlement_sources
        - market_details
      properties:
        image_url:
          type: string
          description: A path to an image that represents this event.
        featured_image_url:
          type: string
          description: A path to an image that represents the image of the featured market.
        market_details:
          type: array
          description: Metadata for the markets in this event.
          items:
            $ref: '#/components/schemas/MarketMetadata'
        settlement_sources:
          type: array
          description: A list of settlement sources for this event.
          items:
            $ref: '#/components/schemas/SettlementSource'
        competition:
          type: string
          nullable: true
          x-omitempty: true
          description: Event competition.
          x-go-type-skip-optional-pointer: true
        competition_scope:
          type: string
          nullable: true
          x-omitempty: true
          description: Event scope, based on the competition.
          x-go-type-skip-optional-pointer: true

    GetEventForecastPercentilesHistoryResponse:
      type: object
      required:
        - forecast_history
      properties:
        forecast_history:
          type: array
          description: Array of forecast percentile data points over time.
          items:
            $ref: '#/components/schemas/ForecastPercentilesPoint'

    ForecastPercentilesPoint:
      type: object
      required:
        - event_ticker
        - end_period_ts
        - period_interval
        - percentile_points
      properties:
        event_ticker:
          type: string
          description: The event ticker this forecast is for.
        end_period_ts:
          type: integer
          format: int64
          description: Unix timestamp for the inclusive end of the forecast period.
        period_interval:
          type: integer
          format: int32
          description: Length of the forecast period in minutes.
        percentile_points:
          type: array
          description: Array of forecast values at different percentiles.
          items:
            $ref: '#/components/schemas/PercentilePoint'

    PercentilePoint:
      type: object
      required:
        - percentile
        - raw_numerical_forecast
        - numerical_forecast
        - formatted_forecast
      properties:
        percentile:
          type: integer
          format: int32
          description: The percentile value (0-9999).
        raw_numerical_forecast:
          type: number
          description: The raw numerical forecast value.
        numerical_forecast:
          type: number
          description: The processed numerical forecast value.
        formatted_forecast:
          type: string
          description: The human-readable formatted forecast value.

    EventData:
      type: object
      required:
        - event_ticker
        - series_ticker
        - sub_title
        - title
        - collateral_return_type
        - mutually_exclusive
        - settlement_sources
      properties:
        event_ticker:
          type: string
          description: Unique identifier for this event.
        series_ticker:
          type: string
          description: Unique identifier for the series this event belongs to.
        sub_title:
          type: string
          description: Shortened descriptive title for the event.
        title:
          type: string
          description: Full title of the event.
        collateral_return_type:
          type: string
          description: |
            Collateral-return netting type for this event: `MECNET` for mutually exclusive markets, `DIRECNET` for directional netting, or an empty string for no collateral-return netting.
            Netting applies within this event, not across all events in its series, and also requires netting to be enabled for the trading account or subtrader.
            Use `with_nested_markets=true` to retrieve the markets associated with each event.
        mutually_exclusive:
          type: boolean
          description: |
            True when `collateral_return_type` is `MECNET`: at most one market in this event can resolve to 'yes'.
            False for both `DIRECNET` and an empty collateral-return type. A false value does not mean collateral-return netting is unavailable. Use `collateral_return_type` to distinguish these cases.
        category:
          type: string
          description: Event category (deprecated, use series-level category instead).
          deprecated: true
          x-go-type-skip-optional-pointer: true
        strike_date:
          type: string
          format: date-time
          nullable: true
          x-omitempty: true
          description: The specific date this event is based on. Only filled when the event uses a date strike (mutually exclusive with strike_period).
        strike_period:
          type: string
          nullable: true
          x-omitempty: true
          description: The time period this event covers (e.g., 'week', 'month'). Only filled when the event uses a period strike (mutually exclusive with strike_date).
        markets:
          type: array
          x-omitempty: true
          description: Array of markets associated with this event. Only populated when 'with_nested_markets=true' is specified in the request.
          items:
            $ref: '#/components/schemas/Market'
          x-go-type-skip-optional-pointer: true
        product_metadata:
          type: object
          nullable: true
          x-omitempty: true
          description: Additional metadata for the event.
          x-go-type-skip-optional-pointer: true
        settlement_sources:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/SettlementSource'
          description: The official sources used for the determination of markets within this event. Methodology is defined in the rulebook.
        last_updated_ts:
          type: string
          format: date-time
          description: Timestamp of when this event's metadata was last updated.
        fee_type_override:
          type: string
          nullable: true
          x-omitempty: true
          description: Fee type override for this event. When present, takes precedence over the series-level fee for this event's markets.
        fee_multiplier_override:
          type: number
          format: double
          nullable: true
          x-omitempty: true
          description: Fee multiplier override for this event. Paired with fee_type_override.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    Series:
      type: object
      required:
        - ticker
        - frequency
        - title
        - category
        - categories
        - tags
        - settlement_sources
        - contract_url
        - contract_terms_url
        - fee_type
        - fee_multiplier
        - additional_prohibitions
      properties:
        ticker:
          type: string
          description: Ticker that identifies this series.
        frequency:
          type: string
          description: Description of the frequency of the series. There is no fixed value set here, but will be something human-readable like weekly, daily, one-off.
        title:
          type: string
          description: Title describing the series. For full context use you should use this field with the title field of the events belonging to this series.
        category:
          type: string
          description: Category is the primary category of this series.
        categories:
          type: array
          items:
            type: string
          description: Categories is the list of discovery categories for this series. The `category` filter on Get Series List matches any entry in this list. May be empty.
        tags:
          type: array
          nullable: true
          items:
            type: string
          description: Tags specifies the subjects that this series relates to, multiple series from different categories can have the same tags.
        settlement_sources:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/SettlementSource'
          description: SettlementSources specifies the official sources used for the determination of markets within the series. Methodology is defined in the rulebook.
        contract_url:
          type: string
          description: ContractUrl provides a direct link to the original filing of the contract which underlies the series.
        contract_terms_url:
          type: string
          description: ContractTermsUrl is the URL to the current terms of the contract underlying the series.
        product_metadata:
          type: object
          nullable: true
          x-omitempty: true
          description: Internal product metadata of the series.
        fee_type:
          allOf:
            - $ref: '#/components/schemas/FeeType'
          description: "FeeType is a string representing the series' fee structure. Fee structures can be found at https://kalshi.com/docs/kalshi-fee-schedule.pdf. 'quadratic' is described by the General Trading Fees Table, 'quadratic_with_maker_fees' is described by the General Trading Fees Table with maker fees described in the Maker Fees section, 'quadratic_with_combo_maker_fees' is the same maker-fee structure with a 0.5 maker multiplier instead of 0.25, 'flat' is described by the Specific Trading Fees Table."
        fee_multiplier:
          type: number
          format: double
          description: FeeMultiplier is a floating point multiplier applied to the fee calculations.
        additional_prohibitions:
          type: array
          nullable: true
          items:
            type: string
          description: AdditionalProhibitions is a list of additional trading prohibitions for this series.
        volume_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the total number of contracts traded across all events in this series.
        last_updated_ts:
          type: string
          format: date-time
          description: Timestamp of when this series' metadata was last updated.
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

    SeriesFeeChange:
      type: object
      required:
        - id
        - series_ticker
        - fee_type
        - fee_multiplier
        - scheduled_ts
      properties:
        id:
          type: string
          description: Unique identifier for this fee change
        series_ticker:
          type: string
          description: Series ticker this fee change applies to
        fee_type:
          allOf:
            - $ref: '#/components/schemas/FeeType'
          description: New fee type for the series
        fee_multiplier:
          type: number
          format: double
          description: New fee multiplier for the series
        scheduled_ts:
          type: string
          format: date-time
          description: Timestamp when this fee change is scheduled to take effect

    GetSeriesResponse:
      type: object
      required:
        - series
      properties:
        series:
          $ref: '#/components/schemas/Series'

    GetSeriesListResponse:
      type: object
      required:
        - series
      properties:
        series:
          type: array
          items:
            $ref: '#/components/schemas/Series'

    GetSeriesFeeChangesResponse:
      type: object
      required:
        - series_fee_change_arr
      properties:
        series_fee_change_arr:
          type: array
          items:
            $ref: '#/components/schemas/SeriesFeeChange'

    SettlementSource:
      type: object
      properties:
        name:
          type: string
          description: Name of the settlement source
          x-go-type-skip-optional-pointer: true
        url:
          type: string
          description: URL to the settlement source
          x-go-type-skip-optional-pointer: true

    GetMarketsResponse:
      type: object
      required:
        - markets
        - cursor
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/Market'
        cursor:
          type: string

    GetMarketResponse:
      type: object
      required:
        - market
      properties:
        market:
          $ref: '#/components/schemas/Market'

    MveSelectedLeg:
      type: object
      properties:
        event_ticker:
          type: string
          description: Unique identifier for the selected event
          x-go-type-skip-optional-pointer: true
        market_ticker:
          type: string
          description: Unique identifier for the selected market
          x-go-type-skip-optional-pointer: true
        side:
          type: string
          description: The side of the selected market
          x-go-type-skip-optional-pointer: true
        yes_settlement_value_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          x-omitempty: true
          description: The settlement value of the YES/LONG side of the contract in dollars. Only filled after determination

    PriceRange:
      type: object
      required:
        - start
        - end
        - step
      properties:
        start:
          type: string
          description: Starting price for this range in dollars
        end:
          type: string
          description: Ending price for this range in dollars
        step:
          type: string
          description: Price step/tick size for this range in dollars

    Market:
      type: object
      required:
        - ticker
        - event_ticker
        - market_type
        - yes_sub_title
        - no_sub_title
        - created_time
        - updated_time
        - open_time
        - close_time
        - latest_expiration_time
        - settlement_timer_seconds
        - status
        - notional_value_dollars
        - yes_bid_dollars
        - yes_ask_dollars
        - no_bid_dollars
        - no_ask_dollars
        - yes_bid_size_fp
        - yes_ask_size_fp
        - last_price_dollars
        - previous_yes_bid_dollars
        - previous_yes_ask_dollars
        - previous_price_dollars
        - volume_fp
        - volume_24h_fp
        - open_interest_fp
        - result
        - can_close_early
        - expiration_value
        - rules_primary
        - rules_secondary
        - price_level_structure
        - price_ranges
        - settlement_bounds_type
      properties:
        ticker:
          type: string
        event_ticker:
          type: string
        market_type:
          type: string
          enum: [binary, scalar]
          description: Identifies the type of market
        title:
          type: string
          deprecated: true
          x-go-type-skip-optional-pointer: true
        subtitle:
          type: string
          deprecated: true
          x-go-type-skip-optional-pointer: true
        yes_sub_title:
          type: string
          description: Shortened title for the yes side of this market
        no_sub_title:
          type: string
          description: Shortened title for the no side of this market
        created_time:
          type: string
          format: date-time
        updated_time:
          type: string
          format: date-time
          description: Time of the last non-trading metadata update.
        open_time:
          type: string
          format: date-time
        close_time:
          type: string
          format: date-time
        expected_expiration_time:
          type: string
          format: date-time
          nullable: true
          x-omitempty: true
          description: Time when this market is expected to expire
        expiration_time:
          type: string
          format: date-time
          deprecated: true
          x-go-type-skip-optional-pointer: true
        latest_expiration_time:
          type: string
          format: date-time
          description: Latest possible time for this market to expire
        settlement_timer_seconds:
          type: integer
          description: The amount of time after determination that the market settles
        status:
          type: string
          enum: [initialized, inactive, active, closed, determined, disputed, amended, finalized]
          description: The current status of the market in its lifecycle.
        yes_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the highest YES buy offer on this market in dollars
        yes_bid_size_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Total contract size of orders to buy YES at the best bid price (fixed-point count string).
        yes_ask_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the lowest YES sell offer on this market in dollars
        yes_ask_size_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: Total contract size of orders to sell YES at the best ask price (fixed-point count string).
        no_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the highest NO buy offer on this market in dollars
        no_ask_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the lowest NO sell offer on this market in dollars
        last_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the last traded YES contract on this market in dollars
        volume_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the market volume in contracts
        volume_24h_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the 24h market volume in contracts
        result:
          type: string
          enum: ['yes', 'no', 'scalar', '']
        can_close_early:
          type: boolean
        open_interest_fp:
          $ref: '#/components/schemas/FixedPointCount'
          description: String representation of the number of contracts bought on this market disconsidering netting
        notional_value_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: The total value of a single contract at settlement in dollars
        previous_yes_bid_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the highest YES buy offer on this market a day ago in dollars
        previous_yes_ask_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the lowest YES sell offer on this market a day ago in dollars
        previous_price_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          description: Price for the last traded YES contract on this market a day ago in dollars
        settlement_value_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          x-omitempty: true
          description: The settlement value of the YES/LONG side of the contract in dollars. Only filled after determination
        settlement_ts:
          type: string
          format: date-time
          nullable: true
          x-omitempty: true
          description: Timestamp when the market was settled. Only filled for settled markets
        settlement_bounds_type:
          type: string
          enum: [default, floor]
          description: Which settlement bounds apply to this market. default means the market has no settlement bounds
        settlement_floor_dollars:
          $ref: '#/components/schemas/FixedPointDollars'
          nullable: true
          x-omitempty: true
          description: The lowest value the YES/LONG side of the contract can settle at in dollars. Only filled when settlement_bounds_type is floor
        expiration_value:
          type: string
          description: The value that was considered for the settlement
        occurrence_datetime:
          type: string
          format: date-time
          nullable: true
          description: The recorded datetime when the underlying event occurred, if available
        fee_waiver_expiration_time:
          type: string
          format: date-time
          nullable: true
          x-omitempty: true
          description: Time when this market's fee waiver expires
        early_close_condition:
          type: string
          nullable: true
          x-omitempty: true
          description: The condition under which the market can close early
          x-go-type-skip-optional-pointer: true
        strike_type:
          type: string
          enum: [greater, greater_or_equal, less, less_or_equal, between, functional, custom, structured]
          x-omitempty: true
          description: Strike type defines how the market strike is defined and evaluated
          x-go-type-skip-optional-pointer: true
        floor_strike:
          type: number
          format: double
          nullable: true
          x-omitempty: true
          description: Minimum expiration value that leads to a YES settlement
        cap_strike:
          type: number
          format: double
          nullable: true
          x-omitempty: true
          description: Maximum expiration value that leads to a YES settlement
        functional_strike:
          type: string
          nullable: true
          x-omitempty: true
          description: Mapping from expiration values to settlement values
        custom_strike:
          type: object
          nullable: true
          x-omitempty: true
          description: Expiration value for each target that leads to a YES settlement
        rules_primary:
          type: string
          description: A plain language description of the most important market terms
        rules_secondary:
          type: string
          description: A plain language description of secondary market terms
        mve_collection_ticker:
          type: string
          x-omitempty: true
          description: The ticker of the multivariate event collection
          x-go-type-skip-optional-pointer: true
        mve_selected_legs:
          type: array
          x-omitempty: true
          items:
            $ref: '#/components/schemas/MveSelectedLeg'
          x-go-type-skip-optional-pointer: true
        primary_participant_key:
          type: string
          nullable: true
          x-omitempty: true
        price_level_structure:
          type: string
          description: Price level structure for this market, defining price ranges and tick sizes
        price_ranges:
          type: array
          description: Valid price ranges for orders on this market
          items:
            $ref: '#/components/schemas/PriceRange'
        is_provisional:
          type: boolean
          x-omitempty: true
          description: If true, the market may be removed after determination if there is no activity on it
          x-go-type-skip-optional-pointer: true
        exchange_index:
          allOf:
            - $ref: '#/components/schemas/ExchangeIndex'
          x-go-type-skip-optional-pointer: true
          x-omitempty: false

tags:
  - name: api-keys
    description: API key management endpoints
  - name: orders
    description: Order management endpoints
  - name: order-groups
    description: Order group management endpoints
  - name: portfolio
    description: Portfolio and balance information endpoints
  - name: communications
    description: Request-for-quote (RFQ) endpoints
  - name: multivariate
    description: Multivariate event collection endpoints
  - name: exchange
    description: Exchange status and information endpoints
  - name: live-data
    description: Live data endpoints
  - name: markets
    description: Market data endpoints
  - name: milestone
    description: Milestone endpoints
  - name: search
    description: Search and filtering endpoints
  - name: incentive-programs
    description: Incentive program endpoints
  - name: fcm
    description: FCM member specific endpoints
  - name: events
    description: Event endpoints
  - name: structured-targets
    description: Structured targets endpoints
