Okx
liveCryptoMarketsOKX v5 public API — tickers, orderbooks, OHLC candles, funding rates, mark prices, and index data for crypto spot/futures/options.
Tools
instrumentsOKX crypto exchange — list instruments by type: 'SPOT', 'MARGIN', 'SWAP', 'FUTURES', or 'OPTION'. Returns instrument IDs, tick sizes, lot sizes, and trading rules for each.
No parameters required.
Try it
okx_tickerOKX crypto exchange — single instrument ticker (e.g. "BTC-USDT", "BTC-USD-SWAP"). Returns bid/ask, last, 24h vol/change. Use for current pricing of an OKX-listed instrument.
No parameters required.
Try it
okx_tickersOKX crypto exchange — bulk tickers by instrument type ("SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"). Use to enumerate all spot or all perp instruments. NOT a general stock-ticker search — use polygo
No parameters required.
Try it
okx_order_bookOKX crypto exchange order book (bids + asks) for a spot/perp/futures instrument. Use for live depth-of-book on OKX-listed instruments.
No parameters required.
Try it
okx_candlesOKX crypto exchange OHLC candles for a spot/perp/futures instrument. Bars 1m through 1M. Use for charting and backtesting OKX instruments.
No parameters required.
Try it
okx_tradesOKX crypto exchange recent trade tape for an instrument. Returns price, size, side, timestamp. Use for tick-level execution analysis on OKX.
No parameters required.
Try it
market_24hrOKX crypto exchange 24-hour rolling stats for an instrument: open, high, low, last, volume, vol-ccy. Use for daily summary on OKX.
No parameters required.
Try it
index_tickersOKX crypto exchange index tickers — current index price and 24h change for OKX index instruments. Filter by quote currency (e.g. 'USD') or specific instId.
No parameters required.
Try it
funding_rateOKX crypto exchange current perpetual swap funding rate for a SWAP instrument (e.g. 'BTC-USDT-SWAP'): funding rate, next settlement time, and method.
No parameters required.
Try it
funding_rate_historyOKX crypto exchange historical perpetual swap funding rates for a SWAP instrument (e.g. 'BTC-USDT-SWAP'). Optional before/after (ms epoch) cursors and limit. Use for funding cost analysis.
No parameters required.
Try it
mark_priceOKX crypto exchange mark price for derivatives: pass instType (e.g. 'SWAP') and optionally uly or instId. Returns the mark price used for unrealised P&L and liquidation calculations.
No parameters required.
Try it
okx_timeOKX exchange server time in Unix milliseconds. Use to synchronise request timestamps or verify API connectivity.
No parameters required.
Try it
okx_statusOKX exchange system status — current operational state and any scheduled or ongoing maintenance windows affecting trading.
No parameters required.
Try it
perp_metricsCrypto perpetual futures snapshot in one call: funding rate, open interest, taker buy/sell volume (CVD) and long/short account ratio for a perpetual swap. Accepts exchange-style symbols such as 'MASKU
No parameters required.
Try it
open_interestOpen interest for a crypto perpetual swap or dated futures contract on the OKX venue — contracts outstanding, coin-denominated size and USD notional, with timestamp. Accepts 'MASKUSDT', 'MASK' or 'MAS
No parameters required.
Try it
taker_volumeTaker buy versus taker sell volume for a crypto perpetual contract on the OKX venue, bucketed by period. Returns the per-bucket series, the buy/sell ratio and cumulative volume delta (CVD) across the
No parameters required.
Try it
long_short_ratioLong/short account ratio for a crypto perpetual contract on the OKX venue — the ratio of accounts holding longs to accounts holding shorts, bucketed by period. A value above 1 means more accounts sit
No parameters required.
Try it
Test with curl
The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.
curl -X POST https://gateway.pipeworx.io/okx/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'curl -X POST https://gateway.pipeworx.io/okx/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"instruments","arguments":{}}}'Use with the SDK
Install @pipeworx/sdk to call tools from any TypeScript/Node project.
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("instruments", {});// Or ask in plain English:
const answer = await px.ask("okx v5 public api — tickers, orderbooks, ohlc candles, funding rates, mark prices, and index data for crypto spot/futures/options");