Skip to main content

Join the Graylayer Discord

Request an API key in #api-key-request under the Community tab.
Platform key: kalshi · Upstream: https://api.elections.kalshi.com/trade-api/v2 Public endpoints (markets, events, series) work without platform credentials. Authenticated endpoints (orders, portfolio) require KALSHI_ACCESS_KEY and KALSHI_PRIVATE_KEY in .env. The proxy signs requests automatically using RSA-PSS.
# Public endpoint
curl -H "X-API-Key: your_key" http://gateway.graylayer.tech/api/v1/kalshi/markets

# Authenticated endpoint (requires Kalshi credentials in .env)
curl -H "X-API-Key: your_key" http://gateway.graylayer.tech/api/v1/kalshi/portfolio/balance
Kalshi demo environment uses different credentials than production. If your key was created at demo.kalshi.co, set KALSHI_BASE_URL=https://demo-api.kalshi.co/trade-api/v2 in .env.

Exchange

MethodPathDescription
GET/exchange/statusExchange status
GET/exchange/announcementsExchange announcements
GET/exchange/series/fee-changesSeries fee changes
GET/exchange/scheduleExchange schedule
GET/exchange/user-data-timestampUser data timestamp

Markets

MethodPathDescription
GET/marketsList markets
GET/markets/{market_id}Get market
GET/markets/{market_id}/orderbookGet orderbook
GET/markets/candlesticksMarket candlesticks
GET/markets/candlesticks/batchBatch candlesticks
GET/markets/tradesGet trades

Common query parameters for /markets

ParameterTypeDescription
limitintegerMax results
cursorstringPagination cursor
event_tickerstringFilter by event ticker
series_tickerstringFilter by series ticker
statusstringopen, closed, settled
min_close_tsintegerUnix timestamp filter
max_close_tsintegerUnix timestamp filter
curl -H "X-API-Key: your_key" \
  "http://gateway.graylayer.tech/api/v1/kalshi/markets?status=open&limit=20"

Events

MethodPathDescription
GET/eventsList events
GET/events/{event_ticker}Get event
GET/events/multivariateMultivariate events
GET/events/{event_ticker}/metadataEvent metadata
GET/events/{event_ticker}/forecast-percentile-historyForecast history
GET/events/candlesticksEvent candlesticks

Series

MethodPathDescription
GET/seriesList series
GET/series/{series_ticker}Get series

Historical data

MethodPathDescription
GET/historical/marketsHistorical markets
GET/historical/markets/{market_id}Historical market
GET/historical/markets/candlesticksHistorical candlesticks
GET/historical/fillsHistorical fills
GET/historical/ordersHistorical orders
GET/historical/cutoff-timestampsCutoff timestamps

Orders

Requires KALSHI_ACCESS_KEY and KALSHI_PRIVATE_KEY. Read-only—list and inspect orders.
MethodPathDescription
GET/ordersList orders
GET/orders/{order_id}Get order
GET/orders/queue-positionsQueue positions
GET/orders/{order_id}/queue-positionOrder queue position

Order groups

MethodPathDescription
GET/order-groupsGet order groups
GET/order-groups/{group_id}Get order group

Portfolio

Requires KALSHI_ACCESS_KEY and KALSHI_PRIVATE_KEY.
MethodPathDescription
GET/portfolio/balanceAccount balance
GET/portfolio/positionsOpen positions
GET/portfolio/fillsFill history
GET/portfolio/settlementsSettlement history
GET/portfolio/resting-order-valueTotal resting order value
GET/portfolio/subaccounts/balancesSubaccount balances
GET/portfolio/subaccounts/transfersSubaccount transfers
curl -H "X-API-Key: your_key" \
  http://gateway.graylayer.tech/api/v1/kalshi/portfolio/balance

RFQ / Communications

MethodPathDescription
GET/communications/idCommunications ID
GET/rfqsList RFQs
POST/rfqsCreate RFQ
GET/rfqs/{rfq_id}Get RFQ
DELETE/rfqs/{rfq_id}Delete RFQ
GET/quotesList quotes
POST/quotesCreate quote
GET/quotes/{quote_id}Get quote
DELETE/quotes/{quote_id}Delete quote
PUT/quotes/{quote_id}/acceptAccept quote
PUT/quotes/{quote_id}/confirmConfirm quote

FCM

MethodPathDescription
GET/fcm/ordersFCM orders
GET/fcm/positionsFCM positions

Structured targets and milestones

MethodPathDescription
GET/structured-targetsList structured targets
GET/structured-targets/{target_id}Get structured target
GET/milestonesList milestones
GET/milestone/{milestone_id}Get milestone

Search and misc

MethodPathDescription
GET/search/tagsTags for series
GET/search/filtersFilters for sports
GET/account/api-limitsAPI rate limits
GET/live-data/{ticker}Live data for ticker
GET/live-dataMultiple live data
GET/incentive-programsIncentive programs

WebSocket

Real-time Kalshi data via WebSocket proxy. See Kalshi WebSockets.