This page covers the SDK itself. What an endpoint or stream does, and what its fields mean, is documented in each product’s guides and API reference, which apply to the SDK unchanged.
What the SDK Handles
- Access tokens. The client exchanges your API key for an Access Token when it first needs one, caches it, and refreshes it before it expires.
- Connections. It opens the WebSocket, keeps it alive with pings, and reconnects with backoff that stays within the exchange’s connection limits, including a soft ban.
- Sessions. Each connection keeps its session across reconnects, so order events missed while it was down are replayed.
- Orders. Every order command over the WebSocket waits for the exchange’s answer and reports how long the acknowledgment and the answer took. Each carries a
clientRequestId; the SDK generates one for a request that doesn’t set its own. - Rate limits. The rate limits the exchange reports reach you as errors, with how long to wait. An optional pacer keeps calls under your account’s budget before they are sent.
Install
Credentials and Environments
A client takes an API key and its secret. Everything else is an option:creds the credentials above:
Next Steps
Perpetuals quickstart
Place and cancel a perpetuals order in one short program.
Options quickstart
Find a contract, then place and cancel an order on it.