Prediction Router
API Reference

Orders

Place, list, and cancel orders on supported platforms

All orders endpoints require Authorization: Bearer <key> and a connected platform account. Connect one first via POST /v1/platform-accounts.

Every endpoint below accepts an optional account_id query parameter. Pass it to route through a specific connected account; omit it to use that platform's most recently added account.

Base URL: https://prediction-router-api.kalashshah47.workers.dev


POST /v1/orders

Place an order on a connected platform.

Body parameters

ParameterTypeRequiredDescription
platformstring✓kalshi polymarket
marketIdstring✓Platform-native market ID
outcomeIdstring✓Kalshi: yes or no. Polymarket: the outcome's CLOB token ID
sidestring✓buy or sell
amountnumber✓Number of shares (Polymarket) or contracts (Kalshi) to buy or sell. Cost ≈ amount × price
pricenumber✓Limit price per share, strictly between 0 and 1, quoted for the chosen outcome. Orders rest good-till-cancelled

Query parameters

ParameterTypeRequiredDescription
account_idstringRoute through a specific connected account. Defaults to the platform's most recent account

Example

curl -X POST "https://prediction-router-api.kalashshah47.workers.dev/v1/orders?account_id=8f3c1a2b-..." \
  -H "Authorization: Bearer pr_..." \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "kalshi",
    "marketId": "KXFED-0325",
    "outcomeId": "yes",
    "side": "buy",
    "amount": 25,
    "price": 0.28
  }'

Response 201

{
  "order": {
    "id": "ord_abc123",
    "platform": "kalshi",
    "marketId": "KXFED-0325",
    "outcomeId": "yes",
    "side": "buy",
    "amount": 25,
    "price": 0.28,
    "shares": 0,
    "status": "open",
    "createdAt": "2026-06-19T10:00:00.000Z",
    "filledAt": null
  }
}

Errors

StatusCodeMeaning
400VALIDATION_ERRORMissing or invalid body fields
403PLATFORM_NOT_CONNECTEDPlatform credential not found
405UNSUPPORTED_OPERATIONPlatform does not support trading

GET /v1/orders

List open orders for a connected platform.

Query parameters

ParameterTypeRequiredDescription
platformstring✓Platform to query
account_idstringLimit to a specific connected account

Example

curl "https://prediction-router-api.kalashshah47.workers.dev/v1/orders?platform=kalshi" \
  -H "Authorization: Bearer pr_..."

Response

{
  "orders": [
    {
      "id": "ord_abc123",
      "platform": "kalshi",
      "marketId": "KXFED-0325",
      "outcomeId": "yes",
      "side": "buy",
      "amount": 25,
      "price": 0.28,
      "shares": 89.28,
      "status": "open",
      "createdAt": "2026-06-19T10:00:00.000Z",
      "filledAt": null
    }
  ]
}

DELETE /v1/orders/:id

Cancel an open order.

Query parameters

ParameterTypeRequiredDescription
platformstring✓Platform the order belongs to
account_idstringThe account the order was placed through

Example

curl -X DELETE "https://prediction-router-api.kalashshah47.workers.dev/v1/orders/ord_abc123?platform=kalshi" \
  -H "Authorization: Bearer pr_..."

Response 200

{ "cancelled": true }

Errors

StatusCodeMeaning
403PLATFORM_NOT_CONNECTEDPlatform credential not found
405UNSUPPORTED_OPERATIONPlatform does not support trading