> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graylayer.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Kalshi

> Markets, events, order books, portfolio, and historical data

<Card title="Join the Graylayer Discord" icon="discord" href="https://discord.gg/UxGa5C4C2A" horizontal>
  Request an API key in **#api-key-request** under the Community tab.
</Card>

**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.

```bash theme={null}
# 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
```

<Note>
  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`.
</Note>

## Exchange

| Method | Path                            | Description            |
| ------ | ------------------------------- | ---------------------- |
| GET    | `/exchange/status`              | Exchange status        |
| GET    | `/exchange/announcements`       | Exchange announcements |
| GET    | `/exchange/series/fee-changes`  | Series fee changes     |
| GET    | `/exchange/schedule`            | Exchange schedule      |
| GET    | `/exchange/user-data-timestamp` | User data timestamp    |

## Markets

| Method | Path                             | Description         |
| ------ | -------------------------------- | ------------------- |
| GET    | `/markets`                       | List markets        |
| GET    | `/markets/{market_id}`           | Get market          |
| GET    | `/markets/{market_id}/orderbook` | Get orderbook       |
| GET    | `/markets/candlesticks`          | Market candlesticks |
| GET    | `/markets/candlesticks/batch`    | Batch candlesticks  |
| GET    | `/markets/trades`                | Get trades          |

### Common query parameters for `/markets`

| Parameter       | Type    | Description                 |
| --------------- | ------- | --------------------------- |
| `limit`         | integer | Max results                 |
| `cursor`        | string  | Pagination cursor           |
| `event_ticker`  | string  | Filter by event ticker      |
| `series_ticker` | string  | Filter by series ticker     |
| `status`        | string  | `open`, `closed`, `settled` |
| `min_close_ts`  | integer | Unix timestamp filter       |
| `max_close_ts`  | integer | Unix timestamp filter       |

<CodeGroup>
  ```bash List markets theme={null}
  curl -H "X-API-Key: your_key" \
    "http://gateway.graylayer.tech/api/v1/kalshi/markets?status=open&limit=20"
  ```

  ```bash Get orderbook theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/kalshi/markets/KXBTC-24NOV/orderbook
  ```

  ```bash Candlesticks theme={null}
  curl -H "X-API-Key: your_key" \
    "http://gateway.graylayer.tech/api/v1/kalshi/markets/candlesticks?tickers=KXBTC-24NOV&period_interval=60&start_ts=1700000000&end_ts=1700100000"
  ```
</CodeGroup>

## Events

| Method | Path                                                 | Description         |
| ------ | ---------------------------------------------------- | ------------------- |
| GET    | `/events`                                            | List events         |
| GET    | `/events/{event_ticker}`                             | Get event           |
| GET    | `/events/multivariate`                               | Multivariate events |
| GET    | `/events/{event_ticker}/metadata`                    | Event metadata      |
| GET    | `/events/{event_ticker}/forecast-percentile-history` | Forecast history    |
| GET    | `/events/candlesticks`                               | Event candlesticks  |

## Series

| Method | Path                      | Description |
| ------ | ------------------------- | ----------- |
| GET    | `/series`                 | List series |
| GET    | `/series/{series_ticker}` | Get series  |

## Historical data

| Method | Path                               | Description             |
| ------ | ---------------------------------- | ----------------------- |
| GET    | `/historical/markets`              | Historical markets      |
| GET    | `/historical/markets/{market_id}`  | Historical market       |
| GET    | `/historical/markets/candlesticks` | Historical candlesticks |
| GET    | `/historical/fills`                | Historical fills        |
| GET    | `/historical/orders`               | Historical orders       |
| GET    | `/historical/cutoff-timestamps`    | Cutoff timestamps       |

## Orders

Requires `KALSHI_ACCESS_KEY` and `KALSHI_PRIVATE_KEY`. Read-only—list and inspect orders.

| Method | Path                                | Description          |
| ------ | ----------------------------------- | -------------------- |
| GET    | `/orders`                           | List orders          |
| GET    | `/orders/{order_id}`                | Get order            |
| GET    | `/orders/queue-positions`           | Queue positions      |
| GET    | `/orders/{order_id}/queue-position` | Order queue position |

## Order groups

| Method | Path                       | Description      |
| ------ | -------------------------- | ---------------- |
| GET    | `/order-groups`            | Get order groups |
| GET    | `/order-groups/{group_id}` | Get order group  |

## Portfolio

Requires `KALSHI_ACCESS_KEY` and `KALSHI_PRIVATE_KEY`.

| Method | Path                               | Description               |
| ------ | ---------------------------------- | ------------------------- |
| GET    | `/portfolio/balance`               | Account balance           |
| GET    | `/portfolio/positions`             | Open positions            |
| GET    | `/portfolio/fills`                 | Fill history              |
| GET    | `/portfolio/settlements`           | Settlement history        |
| GET    | `/portfolio/resting-order-value`   | Total resting order value |
| GET    | `/portfolio/subaccounts/balances`  | Subaccount balances       |
| GET    | `/portfolio/subaccounts/transfers` | Subaccount transfers      |

<CodeGroup>
  ```bash Balance theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/kalshi/portfolio/balance
  ```

  ```bash Positions theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/kalshi/portfolio/positions
  ```

  ```bash Orders theme={null}
  curl -H "X-API-Key: your_key" \
    "http://gateway.graylayer.tech/api/v1/kalshi/orders?status=resting"
  ```
</CodeGroup>

## RFQ / Communications

| Method | Path                         | Description       |
| ------ | ---------------------------- | ----------------- |
| GET    | `/communications/id`         | Communications ID |
| GET    | `/rfqs`                      | List RFQs         |
| POST   | `/rfqs`                      | Create RFQ        |
| GET    | `/rfqs/{rfq_id}`             | Get RFQ           |
| DELETE | `/rfqs/{rfq_id}`             | Delete RFQ        |
| GET    | `/quotes`                    | List quotes       |
| POST   | `/quotes`                    | Create quote      |
| GET    | `/quotes/{quote_id}`         | Get quote         |
| DELETE | `/quotes/{quote_id}`         | Delete quote      |
| PUT    | `/quotes/{quote_id}/accept`  | Accept quote      |
| PUT    | `/quotes/{quote_id}/confirm` | Confirm quote     |

## FCM

| Method | Path             | Description   |
| ------ | ---------------- | ------------- |
| GET    | `/fcm/orders`    | FCM orders    |
| GET    | `/fcm/positions` | FCM positions |

## Structured targets and milestones

| Method | Path                              | Description             |
| ------ | --------------------------------- | ----------------------- |
| GET    | `/structured-targets`             | List structured targets |
| GET    | `/structured-targets/{target_id}` | Get structured target   |
| GET    | `/milestones`                     | List milestones         |
| GET    | `/milestone/{milestone_id}`       | Get milestone           |

## Search and misc

| Method | Path                  | Description          |
| ------ | --------------------- | -------------------- |
| GET    | `/search/tags`        | Tags for series      |
| GET    | `/search/filters`     | Filters for sports   |
| GET    | `/account/api-limits` | API rate limits      |
| GET    | `/live-data/{ticker}` | Live data for ticker |
| GET    | `/live-data`          | Multiple live data   |
| GET    | `/incentive-programs` | Incentive programs   |

## WebSocket

Real-time Kalshi data via WebSocket proxy. See [Kalshi WebSockets](/websockets/kalshi).
