Account
Read balances, positions, and transaction history
All account 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 read from a specific connected account; omit it to use that platform's most recently added account.
Base URL: https://prediction-router-api.kalashshah47.workers.dev
GET /v1/account/balance
Get your cash balance on a connected platform.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | Platform to query |
account_id | string | Read from a specific connected account |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/account/balance?platform=kalshi" \
-H "Authorization: Bearer pr_..."Response
{
"balance": {
"platform": "kalshi",
"available": 124.50,
"total": 250.00,
"currency": "USD"
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 403 | PLATFORM_NOT_CONNECTED | Platform credential not found |
| 405 | UNSUPPORTED_OPERATION | Platform does not support balance reads |
GET /v1/account/positions
Get your open positions on a connected platform.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | Platform to query |
account_id | string | Read from a specific connected account |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/account/positions?platform=kalshi" \
-H "Authorization: Bearer pr_..."Response
{
"positions": [
{
"platform": "kalshi",
"marketId": "KXFED-0625",
"marketTitle": "KXFED-0625",
"outcomeId": "yes",
"outcomeLabel": "Yes",
"shares": 150.0,
"avgPrice": 0.45,
"currentValue": 67.50,
"unrealizedPnl": 0
}
]
}Platform notes: Polymarket positions are marked to market (currentValue, unrealizedPnl from Polymarket). Kalshi positions are valued at cost basis: currentValue is what you paid, unrealizedPnl is 0, and marketTitle is the market ticker.
GET /v1/account/history
Get transaction history for a connected platform. Kalshi returns your fills (buy/sell); Polymarket returns trades (buy/sell) and redemptions (winnings).
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | Platform to query |
account_id | string | Read from a specific connected account | |
from | ISO 8601 datetime | Start of date range | |
to | ISO 8601 datetime | End of date range | |
limit | integer | Max results. Default 20, max 100 |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/account/history?platform=kalshi&limit=10" \
-H "Authorization: Bearer pr_..."Response
{
"history": [
{
"id": "txn_xyz",
"platform": "kalshi",
"type": "buy",
"amount": 25.00,
"currency": "USD",
"marketId": "KXFED-0325",
"marketTitle": "Fed rate cut in March?",
"timestamp": "2026-06-19T10:00:00.000Z"
}
]
}Errors
| Status | Code | Meaning |
|---|---|---|
| 403 | PLATFORM_NOT_CONNECTED | Platform credential not found |
| 405 | UNSUPPORTED_OPERATION | Platform does not support history |