
OKX MCP Server & API for AI Agents
Connect your own OKX account once in Duang's encrypted team vault to expose 381 operations to your AI agents via MCP, CLI, or HTTP with zero exposed credentials.
Read https://duang.ai/SKILL.md and use duang to run crypto.candles.
Data APIs powered by OKX (4)
Get a coin's price history
crypto.candlesCandles (open, high, low, close, volume) of a coin's price.
Get a perpetual's funding rate
crypto.funding.rateThe funding rate of a coin's USDT-margined perpetual swap.
Get a perpetual's open interest
crypto.open.interestHow much of a coin is in the open contracts of its USDT-margined perpetual swap.
Get a coin's price
crypto.priceThe last price of a coin in a currency, such as BTC in USD.
What you can ask your agent
“What is Bitcoin trading at on OKX?”
## BTC-USDT on OKX (Spot) | Metric | Value | |---|---| | **Last price** | **$73,884.20** | | **24h open** | $74,307.70 | | **24h high / low** | $74,843.40 / $72,727.30 | | **Best bid / ask** | $73,887.40 / $73,887.50 | | **24h volume** | $740.91M | Bitcoin is slightly below its 24h open, trading near the middle of the day's range.
ticker · recorded 2026-11-11T10:23:54.824Z“Show me Bitcoin's daily candles on OKX for the last three days.”
Last three daily **BTC-USDT** candles on OKX: | Open | High | Low | Close | Volume (BTC) | |---|---|---|---|---| | $73,205.40 | $74,179.70 | $72,727.30 | $73,884.20 | 5,822.77 | | $75,522.90 | $75,540.10 | $72,858.50 | $73,205.40 | 7,705.04 | | $76,074.80 | $76,100.00 | $73,500.00 | $75,524.40 | 9,854.15 |
candles · recorded 2026-11-11T10:23:55.780ZOperations (381)
| Operation | Data API | Price |
|---|---|---|
GET www.okx.com/api/v5/market/tickerThe last price of an instrument, with its best bid and ask and the last 24 hours. | crypto.price | Own key |
GET www.okx.com/api/v5/market/booksThe order book of an instrument: what buyers and sellers offer, by price. | — | Own key |
GET www.okx.com/api/v5/market/candlesThe candles of an instrument: open, high, low, close and volume for each bar. | crypto.candles | Own key |
GET www.okx.com/api/v5/market/tradesThe latest trades of an instrument. | — | Own key |
GET www.okx.com/api/v5/public/instrumentsWhat an instrument is, and the rules for trading it. | — | Own key |
GET www.okx.com/api/v5/public/funding-rateThe funding rate of a perpetual swap: what longs pay shorts, or the reverse. | crypto.funding.rate | Own key |
GET www.okx.com/api/v5/public/open-interestHow many contracts are open on a derivative. | crypto.open.interest | Own key |
GET www.okx.com/api/v5/account/account-position-riskGet account and position risk | — | Own key |
GET www.okx.com/api/v5/account/adjust-leverage-infoGet leverage estimated info | — | Own key |
GET www.okx.com/api/v5/account/balanceGet balance | — | Own key |
GET www.okx.com/api/v5/account/billsGet bills details (last 7 days) | — | Own key |
GET www.okx.com/api/v5/account/bills-archiveGet bills details (last 3 months) | — | Own key |
GET www.okx.com/api/v5/account/bills-history-archiveGet bills details (since 2021) | — | Own key |
GET www.okx.com/api/v5/account/collateral-assetsGet collateral assets | — | Own key |
GET www.okx.com/api/v5/account/configGet account configuration | — | Own key |
GET www.okx.com/api/v5/account/greeksGet Greeks | — | Own key |
GET www.okx.com/api/v5/account/instrumentsGet instruments | — | Own key |
GET www.okx.com/api/v5/account/interest-accruedGet interest accrued data | — | Own key |
GET www.okx.com/api/v5/account/interest-limitsGet borrow interest and limit | — | Own key |
GET www.okx.com/api/v5/account/interest-rateGet interest rate | — | Own key |
GET www.okx.com/api/v5/account/leverage-infoGet leverage | — | Own key |
GET www.okx.com/api/v5/account/max-avail-sizeGet maximum available balance/equity | — | Own key |
GET www.okx.com/api/v5/account/max-loanGet the maximum loan of instrument | — | Own key |
GET www.okx.com/api/v5/account/max-sizeGet maximum order quantity | — | Own key |
GET www.okx.com/api/v5/account/max-withdrawalGet maximum withdrawals | — | Own key |
GET www.okx.com/api/v5/account/mmp-configGET MMP Config | — | Own key |
GET www.okx.com/api/v5/account/move-positions-historyGet move positions history | — | Own key |
GET www.okx.com/api/v5/account/position-tiersGet PM position limitation | — | Own key |
GET www.okx.com/api/v5/account/positionsGet positions | — | Own key |
GET www.okx.com/api/v5/account/positions-historyGet positions history | — | Own key |
GET www.okx.com/api/v5/account/precheck-set-delta-neutralPrecheck set delta neutral | — | Own key |
GET www.okx.com/api/v5/account/risk-stateGet account risk state | — | Own key |
GET www.okx.com/api/v5/account/set-account-switch-precheckPrecheck account mode switch | — | Own key |
GET www.okx.com/api/v5/account/spot-borrow-repay-historyGet borrow/repay history | — | Own key |
GET www.okx.com/api/v5/account/subaccount/balancesGet sub-account trading balance | — | Own key |
GET www.okx.com/api/v5/account/subaccount/max-withdrawalGet sub-account maximum withdrawals | — | Own key |
GET www.okx.com/api/v5/account/subtypesGet bill types | — | Own key |
GET www.okx.com/api/v5/account/trade-feeGet fee rates | — | Own key |
POST www.okx.com/api/v5/account/account-level-switch-presetPreset account mode switch | — | Own key |
POST www.okx.com/api/v5/account/activate-featureActivate feature | — | Own key |
POST www.okx.com/api/v5/account/activate-optionActivate option | — | Own key |
POST www.okx.com/api/v5/account/bills-history-archiveApply bills details (since 2021) | — | Own key |
POST www.okx.com/api/v5/account/demo-adjust-balanceAdjust demo account balance | — | Own key |
POST www.okx.com/api/v5/account/mmp-configSet MMP | — | Own key |
POST www.okx.com/api/v5/account/mmp-resetReset MMP Status | — | Own key |
POST www.okx.com/api/v5/account/position-builderPosition builder (new) | — | Own key |
POST www.okx.com/api/v5/account/position-builder-graphPosition builder trend graph | — | Own key |
POST www.okx.com/api/v5/account/position/margin-balanceIncrease/decrease margin | — | Own key |
POST www.okx.com/api/v5/account/set-account-levelSet account mode | — | Own key |
POST www.okx.com/api/v5/account/set-auto-earnSet auto earn | — | Own key |
POST www.okx.com/api/v5/account/set-auto-loanSet auto loan | — | Own key |
POST www.okx.com/api/v5/account/set-auto-repaySet auto repay | — | Own key |
POST www.okx.com/api/v5/account/set-collateral-assetsSet collateral assets | — | Own key |
POST www.okx.com/api/v5/account/set-fee-typeSet fee type | — | Own key |
POST www.okx.com/api/v5/account/set-greeksSet greeks (PA/BS) | — | Own key |
POST www.okx.com/api/v5/account/set-isolated-modeIsolated margin trading settings | — | Own key |
POST www.okx.com/api/v5/account/set-leverageSet leverage | — | Own key |
POST www.okx.com/api/v5/account/set-position-modeSet position mode | — | Own key |
POST www.okx.com/api/v5/account/set-riskOffset-amtSet risk offset amount | — | Own key |
POST www.okx.com/api/v5/account/set-settle-currencySet settle currency | — | Own key |
Frequently asked questions
Do I need my own OKX subscription or API key?
Yes. Connect your existing OKX API key in Duang's team vault so your agents can call all 381 operations without seeing the raw key.
How do I add OKX to Claude Code or Cursor via MCP?
Add Duang's single remote MCP endpoint (https://api.duang.ai/mcp) or follow https://duang.ai/SKILL.md. Your agent discovers and invokes OKX operations on demand without loading hundreds of unused schemas into context.
Am I charged if a OKX API call fails?
No. Upstream supplier failures and Duang platform errors cost $0 on managed calls. Every successful call returns a receipt listing the exact supplier and USD amount charged.





