OKX MCP Server & API for AI Agents

Data providerAuth: api_key

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.

Chat promptPaste into Claude Code, OpenClaw, OpenCode, Grok Bot, Antigravity, Hermes, or Pi

Read https://duang.ai/SKILL.md and use duang to run crypto.candles.

Data APIs powered by OKX (4)

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.780Z

Operations (381)

OperationPrice
GET www.okx.com/api/v5/market/ticker

The last price of an instrument, with its best bid and ask and the last 24 hours.

Own key
GET www.okx.com/api/v5/market/books

The order book of an instrument: what buyers and sellers offer, by price.

Own key
GET www.okx.com/api/v5/market/candles

The candles of an instrument: open, high, low, close and volume for each bar.

Own key
GET www.okx.com/api/v5/market/trades

The latest trades of an instrument.

Own key
GET www.okx.com/api/v5/public/instruments

What an instrument is, and the rules for trading it.

Own key
GET www.okx.com/api/v5/public/funding-rate

The funding rate of a perpetual swap: what longs pay shorts, or the reverse.

Own key
GET www.okx.com/api/v5/public/open-interest

How many contracts are open on a derivative.

Own key
GET www.okx.com/api/v5/account/account-position-risk

Get account and position risk

Own key
GET www.okx.com/api/v5/account/adjust-leverage-info

Get leverage estimated info

Own key
GET www.okx.com/api/v5/account/balance

Get balance

Own key
GET www.okx.com/api/v5/account/bills

Get bills details (last 7 days)

Own key
GET www.okx.com/api/v5/account/bills-archive

Get bills details (last 3 months)

Own key
GET www.okx.com/api/v5/account/bills-history-archive

Get bills details (since 2021)

Own key
GET www.okx.com/api/v5/account/collateral-assets

Get collateral assets

Own key
GET www.okx.com/api/v5/account/config

Get account configuration

Own key
GET www.okx.com/api/v5/account/greeks

Get Greeks

Own key
GET www.okx.com/api/v5/account/instruments

Get instruments

Own key
GET www.okx.com/api/v5/account/interest-accrued

Get interest accrued data

Own key
GET www.okx.com/api/v5/account/interest-limits

Get borrow interest and limit

Own key
GET www.okx.com/api/v5/account/interest-rate

Get interest rate

Own key
GET www.okx.com/api/v5/account/leverage-info

Get leverage

Own key
GET www.okx.com/api/v5/account/max-avail-size

Get maximum available balance/equity

Own key
GET www.okx.com/api/v5/account/max-loan

Get the maximum loan of instrument

Own key
GET www.okx.com/api/v5/account/max-size

Get maximum order quantity

Own key
GET www.okx.com/api/v5/account/max-withdrawal

Get maximum withdrawals

Own key
GET www.okx.com/api/v5/account/mmp-config

GET MMP Config

Own key
GET www.okx.com/api/v5/account/move-positions-history

Get move positions history

Own key
GET www.okx.com/api/v5/account/position-tiers

Get PM position limitation

Own key
GET www.okx.com/api/v5/account/positions

Get positions

Own key
GET www.okx.com/api/v5/account/positions-history

Get positions history

Own key
GET www.okx.com/api/v5/account/precheck-set-delta-neutral

Precheck set delta neutral

Own key
GET www.okx.com/api/v5/account/risk-state

Get account risk state

Own key
GET www.okx.com/api/v5/account/set-account-switch-precheck

Precheck account mode switch

Own key
GET www.okx.com/api/v5/account/spot-borrow-repay-history

Get borrow/repay history

Own key
GET www.okx.com/api/v5/account/subaccount/balances

Get sub-account trading balance

Own key
GET www.okx.com/api/v5/account/subaccount/max-withdrawal

Get sub-account maximum withdrawals

Own key
GET www.okx.com/api/v5/account/subtypes

Get bill types

Own key
GET www.okx.com/api/v5/account/trade-fee

Get fee rates

Own key
POST www.okx.com/api/v5/account/account-level-switch-preset

Preset account mode switch

Own key
POST www.okx.com/api/v5/account/activate-feature

Activate feature

Own key
POST www.okx.com/api/v5/account/activate-option

Activate option

Own key
POST www.okx.com/api/v5/account/bills-history-archive

Apply bills details (since 2021)

Own key
POST www.okx.com/api/v5/account/demo-adjust-balance

Adjust demo account balance

Own key
POST www.okx.com/api/v5/account/mmp-config

Set MMP

Own key
POST www.okx.com/api/v5/account/mmp-reset

Reset MMP Status

Own key
POST www.okx.com/api/v5/account/position-builder

Position builder (new)

Own key
POST www.okx.com/api/v5/account/position-builder-graph

Position builder trend graph

Own key
POST www.okx.com/api/v5/account/position/margin-balance

Increase/decrease margin

Own key
POST www.okx.com/api/v5/account/set-account-level

Set account mode

Own key
POST www.okx.com/api/v5/account/set-auto-earn

Set auto earn

Own key
POST www.okx.com/api/v5/account/set-auto-loan

Set auto loan

Own key
POST www.okx.com/api/v5/account/set-auto-repay

Set auto repay

Own key
POST www.okx.com/api/v5/account/set-collateral-assets

Set collateral assets

Own key
POST www.okx.com/api/v5/account/set-fee-type

Set fee type

Own key
POST www.okx.com/api/v5/account/set-greeks

Set greeks (PA/BS)

Own key
POST www.okx.com/api/v5/account/set-isolated-mode

Isolated margin trading settings

Own key
POST www.okx.com/api/v5/account/set-leverage

Set leverage

Own key
POST www.okx.com/api/v5/account/set-position-mode

Set position mode

Own key
POST www.okx.com/api/v5/account/set-riskOffset-amt

Set risk offset amount

Own key
POST www.okx.com/api/v5/account/set-settle-currency

Set settle currency

Own key
Showing 60 of 381 operations — type above to search all.

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.

Related data providers