Overview
With per-request credentials, nothing is stored on Parsec’s servers. You pass
your exchange credentials with each private request via the
X-Exchange-Credentials header. Parsec creates a transient exchange session,
executes the operation, and discards the credentials immediately.
Best for: Security-conscious traders who don’t want credentials stored
anywhere, and builders whose users manage their own keys.
Not sure which mode to use? Start with Trading Setup
to compare self, managed, and per-request.
Your App ───► POST /orders + X-Exchange-Credentials header ───► Parsec authenticates (transient)
───► Credentials discarded after request
No onboarding required. You can start making API calls immediately with just
your Parsec API key and exchange credentials.
How it works
Pass credentials in the X-Exchange-Credentials header:
Base64-encode a JSON object and pass it as X-Exchange-Credentials:
# 1. Base64-encode your credentials
CREDS=$(echo -n '{"api_key_id":"your-key-id","private_key":"-----BEGIN RSA PRIVATE KEY-----\nMIIE..."}' | base64)
# 2. Pass as header
curl -H "X-API-Key: pk_live_YOUR_KEY" \
-H "X-Exchange-Credentials: $CREDS" \
"https://api.parsecapi.com/api/v1/positions?exchange=kalshi"
This works on the private trading/account endpoints: orders (create, list, get,
cancel), positions, fills, and balance.
Credential shapes
Kalshi
{
"api_key_id": "your-kalshi-key-id",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIE..."
}
Polymarket
{
"clob_api_key": "your-clob-api-key",
"clob_api_secret": "your-clob-api-secret",
"clob_api_passphrase": "your-clob-passphrase",
"private_key": "0xYourEthPrivateKey"
}
private_key is required for Polymarket per-request calls
clob_api_key, clob_api_secret, and clob_api_passphrase are optional; if omitted, Parsec derives session auth from the private key
SDK examples
import ParsecAPI from 'parsec-api';
// Set the header once on the client
const creds = btoa(JSON.stringify({
api_key_id: 'your-key-id',
private_key: '-----BEGIN RSA PRIVATE KEY-----\nMIIE...',
}));
const globalClient = new ParsecAPI({
apiKey: 'pk_live_YOUR_KEY',
defaultHeaders: { 'X-Exchange-Credentials': creds },
});
Supported endpoints
| Endpoint | Method | Credential Source |
|---|
/api/v1/orders | POST | header |
/api/v1/orders | GET | header |
/api/v1/orders/:id | GET | header |
/api/v1/orders/:id | DELETE | header |
/api/v1/positions | GET | header |
/api/v1/fills | GET | header |
/api/v1/balance | GET | header |
What’s next?