# OKX API (slim)

> OKX's V5 API covers spot, margin, perpetual, futures and options trading, account and market data over REST and WebSocket, with demo trading on the same host and an open-source Agent Trade Kit whose okx-trade-mcp package is a local MCP server.

- Full: https://www.anchorterminal.com/tools/okx.md (~8,850 tokens) · this version ~2,280 tokens · JSON https://www.anchorterminal.com/tools/okx.json · canonical https://www.anchorterminal.com/tools/okx
- Index: https://www.anchorterminal.com/llms.txt · API: https://www.anchorterminal.com/api/v1/index.json · MCP: https://www.anchorterminal.com/mcp · Updated: 2026-11-04 · pricing https://www.anchorterminal.com/tools/okx#pricing · reviews https://www.anchorterminal.com/tools/okx#reviews
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)

**B · 64.3/100 · rank #413 of 1349 · #4 in Crypto exchanges · not agent-ready · confidence medium**


Assessment: OKX publishes per-endpoint rate limits, Read, Trade and Withdraw key permissions with IP binding, demo trading on the production host, and an MIT MCP server with 170 tools, a read-only flag and a permission check at startup. The fee table and privacy policy were not read, no OpenAPI file was found, and the news tools return third-party text.

## Facts

- Kind: HTTP API · vendor: OKX · category: Crypto exchanges · legal entity: Aux Cayes FinTech Co. Ltd. · provenance 85/100
- Local only (stdio): npm `@okx_ai/okx-trade-mcp`, npm `@okx_ai/okx-trade-cli`, pypi `python-okx`
- Auth: API key · pricing: Pay per use · x402: no · licence: Proprietary hosted service under OKX's Terms of Service (29 October 2026) and API Agreement (28 July 2026). The Agent Trade Kit (MCP server, CLI and skills) is MIT
- Probe metrics: not measured yet (probes haven't run)
- Surface listed: The V5 REST API at openapi.okx.com/api/v5 and its WebSocket channels at ws.okx.com, read from okx.com/docs-v5, the help centre, okx.com/status and a shallow clone of okx/agent-trade-kit on 3 November 2026. No account was made, no key was used and no MCP session was opened
- MCP server: Official, local. okx-trade-mcp (stdio) in okx/agent-trade-kit, npm @okx_ai/okx-trade-mcp v1.5.0 of 28 October 2026, 170 tools in 11 modules per the README (market 19, spot 13, swap 17, futures 18, option 10, account 14, event 9, earn 24, bot 18, news 7, smartmoney 10), default modules spot, swap and account, --read-only, --modules and a demo profile. Keys stay in ~/.okx/config.toml. Not in the official MCP registry. Skills for OpenClaw in okx/agent-skills
- Key permissions: Read, Trade and Withdraw, in any combination; up to 20 IP addresses or ranges per key; Trade or Withdraw keys without an IP binding expire after 14 days without use. No withdrawal address allow-list was found in the API docs read
- Rate limits: Per endpoint and per User ID for private REST (sub-accounts count separately); Place order 60 per 2 seconds per instrument, lead-trader instruments 4 per 2 seconds; Get balance 10 per 2 seconds; 3 amendments in flight per order; 1,000 order requests per 2 seconds per sub-account, higher by fill ratio from VIP5; WebSocket 3 connections a second per IP, 480 subscribe, unsubscribe and login requests an hour per connection, 30 connections per channel per sub-account. Error 50011 on a limit
- Sandbox: Demo trading on the production REST host and wspap.okx.com WebSocket hosts with the header `x-simulated-trading` set to 1 and demo keys that do not expire; withdraw, deposit and purchase or redemption are unsupported there
- Countries: Restricted per the Risk and Compliance Disclosure of 8 July 2026 are Afghanistan, Canada, Cuba, Hong Kong, Iran, India, Japan, Malaysia, Nepal, North Korea, Syria, Crimea, Donetsk and Luhansk, Uzbekistan and certain US jurisdictions including all US territories; services are limited in Australia, the Bahamas, Brazil, Eritrea, Russia, South Korea and the United Kingdom. Regional entities serve the EEA (eea.okx.com), the US and Australia (us.okx.com)
- Fees: Not read. okx.com/fees loads its table by script and the fee FAQ (updated 9 September 2026) says the applicable rates are the ones shown while logged in
- FIX and WebSocket: No FIX API in the V5 docs read. WebSocket public, private and business channels at ws.okx.com (demo at wspap.okx.com), with a 30-second idle disconnect and port 8443 retiring on 31 October and 16 November 2026
- Terms on automated trading: The Terms of Service (29 October 2026) say API use may be subject to order rate limits and repeated violations may suspend the account. The API Agreement (28 July 2026) covers the Agent Trade Kit, bars wash trading, layering, spoofing, quote stuffing and momentum ignition by an agent, bars circumventing rate limits, requires minimum key scope, makes the user responsible for keys and AI-submitted orders, and says use cases a third-party AI provider's terms restrict, including fully automated trading without human oversight, must not run through the API
- SDKs: python-okx on PyPI (the only SDK named in the docs), the okx-trade-cli, and a market-maker sample at okxapi/okx-sample-market-maker
- Status: okx.com/status with issue descriptions, maintenance notices and per-asset deposit and withdrawal status, no component history; nothing listed for August to November 2026
- Legal entity: Aux Cayes FinTech Co. Ltd. (Seychelles) for most users, with OKX Europe Limited, OKX Inc., OKX Australia, OKX Dubai, OKX Brazil, OKX Singapore and OKX El Salvador for their regions, per the terms

- Scores: Reliability 65, Performance pending, Schema & documentation 73, Agent ergonomics 77, Security & auth 68, Payments & pricing 20, Task success pending, Maintenance & community 81, Transparency & trust 62 · total over the 7 assessed categories
- Why: Reliability, Read with the hosted lines on the V5 REST API. · Schema & documentation, No OpenAPI file was found in the V5 docs; the kit's tool definitions are typed TypeScript with annotations, and the organisation has an unde… · Agent ergonomics, limit parameters on books, candles and history, and in the kit --modules and --read-only narrow 170 tools to the three default modules; no f… · Security & auth, Key, secret and passphrase with Read, Trade and Withdraw permissions, up to 20 bound IPs, revocation in the account, and unbound Trade or Wi… · Payments & pricing, No machine payment protocol (0). · Maintenance & community, Read as a closed service with an open-source kit. · Transparency & trust, The editorial half.
- Sources: 19, open questions: 8, both in the full twin
- Capabilities: exchange.spot-trading, exchange.market-data, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto
- JSON: https://www.anchorterminal.com/api/v1/tools/okx.json
- Verify (for the vendor): the badge `https://www.anchorterminal.com/badges/okx.svg` or a link to https://www.anchorterminal.com/tools/okx from a page on okx.com or one of its subdomains, or the README at the root of github.com/okx/agent-trade-kit, then `POST https://www.anchorterminal.com/api/v1/verify` `{"slug", "url"}` or `verify_listing` at /mcp; re-checked weekly, no effect on the grade. Snippets in the full twin.
- Support: https://www.okx.com/help; https://www.okx.com/docs-v5/en/; more in the full twin

## Before you call it

1. Start okx-trade-mcp with --profile demo first, then --read-only on a live key; load only the modules the task needs
2. Use a sub-account key with Read and Trade only, bound to the agent's IP; an unbound Trade key expires after 14 idle days
3. Stay under 60 place-order requests per 2 seconds per instrument and at most 3 amendments in flight per order; 50011 means the limit was hit
4. Send a clOrdId on every order and use the structured error block (code, message, endpoint) to diagnose with read-only tools before retrying
5. Call us.okx.com or eea.okx.com for US, Australian and EEA accounts; openapi.okx.com does not serve those regions

## Connect

```bash
npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli
```

```bash
curl https://www.okx.com/api/v5/market/ticker?instId=BTC-USDT
```
Full config and headless snippets are in the full page. Through letme (picks today, calling later): https://letme.dev/okx

## Similar tools

| Tool | Grade | Score | Shared capabilities | Slim |
| --- | --- | --- | --- | --- |
| Gemini Exchange API | BB | 74.6 | exchange.market-data, exchange.spot-trading, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto | https://www.anchorterminal.com/tools/gemini-exchange.min.md |
| Kraken API | BB | 71 | exchange.spot-trading, exchange.market-data, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto | https://www.anchorterminal.com/tools/kraken.min.md |
| Binance API | B | 63.2 | exchange.spot-trading, exchange.market-data, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto | https://www.anchorterminal.com/tools/binance.min.md |
| Bitfinex API | C | 58.4 | exchange.market-data, exchange.spot-trading, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto | https://www.anchorterminal.com/tools/bitfinex.min.md |
| Bybit | C | 57.3 | exchange.market-data, exchange.spot-trading, exchange.derivatives, exchange.balances, exchange.transfers, exchange.staking, market.crypto | https://www.anchorterminal.com/tools/bybit.min.md |


## Panel reviews (0, desk reviews from public material, no calls made)

