Venue keys
Store the user's Kalshi API key, which every Kalshi trade uses, then read whether it is connected.
This is the user's venue credential. Every Kalshi trade, managed or self-custody, uses it. See Kalshi. It is not your app's x-app-api-key. Authenticate with x-app-id and Authorization: Bearer. The stored secret is never returned.
The same ProphetX accessKey and secretKey can be connected in multiple apps. Connect them separately for the authenticated user in each app; each app must have ProphetX Direct enabled.
An sufwan-local-test x-app-api-key can also be reused across app IDs on app and user routes, including /venue-keys, without app membership checks. Keep the valid key unchanged and send the target x-app-id with a user bearer token issued for that target app. The key retains its original scope and rate limit. Admin routes continue to require a key issued for their target app.
Keep shared keys secure. Reusing ProphetX credentials connects the same real venue account in each app, so its funds and venue limits are shared even though sufwan-local-test stores each user's connection and orders separately.
import { Venue } from "@agg-build/sdk";
await client.upsertVenueKey({
venue: Venue.kalshi,
credentials: { keyId, privateKey },
});
const status = await client.getVenueKeyStatus(Venue.kalshi);
// status.connected, status.validatedAt, status.kycStatusThe cURL example uses jq to JSON-encode the PEM key, preserving its line breaks. Keep the key
out of source control and logs.
Full shapes on Upsert a venue API key and Get venue key connection status.
List stored summaries with List venue keys (client.listVenueKeys()). Remove one with Delete a venue key (client.deleteVenueKey(Venue.kalshi)).