# dYdX vs OKX API

> dYdX scores 69.5 (B) to OKX's 64.3 (B) for exchange derivatives. Prices, MCP, x402, uptime and agent notes side by side.

- Canonical: https://www.anchorterminal.com/compare/dydx-vs-okx
- Markdown: https://www.anchorterminal.com/compare/dydx-vs-okx.md (~5,050 tokens)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-03

dYdX scores 69.5 (B) on agent readiness against OKX API's 64.3 (B), and leads in 4 of 7 scored categories. OKX API leads on schema & documentation, agent ergonomics and transparency & trust. Both do exchange derivatives.

- dYdX: grade B, 69.5/100, rank #221 of 1349. Markdown https://www.anchorterminal.com/tools/dydx.md · JSON https://www.anchorterminal.com/api/v1/tools/dydx.json
- OKX API: grade B, 64.3/100, rank #413 of 1349. Markdown https://www.anchorterminal.com/tools/okx.md · JSON https://www.anchorterminal.com/api/v1/tools/okx.json
- Best crypto exchange APIs and MCP servers for AI agents: https://www.anchorterminal.com/best/crypto-exchanges/index.md
- All 210 exchanges comparisons: https://www.anchorterminal.com/compare/crypto-exchanges/index.md

## Which one, for what

### dYdX (B)

Good for: An agent trading perpetuals from its own Cosmos wallet or through a permissioned key on an owner's account, outside the US, Canada and UK.

Ahead on:
- Reliability, 83 against 65
- Security & auth, 78 against 68
- Payments & pricing, 60 against 20

Also in its favour:
- Open source

Watch for: No official MCP server; the one registry entry is a third party's analytics server

### OKX API (B)

Good for: An agent trading spot, perpetuals, futures or options on a person's OKX account from a local machine, with demo trading to test first and grid or DCA bots through the kit.

Ahead on:
- Schema & documentation, 73 against 58
- Agent ergonomics, 77 against 66
- Transparency & trust, 62 against 50

Also in its favour:
- Runs on your own machine
- Free to start without a card

Watch for: The fee table loads by script and the fee FAQ defers to the logged-in view, so maker and taker rates were not read


## Why the edge

### Payments & pricing: dYdX +40

- dYdX (60): No machine payment protocol (0). Fees public per tier without login (20). Testnet with a faucet and no card anywhere (20). No signup; an agent with a funded wallet trades, subject to the geographic terms (20). Total 60.
- OKX API (20): No machine payment protocol (0). The fee table loads by script and the fee FAQ defers to the logged-in view, so no rate was read (0 of 20, unchecked). Public market data and demo trading need no funded account or card (20). A person signs up, verifies and mints a key (0). 0 + 0 + 20 + 0 = 20.

### Reliability: dYdX +18

- dYdX (83): Read with the hosted lines on the indexer API and the chain endpoints the clients submit to. status.dydx.trade is an Atlassian Statuspage with Frontends, dYdX Chain, Indexer, Order Gateway and Client Libraries components and an RSS history (20). From 1 August to 3 November 2026 the feed has eight items, seven scheduled maintenance windows of 29 minutes to 2 hours (indexer on 9 September, 8 and 15 October, protocol v9.7 on 11 September and v9.8.0 on 12 October, WebSocket compression on 26 and 28 October) and one degraded instant-deposit path through an onboarding partner from 24 to 29 September, outside the trading API. Clean or trivial (30). Rate limits documented with numbers for the indexer, the block limits and the public nodes (15). No 429 shape or Retry-After for the indexer; short-term orders expire by `goodTilBlock` and client IDs let an agent find an order after a timeout (8 of 15). No SLA (0). Mainnet generally available; the Order Entry Gateway is marked testnet-only (10). 20 + 30 + 15 + 8 + 0 + 10 = 83.
- OKX API (65): Read with the hosted lines on the V5 REST API. okx.com/status is OKX's own page with issue descriptions, maintenance notices and deposit and withdrawal status, but no component history or feed (10 of 20). It lists no incident between 5 August and 3 November 2026; its newest entry is from March 2024, and whether every incident reaches the page cannot be told, so read as clean with a doubt (20 of 30). Rate limits per endpoint, per User ID and per sub-account with numbers, and WebSocket limits (15). Error 50011 on a limit, a clOrdId on orders and a cap of 3 amendments in flight, but no Retry-After or backoff guidance found (10 of 15). No SLA (0). Generally available (10). 10 + 20 + 15 + 10 + 0 + 10 = 65.

### Schema & documentation: OKX API +15

- dYdX (58): No OpenAPI file found for the indexer; the docs publish a types reference of about 200 pages (OrderSide, TimeInForce, OrderStatus and the rest) and the chain's protobuf messages are in the clients (8 of 25). llms.txt and Markdown docs (10). Endpoint pages describe each call and the guides say when to use short-term against long-term orders and the indexer against the node, but descriptions are short (12 of 20). Enums and types on every field in the reference, with pagination and cursor parameters typed (11 of 15). Examples in Python, TypeScript and Rust for each step; errors are described by HTTP status (400 malformed, 404 not found) with no code list (9 of 15). A /v4 path, protocol releases dated on the status page, deprecated rate-limit fields marked, but no API changelog (8 of 15). Total 58.
- OKX API (73): No OpenAPI file was found in the V5 docs; the kit's tool definitions are typed TypeScript with annotations, and the organisation has an undescribed ai-builder-openapi-md repository we did not read (12 of 25). okx.com/llms.txt exists and links the API and Agent Trade Kit pages, though the V5 docs have no Markdown twins (5 of 10). Each endpoint states its rate limit, rule, parameters and notes (15 of 20). Enums for ordType, tdMode and instType with required flags (12 of 15). Request and response examples per endpoint and an error code list with messages (14 of 15). A dated changelog with an upcoming-changes section that labels breaking changes and dates sunsets (15). 12 + 5 + 15 + 12 + 14 + 15 = 73.

### Transparency & trust: OKX API +12

- dYdX (50): The editorial half. Clients AGPL-3.0 with a terms-bound use condition, the chain under a custom licence, two terms documents (dYdX Trading Inc.'s v4 terms of 12 March 2026 and dYdX International Ltd's of 6 June 2025) that are clear about who runs nothing (22 of 30). The privacy policy of 6 June 2025 names dYdX International Ltd, keeps technical data until no longer necessary with no periods, and names no subprocessors; nothing covers the unnamed indexer operator (12 of 30). Protocol upgrades and the WebSocket compression change were posted as dated maintenance notices, deprecated rate-limit fields are marked, but no deprecation policy or notice period is stated (10 of 20). The policy says data may be processed in the EEA and elsewhere, with no subprocessor list (6 of 20). Total 50.
- OKX API (62): The editorial half. A closed service with terms that name the contracting entities by region and an API Agreement for agents; the kit is MIT (17 of 30). The privacy policy was not read (5 of 30). The changelog dates sunsets and labels breaking changes, such as port 8443 on 31 October and 16 November 2026 (16 of 20). No subprocessor or data-location statement read; the MCP server is local and its npm package runs a postinstall script whose purpose we did not trace (0 of 20). 17 + 5 + 16 + 0 = 38.

### Agent ergonomics: OKX API +11

- dYdX (66): An API, read for response sizing. `limit` on list endpoints, candles by resolution, sparklines by period; the order book comes whole (16 of 25). `limit`, `page` on fills, transfers and funding, and height or time cursors (16 of 20). Indexer errors are a status and a sentence; order rejections come back from the chain as transaction results the clients surface (8 of 20). Unique 32-bit client IDs, `goodTilBlock` expiry on short-term orders, cancel by order ID; no MCP annotations apply (14 of 20). Few required fields with market parameters fetched for unit conversion, and official clients in TypeScript, Python and Rust (12 of 15). Total 66.
- OKX API (77): limit parameters on books, candles and history, and in the kit --modules and --read-only narrow 170 tools to the three default modules; no field selection (17 of 25). after, before and limit cursors on history endpoints (18 of 20). Numeric codes with messages, such as 51020 for an invalid quantity, and the kit returns a structured error block with code, message and endpoint (17 of 20). clOrdId on orders, batch endpoints and a cap of 3 amendments in flight; the kit sets readOnlyHint on query tools but destructiveHint false on order tools and has no idempotency key (13 of 20). python-okx, the CLI and a demo profile, with passphrase and HMAC signing on every private call (12 of 15). 17 + 18 + 17 + 13 + 12 = 77.

### Security & auth: dYdX +10

- dYdX (78): Orders are signed by the account key or by a permissioned key the owner adds as an authenticator, limited by message type, subaccount and market with AllOf or AnyOf, and revoked by `remove_authenticator`; no shared secret and nothing in a URL (28 of 30). A key can be confined to placing and cancelling orders on one subaccount with withdrawals and transfers excluded, though not to a position or order size, and the interface's default API wallet trades all cross-margin pairs (16 of 20). The API returns no untrusted content (10). Every action is a chain transaction and the indexer lists fills, orders and transfers per subaccount, and authenticators can be listed; no per-key log (10 of 15). A Cantina bug bounty up to $1,000,000 sponsored by dYdX Trading Inc. over the protocol, indexer, web client and SDKs, an Informal Systems audit; no security.txt and no certification (14 of 20). Total 78.
- OKX API (68): Key, secret and passphrase with Read, Trade and Withdraw permissions, up to 20 bound IPs, revocation in the account, and unbound Trade or Withdraw keys that expire after 14 idle days; no OAuth (28 of 30). Read-only keys, sub-account keys, demo trading, the kit's --read-only flag and its startup check that hides order tools when the key cannot trade, and an API Agreement requiring minimum scope; no confirmation step in the kit (18 of 20). The news and smartmoney modules return third-party text and the docs read give no guidance on treating it as untrusted (5 of 15). An account audit log tool in the kit and usage records for unbound keys in the Security Center, no per-call log (9 of 15). No security.txt; SECURITY.md with security@okx.com and GitHub private advisories; certifications and a bounty not read (8 of 20). 28 + 18 + 5 + 9 + 8 = 68.

## Score by category

| Category | Weight | dYdX | OKX API | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% (20 this run) | 83 | 65 | dYdX +18 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% (16.2 this run) | 58 | 73 | OKX API +15 |
| Agent ergonomics | 13% (16.2 this run) | 66 | 77 | OKX API +11 |
| Security & auth | 14% (17.5 this run) | 78 | 68 | dYdX +10 |
| Payments & pricing | 10% (12.5 this run) | 60 | 20 | dYdX +40 |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% (8.8 this run) | 83 | 81 | dYdX +2 |
| Transparency & trust | 7% (8.8 this run) | 50 | 62 | OKX API +12 |
| Negative events | ≤15 | 0 | 0 | |
| **Total** | | **69.5 · B** | **64.3 · B** | |

## Facts side by side

| Fact | dYdX | OKX API |
| --- | --- | --- |
| Kind | HTTP API | HTTP API |
| Vendor | dYdX Trading Inc. | OKX |
| Hosted endpoint | no (local only) | no (local only) |
| Transports |  | stdio |
| Auth | OAuth or key | API key |
| Pricing | Pay per use | Pay per use |
| x402 | no | no |
| Licence | The clients are AGPL-3.0 with a use condition tied to the v4 Terms of Use; the chain software (dydxprotocol/v4-chain) carries a custom licence GitHub cannot classify. The hosted indexer at indexer.dydx.trade and the front end are run by third parties, not dYdX Trading Inc. | 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 |
| Tools exposed | 0 | 170 |
| Read-only variant documented | no | yes |
| llms.txt | yes | yes |
| Last release | 2026-10-29 | 2026-10-28 |
| Terms last updated | 2026-03-12 | 2026-10-29 |
| Privacy policy last updated | 2025-06-06 | couldn't be read |
| Customer content may train models | not found in the text | not found in the text |
| Terms restrict automated access | not found in the text | not found in the text |
| Terms restrict benchmarking | not found in the text | not found in the text |
| Terms or service can change without notice | yes | yes |
| Arbitration or class-action waiver | yes | yes |
| Popularity | 119 stars, 86k npm/wk | 499 stars, 1.8k npm/wk |

## Verdicts

**dYdX.** dYdX gives an agent keyless indexer reads, permissioned keys limited by message type, subaccount and market, a Statuspage with a clean 90 days, published fees and a testnet with a faucet. There is no official MCP server or OpenAPI file, orders are chain transactions signed by the clients, and no one entity operates the hosted endpoints.

**OKX API.** 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.

## Before you call either

### dYdX

1. Ask the account owner for an authenticator limited to `/dydxprotocol.clob.MsgPlaceOrder` and `MsgCancelOrder` on one subaccount, and keep its private key out of prompts
2. Set a unique 32-bit `clientId` on every order and look it up on `/v4/orders` after a timeout; short-term orders expire with `goodTilBlock` (at most 20 blocks ahead)
3. Stay under 2 stateful orders a block and 20 per 100 blocks; failed placements count, so use short-term orders for active trading
4. Enable permessage-deflate on the indexer WebSocket; since 26 October 2026 connections without compression may be refused with 426
5. Check `/v4/geo` and the compliance screen before trading for a person, since the terms exclude the United States, Canada and the United Kingdom

### OKX API

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

## Questions

### Which is better for AI agents, dYdX or OKX API?

dYdX scores 69.5 (B) on agent readiness against OKX API's 64.3 (B), and leads in 4 of 7 scored categories. OKX API leads on schema & documentation, agent ergonomics and transparency & trust.

### Do dYdX and OKX API need an API key?

dYdX takes an API key or an OAuth sign-in. OKX API needs an API key.

### Can an agent call dYdX and OKX API without installing anything?

No hosted endpoint is listed for dYdX. OKX API runs on your own machine, with no hosted endpoint listed.

### Are dYdX and OKX API open source?

dYdX is open source (The clients are AGPL-3.0 with a use condition tied to the v4 Terms of Use; the chain software (dydxprotocol/v4-chain) carries a custom licence GitHub cannot classify. The hosted indexer at indexer.dydx.trade and the front end are run by third parties, not dYdX Trading Inc.). No open-source release is listed for OKX API.


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/dydx-vs-okx.json, and with the fewest tokens: https://www.anchorterminal.com/compare/dydx-vs-okx.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "dydx", "b": "okx"}`. From a terminal: `anchor compare dydx okx`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/dydx.json and https://www.anchorterminal.com/api/v1/tools/okx.json

## Other comparisons with dYdX or OKX API

- [Bitfinex API vs dYdX](https://www.anchorterminal.com/compare/bitfinex-vs-dydx.md)
- [Bitfinex API vs OKX API](https://www.anchorterminal.com/compare/bitfinex-vs-okx.md)
- [Bitget vs dYdX](https://www.anchorterminal.com/compare/bitget-vs-dydx.md)
- [Bitget vs OKX API](https://www.anchorterminal.com/compare/bitget-vs-okx.md)
- [Bithumb Open API vs dYdX](https://www.anchorterminal.com/compare/bithumb-vs-dydx.md)
- [Bithumb Open API vs OKX API](https://www.anchorterminal.com/compare/bithumb-vs-okx.md)
- [Bitstamp API vs dYdX](https://www.anchorterminal.com/compare/bitstamp-vs-dydx.md)
- [Bitstamp API vs OKX API](https://www.anchorterminal.com/compare/bitstamp-vs-okx.md)
- [Bybit vs dYdX](https://www.anchorterminal.com/compare/bybit-vs-dydx.md)
- [Bybit vs OKX API](https://www.anchorterminal.com/compare/bybit-vs-okx.md)
- [Crypto.com Exchange API vs dYdX](https://www.anchorterminal.com/compare/crypto-com-exchange-vs-dydx.md)
- [Crypto.com Exchange API vs OKX API](https://www.anchorterminal.com/compare/crypto-com-exchange-vs-okx.md)
- [dYdX vs Uniswap Trading API](https://www.anchorterminal.com/compare/dydx-vs-uniswap.md)
- [dYdX vs Upbit Open API](https://www.anchorterminal.com/compare/dydx-vs-upbit.md)
- [Gate vs OKX API](https://www.anchorterminal.com/compare/gate-io-vs-okx.md)
- [Gemini Exchange API vs OKX API](https://www.anchorterminal.com/compare/gemini-exchange-vs-okx.md)
- [HTX trading API vs OKX API](https://www.anchorterminal.com/compare/htx-vs-okx.md)
- [KuCoin vs OKX API](https://www.anchorterminal.com/compare/kucoin-vs-okx.md)
- [MEXC API vs OKX API](https://www.anchorterminal.com/compare/mexc-vs-okx.md)
- [Binance API vs OKX API](https://www.anchorterminal.com/compare/binance-vs-okx.md)
- [Coinbase Advanced Trade API vs OKX API](https://www.anchorterminal.com/compare/coinbase-advanced-trade-vs-okx.md)
- [Coinbase MCP server (Coinbase for Agents) vs OKX API](https://www.anchorterminal.com/compare/coinbase-mcp-vs-okx.md)
- [Kraken API vs OKX API](https://www.anchorterminal.com/compare/kraken-vs-okx.md)
- [OKX API vs Uniswap Trading API](https://www.anchorterminal.com/compare/okx-vs-uniswap.md)
- [OKX API vs Upbit Open API](https://www.anchorterminal.com/compare/okx-vs-upbit.md)
- [Binance API vs dYdX](https://www.anchorterminal.com/compare/binance-vs-dydx.md)
- [Coinbase Advanced Trade API vs dYdX](https://www.anchorterminal.com/compare/coinbase-advanced-trade-vs-dydx.md)
- [Deribit vs dYdX](https://www.anchorterminal.com/compare/deribit-vs-dydx.md)
- [Deribit vs OKX API](https://www.anchorterminal.com/compare/deribit-vs-okx.md)
- [dYdX vs Gate](https://www.anchorterminal.com/compare/dydx-vs-gate-io.md)
- [dYdX vs Gemini Exchange API](https://www.anchorterminal.com/compare/dydx-vs-gemini-exchange.md)
- [dYdX vs HTX trading API](https://www.anchorterminal.com/compare/dydx-vs-htx.md)
- [dYdX vs Hyperliquid](https://www.anchorterminal.com/compare/dydx-vs-hyperliquid.md)
- [dYdX vs Kraken API](https://www.anchorterminal.com/compare/dydx-vs-kraken.md)
- [dYdX vs KuCoin](https://www.anchorterminal.com/compare/dydx-vs-kucoin.md)
- [dYdX vs MEXC API](https://www.anchorterminal.com/compare/dydx-vs-mexc.md)
- [Hyperliquid vs OKX API](https://www.anchorterminal.com/compare/hyperliquid-vs-okx.md)
- [Coinbase MCP server (Coinbase for Agents) vs dYdX](https://www.anchorterminal.com/compare/coinbase-mcp-vs-dydx.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
