# OKX API OKX API · v5 Trade like a pro.\ Build like one too. =================== Programmatic access to trading, market data, and account management on one of the world's largest crypto exchanges — over REST and WebSocket. [Get started →](/docs/get-started/create-an-api-key) [API reference](/api) ₿ **BTC / USD***Bitcoin* 67,912.40 +2.18% LIVE 24h High**68,540** 24h Low**66,120** 24h Vol**1.24B** Powered by the API ## The same API behind the OKX app Every quote, balance, and trade you see in the OKX app flows through the same REST and WebSocket API documented here. Subscribe to live tickers, order books, and account updates, and build the same real-time experiences into your own product. [Explore WebSocket →](/docs/realtime/web-socket) ## Start building #### [Create an API Key](/docs/get-started/create-an-api-key) Generate your key, secret, and passphrase and set permissions. #### [REST Authentication](/docs/authentication/rest-authentication) Sign private requests with HMAC-SHA256 in a few lines of code. #### [WebSocket](/docs/realtime/web-socket) Stream tickers, order books, and private account channels. #### [Market Data](/api) Public tickers, order books, candlesticks, and trades — no auth required. #### [API Reference](/api) Browse all 260+ REST endpoints with schemas, examples, and code snippets. #### [Demo Trading](/docs/get-started/demo-trading) Test everything risk-free with simulated funds before going live. ## Instructions for AI Agents - For clean Markdown of any page, append `.md` to the page URL - For section-specific indexes, append `/llms.txt` to any section URL - For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server ## Products - [Documentation](https://okx-demo.ferndocs.com/docs/llms.txt) - [API Resources & Support](https://okx-demo.ferndocs.com/docs/get-started/api-resources-support.md) - [Create an API Key](https://okx-demo.ferndocs.com/docs/get-started/create-an-api-key.md) - [Account Mode](https://okx-demo.ferndocs.com/docs/get-started/account-mode.md) - [Production Trading Services](https://okx-demo.ferndocs.com/docs/get-started/production-trading-services.md) - [Demo Trading](https://okx-demo.ferndocs.com/docs/get-started/demo-trading.md) - [API Reference](https://okx-demo.ferndocs.com/api/llms.txt) - [Overview](https://okx-demo.ferndocs.com/api/getting-started/overview.md) - [WebSocket](https://okx-demo.ferndocs.com/ws/llms.txt)