OKX API — Node.js SDK
Theokx-api package is a fully-featured, actively maintained Node.js and TypeScript SDK for interacting with the OKX exchange. It covers every endpoint in OKX’s REST API and provides a robust, auto-reconnecting WebSocket client for real-time market data and private account streams.
Quickstart
Install the package and make your first API call in minutes
Authentication
Learn how to create and configure your OKX API credentials
REST Client
Explore the full REST API — account, trading, funding and more
WebSocket Client
Subscribe to real-time streams with automatic reconnection
Why use this SDK?
Complete REST coverage
Every OKX v5 REST endpoint is mapped to a typed TypeScript method — account, trading, funding, market data, earn, copy trading, grid trading, signal bots, block trading, and more.
Robust WebSockets
Automatic heartbeat detection, reconnection, re-authentication, and channel resubscription. Connections recover from failures without any extra code.
WebSocket API Client
Place, amend, and cancel orders via persistent WebSocket connections using a familiar promise-based interface — lower latency than REST.
Full TypeScript support
Type declarations for every request parameter and response object. Get IDE autocomplete and compile-time safety across the entire SDK.
Multi-region support
Works with OKX Global (
www.okx.com), OKX EEA (my.okx.com), and OKX US (app.okx.com) — just set the market option.Browser compatible
Comes with a webpack bundle for use in frontend applications. Works in any modern browser.
Key exports
Installation
Community & support
- Issues & bugs — GitHub Issues
- Discussion — Node.js Algo Traders on Telegram
- Announcements — @sieblyio on X/Twitter
This SDK is part of the Siebly.io family of exchange SDKs. Related packages are available for Bybit, Binance, Gate, Bitget, KuCoin, Coinbase, and more.

