# OKX API (Node.js SDK) ## Docs - [Endpoint index](https://mintlify.wiki/tiagosiebler/okx-api/api-reference/endpoint-index.md): Every REST and WebSocket API endpoint mapped to its SDK method, organised by category. - [RestClient](https://mintlify.wiki/tiagosiebler/okx-api/api-reference/rest-client.md): Complete API reference for the RestClient class — constructor options and all available methods. - [WebsocketAPIClient](https://mintlify.wiki/tiagosiebler/okx-api/api-reference/websocket-api-client.md): Complete API reference for the WebsocketAPIClient class — a promise-driven wrapper for the OKX WebSocket Trade API. - [WebsocketClient](https://mintlify.wiki/tiagosiebler/okx-api/api-reference/websocket-client.md): Complete API reference for the WebsocketClient class — constructor, methods, and events. - [Authentication](https://mintlify.wiki/tiagosiebler/okx-api/authentication.md): How to create OKX API keys and configure credentials in the SDK. - [Browser Usage](https://mintlify.wiki/tiagosiebler/okx-api/guides/browser-usage.md): Use the okx-api SDK in browser and frontend projects via the TypeScript import approach or the pre-built webpack bundle. - [Error Handling](https://mintlify.wiki/tiagosiebler/okx-api/guides/error-handling.md): Understand how the okx-api SDK surfaces REST and WebSocket errors, and how to handle them in your application. - [LLM & AI Usage](https://mintlify.wiki/tiagosiebler/okx-api/guides/llm-ai-usage.md): Use the bundled llms.txt file to give AI coding assistants accurate, up-to-date knowledge of the okx-api SDK. - [Regions](https://mintlify.wiki/tiagosiebler/okx-api/guides/regions.md): Configure the okx-api SDK for OKX Global, EEA (my.okx.com), or US (app.okx.com) regions. - [TypeScript](https://mintlify.wiki/tiagosiebler/okx-api/guides/typescript.md): Get the most out of the okx-api SDK with TypeScript — typed requests, typed responses, and IDE autocomplete for every endpoint. - [OKX API — Node.js SDK](https://mintlify.wiki/tiagosiebler/okx-api/introduction.md): Complete Node.js & TypeScript SDK for OKX REST APIs and WebSockets - [Quickstart](https://mintlify.wiki/tiagosiebler/okx-api/quickstart.md): Go from zero to a working OKX API integration in minutes. - [Account](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/account.md): Methods for managing your OKX trading account: balances, positions, leverage, fees, and bills. - [Block Trading](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/block-trading.md): RFQ creation, quote management, block trade execution, and market data for OKX block trading (RFQ platform). - [Copy Trading](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/copy-trading.md): Lead trader management, copy settings, position tracking, and profit sharing for copy trading. - [Earn & Finance](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/earn-finance.md): Staking, DeFi products, ETH liquid staking, simple earn savings, and fixed/flexible lending. - [Funding](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/funding.md): Deposit addresses, withdrawal submission, fund transfers, and currency conversion via the funding account endpoints. - [Grid Trading](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/grid-trading.md): Create and manage spot, futures, and contract grid bots, plus AI parameter recommendations and RSI back-testing. - [Market Data](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/market-data.md): Public market data endpoints for tickers, candles, order books, trades, funding rates, and system status. No API keys required. - [REST Client](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/overview.md): The RestClient class provides access to all OKX REST API endpoints, covering trading, account management, market data, and more. - [Recurring Buy](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/recurring-buy.md): Set up, amend, stop, and track recurring dollar-cost averaging (DCA) purchase orders. - [Signal Bots](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/signal-bots.md): Create signal sources, deploy and manage signal-driven trading bots, track positions, and handle sub-orders. - [Spread Trading](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/spread-trading.md): Submit and manage spread orders, query spread-specific market data (order books, tickers, candles), and view spread definitions. - [Sub-accounts](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/subaccounts.md): List sub-accounts, view their balances, transfer funds between accounts, and manage API key permissions. - [Trading](https://mintlify.wiki/tiagosiebler/okx-api/rest-client/trading.md): Place, cancel, and amend orders. Query pending orders, order history, and trade fills. - [Order management](https://mintlify.wiki/tiagosiebler/okx-api/websocket-api-client/order-management.md): Place, amend, cancel, and mass-cancel orders over a persistent WebSocket connection using typed async methods. - [WebSocket API Client](https://mintlify.wiki/tiagosiebler/okx-api/websocket-api-client/overview.md): Place and manage orders with sub-millisecond latency using a promise-based WebSocket API wrapper. - [Spread orders](https://mintlify.wiki/tiagosiebler/okx-api/websocket-api-client/spread-orders.md): Place, amend, and cancel spread trading orders over the WebSocket API using the business channel. - [Event Handling](https://mintlify.wiki/tiagosiebler/okx-api/websocket-client/events-handling.md): Full reference for all WebSocket events emitted by the client, their TypeScript types, and best practices for structuring handlers. - [WebSocket Client](https://mintlify.wiki/tiagosiebler/okx-api/websocket-client/overview.md): Real-time market data and private account events via OKX WebSocket channels. - [Private Channels](https://mintlify.wiki/tiagosiebler/okx-api/websocket-client/private-channels.md): Subscribe to account updates, positions, orders, and fills with API credentials. - [Public Channels](https://mintlify.wiki/tiagosiebler/okx-api/websocket-client/public-channels.md): Subscribe to real-time market data — instruments, tickers, order books, trades, and candles — without API credentials. - [Reconnection](https://mintlify.wiki/tiagosiebler/okx-api/websocket-client/reconnection.md): How the WebSocket client detects dropped connections, restores authentication, and resubscribes active topics automatically. ## OpenAPI Specs - [openapi](https://mintlify.wiki/tiagosiebler/okx-api/api-reference/openapi.json)