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
| Environment | Base URL |
|---|
| Demo | https://demo-api.kalshi.co/trade-api/v2/margin/ |
| Production | Coming soon |
WebSocket API
| Environment | URL |
|---|
| Demo | wss://demo-api.kalshi.co/trade-api/ws/v2/margin |
| Production | Coming soon |
FIX API
The margin FIX gateway uses a separate host from event contract FIX.
| Environment | Host |
|---|
| Demo | margin-fix.demo.kalshi.co |
| Production | Coming soon |
Available session types:
| Purpose | Port | TargetCompID |
|---|
| Order Entry (without retransmission) | 8228 | KalshiNR |
| Drop Copy | 8229 | KalshiDC |
| Order Entry (with retransmission) | 8230 | KalshiRT |
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.
| Environment | Base URL |
|---|
| Demo | https://demo-api.kalshi.co/klear-api/v1 |
| Production | Coming 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:
| Endpoint | Description |
|---|
/margin/balance | Margin account balance |
/margin/risk | Current margin risk metrics |
/margin/notional_risk_limit | Notional risk limit |
/margin/enabled | Whether margin is enabled for your account |
/margin/fee_tiers | Margin fee tier schedule |
/margin/funding_history | Funding payment history |
/margin/funding_rates/estimate | Estimated funding rate for the in-progress period |
/margin/funding_rates/historical | Historical funding rates |
/portfolio/intra_exchange_instance_transfer | Transfer funds between event contract and margin accounts |
/portfolio/margin/subaccounts | Create margin subaccounts |
/portfolio/margin/subaccounts/transfer | Transfer between margin subaccounts |
/margin/order_groups/{id}/limit | Update 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.
| Channel | Event contract | Margin |
|---|
orderbook_delta | ts as RFC3339 datetime | ts_ms as Unix milliseconds |
ticker | ts in Unix seconds and time as RFC3339 datetime | ts_ms only |
trade | ts in Unix seconds | ts_ms in Unix milliseconds |
fill | ts in Unix seconds | ts_ms in Unix milliseconds |
user_orders | created_time, last_update_time, expiration_time as RFC3339 datetimes | created_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 FIX | Margin FIX |
|---|
| Pricing | Integer cents (1–99) | Decimal dollars up to 4 decimal places |
| Session types | 5 (NR, RT, DC, PT, RFQ) | 3 (NR, RT, DC) |
| RFQ / Quotes | Supported | Not available |
| Market settlement reports | Supported (on KalshiRT) | Not available |
| UseDollars (21005) | Optional logon flag | Always 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:
| Endpoint | Description |
|---|
POST /log_in | Authenticate with email and password. |
GET /margin/reports | Margin reports for the authenticated clearing member, filterable by date range. |
GET /margin/active_obligation | Outstanding settlement obligation for the current cycle (negative = net payable, positive = net receivable), or null if none. |
GET /margin/obligation_history | Completed obligations from previous settlements, ordered by most recent first. |
GET /margin/settlement_estimate | Estimated next settlement amounts, including per-subtrader breakdowns. |
GET /margin/settlement_balance | Settlement buffer balance for the authenticated clearing member. |
POST /margin/withdraw_settlement_balance | Initiate a wire withdrawal from the settlement buffer. |
GET /margin/settlement_balance_withdrawal | Get the status of a settlement buffer withdrawal by ID. |
Rate Limits
Margin API rate limits use the same tier structure as event contracts:
| Tier | Read | Write |
|---|
| Basic | 20/s | 10/s |
| Advanced | 30/s | 30/s |
| Premier | 100/s | 100/s |
| Prime | 400/s | 400/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.