account module

May 12, 2026 · View on GitHub

Account management tools. Requires API key with Read permission (Trade for write operations).

Tools

ToolDescription
account_get_balanceTrading account balance (by currency or all)
account_get_asset_balanceFunding account balance. Use showValuation=true to include total asset valuation across all account types (trading/funding/earn).
account_get_positionsCurrent open positions across all instruments
account_get_positions_historyHistorical position records
account_get_billsAccount bills / ledger (last 7 days)
account_get_bills_archiveBills older than 7 days (up to 3 months)
account_get_fee_ratesTrading fee rates for instrument type
account_get_configAccount configuration (position mode, account level, etc.)
account_set_position_modeSwitch between net mode and long/short mode
account_get_max_sizeMaximum order size for an instrument
account_get_max_withdrawalMaximum withdrawable amount per currency
account_get_leverageGet leverage for an instrument
account_set_leverageSet leverage (general, across instruments)
account_get_audit_logQuery local audit log of tool calls

Example prompts

  • "What is my account balance?"
  • "Show my BTC and ETH balances"
  • "What positions am I currently holding?"
  • "Show my account bills for today"
  • "What are my fee rates for spot trading?"
  • "What is the maximum size I can open on BTC-USDT-SWAP with cross margin?"
  • "Switch to long/short position mode"

CLI

# Balance
okx account balance
okx account balance BTC,ETH
okx account asset-balance
okx account asset-balance --valuation        # include earn/funding/trading valuation summary

# Positions
okx account positions
okx account positions-history

# Bills
okx account bills
okx account bills --archive          # older than 7 days, up to 3 months

# Account info
okx account fees --instType SPOT
okx account config
okx account max-size --instId BTC-USDT-SWAP --tdMode cross
okx account max-withdrawal

# Settings
okx account set-position-mode --posMode net_mode

account 模块

账户管理工具。需要 API Key,读取操作需 读取 权限,写入操作需额外 交易 权限。

工具列表

工具说明
account_get_balance交易账户余额(指定币种或全部)
account_get_asset_balance资金账户余额。传入 showValuation=true 可同时返回交易/资金/理财等各账户类型的总资产估值。
account_get_positions当前所有持仓
account_get_positions_history历史持仓记录
account_get_bills账单流水(7天内)
account_get_bills_archive账单流水(7天前,最多3个月)
account_get_fee_rates交易手续费率
account_get_config账户配置(仓位模式、账户层级等)
account_set_position_mode切换单向/双向持仓模式
account_get_max_size指定合约的最大可开仓量
account_get_max_withdrawal各币种最大可提余额
account_get_leverage查询杠杆设置
account_set_leverage设置杠杆(全局)
account_get_audit_log查询本地工具调用审计日志

示例提示词

  • "查看我的账户余额"
  • "显示我的 BTC 和 ETH 余额"
  • "我当前有哪些持仓?"
  • "显示今日账单流水"
  • "我的现货交易手续费率是多少?"
  • "BTC-USDT-SWAP 全仓模式下最大可开多少张?"
  • "切换到双向持仓模式"

CLI

# 余额
okx account balance
okx account balance BTC,ETH
okx account asset-balance
okx account asset-balance --valuation        # 同时显示理财/资金/交易账户估值汇总

# 持仓
okx account positions
okx account positions-history

# 账单
okx account bills
okx account bills --archive          # 7天前,最多3个月

# 账户信息
okx account fees --instType SPOT
okx account config
okx account max-size --instId BTC-USDT-SWAP --tdMode cross
okx account max-withdrawal

# 设置
okx account set-position-mode --posMode net_mode