Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kalshi.com/llms.txt

Use this file to discover all available pages before exploring further.

The margin API mirrors the existing event contract API. If you’re already integrated with the event contract API, you’re most of the way there — the margin endpoints follow the same patterns, authentication, and conventions, just under the /margin namespace.
Production endpoints are coming soon. In the meantime, you can build and test against the demo environment.

Connectivity

REST API

EnvironmentBase URL
Demohttps://demo-api.kalshi.co/trade-api/v2/margin/
ProductionComing soon

WebSocket API

EnvironmentURL
Demowss://demo-api.kalshi.co/trade-api/ws/v2/margin
ProductionComing soon

FIX API

The margin FIX gateway uses a separate host from event contract FIX.
EnvironmentHost
Demomargin-fix.demo.kalshi.co
ProductionComing soon
Available session types:
PurposePortTargetCompID
Order Entry (without retransmission)8228KalshiNR
Drop Copy8229KalshiDC
Order Entry (with retransmission)8230KalshiRT

Self-Clearing Member API

Self-Clearing Member (SCM) endpoints are served by the Klear API on a separate base URL from the trade API. These endpoints require Klear API credentials — contact Kalshi to get set up.
EnvironmentBase URL
Demohttps://demo-api.kalshi.co/klear-api/v1
ProductionComing soon

API Reference

The margin API specs are structurally similar to the event contract specs. If you’re familiar with the REST API and WebSocket API, the margin equivalents follow the same conventions.

REST API

What’s the same: authentication, pagination, error format, and core order lifecycle (create, amend, decrease, cancel) all work identically, just under /margin/* instead of /portfolio/* and /markets/*. Added in margin:
EndpointDescription
/margin/balanceMargin account balance
/margin/riskCurrent margin risk metrics
/margin/notional_risk_limitNotional risk limit
/margin/enabledWhether margin is enabled for your account
/margin/fee_tiersMargin fee tier schedule
/margin/funding_historyFunding payment history
/margin/funding_rates/estimateEstimated funding rate for the in-progress period
/margin/funding_rates/historicalHistorical funding rates
/portfolio/intra_exchange_instance_transferTransfer funds between event contract and margin accounts
/portfolio/margin/subaccountsCreate margin subaccounts
/portfolio/margin/subaccounts/transferTransfer between margin subaccounts
/margin/order_groups/{id}/limitUpdate order group limit (not available on event contracts)
Not available on margin:
  • Batch order operations (BatchCreateOrders, BatchCancelOrders)
  • Queue positions
  • Events, series, milestones, multivariate collections, structured targets
  • RFQs and quotes
  • Historical data endpoints
  • Exchange announcements and schedule

WebSocket API

Same channels: orderbook_delta, ticker, trade, fill, user_orders, order_group_updates Not available on margin: market_positions, market_lifecycle_v2, multivariate_market_lifecycle, multivariate, communications Timestamp convention: all timestamp fields in margin WebSocket payloads use Unix epoch milliseconds and an _ms suffix.
ChannelEvent contractMargin
orderbook_deltats as RFC3339 datetimets_ms as Unix milliseconds
tickerts in Unix seconds and time as RFC3339 datetimets_ms only
tradets in Unix secondsts_ms in Unix milliseconds
fillts in Unix secondsts_ms in Unix milliseconds
user_orderscreated_time, last_update_time, expiration_time as RFC3339 datetimescreated_ts_ms, last_updated_ts_ms, expiration_ts_ms as Unix milliseconds
Margin WebSocket payloads no longer use RFC3339 timestamp strings. order_group_updates remains unchanged because it does not currently include timestamp fields.

FIX API

API keys should not be shared between the event contract and margin FIX gateways.
What’s the same: FIXT.1.1 / FIX50SP2 protocol, RSA key authentication, order lifecycle messages (NewOrderSingle, OrderCancelRequest, etc.), order groups, drop copy, and listener sessions all work the same way. Key differences:
Event Contract FIXMargin FIX
PricingInteger cents (1–99)Decimal dollars up to 4 decimal places
Session types5 (NR, RT, DC, PT, RFQ)3 (NR, RT, DC)
RFQ / QuotesSupportedNot available
Market settlement reportsSupported (on KalshiRT)Not available
UseDollars (21005)Optional logon flagAlways enabled (margin uses fixed-point dollar pricing by default)

Self-Clearing Member API

Self-Clearing Members (SCMs) are institutional users who clear their own margin activity directly with Kalshi. Available endpoints:
EndpointDescription
POST /log_inAuthenticate with email and password.
GET /margin/reportsMargin reports for the authenticated clearing member, filterable by date range.
GET /margin/active_obligationOutstanding settlement obligation for the current cycle (negative = net payable, positive = net receivable), or null if none.
GET /margin/obligation_historyCompleted obligations from previous settlements, ordered by most recent first.
GET /margin/settlement_estimateEstimated next settlement amounts, including per-subtrader breakdowns.
GET /margin/settlement_balanceSettlement buffer balance for the authenticated clearing member.
POST /margin/withdraw_settlement_balanceInitiate a wire withdrawal from the settlement buffer.
GET /margin/settlement_balance_withdrawalGet the status of a settlement buffer withdrawal by ID.

Rate Limits

Margin API rate limits use the same tier structure as event contracts:
TierReadWrite
Basic20/s10/s
Advanced30/s30/s
Premier100/s100/s
Prime400/s400/s
Rate limits are tracked separately from event contract rate limits — margin API calls do not count against your event contract quota, and vice versa. Your tier applies to both. See Rate Limits and Tiers for tier qualification details.