Platform Accounts
Connect, list, update, and remove platform credentials
A platform account is a stored credential for a single prediction-market platform. You can connect more than one account per platform (e.g. two Kalshi keys) and each gets its own id. Pass that id as account_id on orders and account requests to route through a specific account — see Orders and Account.
All endpoints require Authorization: Bearer <key>.
Base URL: https://prediction-router-api.kalashshah47.workers.dev
Credential formats
The credential field is a single string. Its contents depend on the platform:
| Platform | credential value |
|---|---|
kalshi | <keyId>:<base64(PEM)> — your API Key ID, a colon, then the base64-encoded RSA private-key PEM block |
polymarket | The JSON credential returned by POST /v1/platform-accounts/polymarket/derive-api-key for your Deposit Wallet |
GET /v1/platform-accounts
List your connected accounts. Never returns the credential itself.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | Filter to a single platform |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/platform-accounts" \
-H "Authorization: Bearer pr_..."Response
{
"accounts": [
{
"id": "8f3c1a2b-...",
"platform": "kalshi",
"label": "Main account",
"credentialType": "user_provided",
"createdAt": "2026-06-19T10:00:00.000Z"
}
]
}POST /v1/platform-accounts
Connect a new account. Returns the new account id — store it to use as account_id later.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | kalshi polymarket |
label | string | ✓ | A name to identify this account (1–60 chars) |
credential | string | ✓ | The platform credential — see Credential formats |
Example
curl -X POST "https://prediction-router-api.kalashshah47.workers.dev/v1/platform-accounts" \
-H "Authorization: Bearer pr_..." \
-H "Content-Type: application/json" \
-d '{
"platform": "kalshi",
"label": "Main account",
"credential": "your-key-id:base64-encoded-pem"
}'Response 201
{
"account": {
"id": "8f3c1a2b-...",
"platform": "kalshi",
"label": "Main account"
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing/invalid platform, label, or credential |
PATCH /v1/platform-accounts/:id
Update an account's label, its credential, or both. Provide at least one field.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
label | string | New label (1–60 chars) | |
credential | string | New credential — see Credential formats |
Example
curl -X PATCH "https://prediction-router-api.kalashshah47.workers.dev/v1/platform-accounts/8f3c1a2b-..." \
-H "Authorization: Bearer pr_..." \
-H "Content-Type: application/json" \
-d '{ "label": "Trading bot" }'Response 200
{ "ok": true }Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | No fields provided, or values out of range |
| 404 | NOT_FOUND | No account with that id for your user |
DELETE /v1/platform-accounts/:id
Remove a connected account.
Example
curl -X DELETE "https://prediction-router-api.kalashshah47.workers.dev/v1/platform-accounts/8f3c1a2b-..." \
-H "Authorization: Bearer pr_..."Response 200
{ "ok": true }