This skill should be used when the user asks about 'account balance', 'how much USDT do I have', 'my funding account', 'show my positions', 'open positions', 'position P&L', 'unrealized PnL', 'closed positions', 'position history', 'realized PnL', 'account bills', 'transaction history', 'trading fees', 'fee tier', 'account config', 'max order size', 'how much can I buy', 'withdrawable amount', 'transfer funds', 'move USDT to trading account', or 'switch position mode'. Requires API credentials. Do NOT use for market prices (use okx-cex-market), placing/cancelling orders (use okx-cex-trade), or grid/DCA bots (use okx-cex-bot).
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
This skill should be used when the user asks about 'account balance', 'how much USDT do I have', 'my funding account', 'show my positions', 'open positions', 'position P&L', 'unrealized PnL', 'closed positions', 'position history', 'realized PnL', 'account bills', 'transaction history', 'trading fees', 'fee tier', 'account config', 'max order size', 'how much can I buy', 'withdrawable amount', 'transfer funds', 'move USDT to trading account', or 'switch position mode'. Requires API credentials. Do NOT use for market prices (use okx-cex-market), placing/cancelling orders (use okx-cex-trade), or grid/DCA bots (use okx-cex-bot).
okx config show # verify configuration status (output is masked)
If the command returns an error or shows no configuration: stop all operations, guide the user to run okx config init, and wait for setup to complete before retrying.
If credentials are configured: proceed to Step B.
Step B โ Confirm profile (required)
--profile is required for all authenticated commands. Never add a profile implicitly.
Value
Mode
Funds
live
ๅฎ็
Real funds
demo
ๆจกๆ็
Simulated funds
Resolution rules:
Current message intent is clear (e.g. "real" / "ๅฎ็" / "live" โ live; "test" / "ๆจกๆ" / "demo" โ demo) โ use it and inform the user: "Using --profile live (ๅฎ็)" or "Using --profile demo (ๆจกๆ็)"
Current message has no explicit declaration โ check conversation context for a previous profile:
Found โ use it, inform user: "Continuing with --profile live (ๅฎ็) from earlier"
Not found โ ask: "Live (ๅฎ็) or Demo (ๆจกๆ็)?" โ wait for answer before proceeding
Handling 401 Authentication Errors
If any command returns a 401 / authentication error:
Stop immediately โ do not retry the same command
Inform the user: "Authentication failed (401). Your API credentials may be invalid or expired."
Guide the user to update credentials by editing the file directly with their local editor:
~/.okx/config.toml
Update the fields api_key, secret_key, passphrase under the relevant profile.
Do NOT paste the new credentials into chat.
After the user confirms the file is updated, run okx config show to verify (output is masked)
Only then retry the original operation
Demo vs Live Mode
Profile is the single control for ๅฎ็/ๆจกๆ็ switching โ exactly two options:
Read commands (balance, positions, bills, etc.): always state which profile was used
Write commands (transfer, set-position-mode): profile must be confirmed before execution (see "Credential & Profile Check" Step B); transfer especially โ wrong profile means wrong account
Every response after a command must append: [profile: live] or [profile: demo]
Do not use the --demo flag โ use --profile instead
Skill Routing
For market data (prices, charts, depth, funding rates) โ use okx-cex-market
For account balance, P&L, positions, fees, transfers โ use okx-cex-portfolio (this skill)
For regular spot/swap/futures/algo orders โ use okx-cex-trade
For grid and DCA trading bots โ use okx-cex-bot
Quickstart
# Trading account balance (all currencies with balance > 0)
okx account balance
# Check USDT balance only
okx account balance USDT
# Funding account balance
okx account asset-balance
# All open positions
okx account positions
# Closed position history with realized PnL
okx account positions-history
# Recent account bills (last 100)
okx account bills
# My trading fee tier
okx account fees --instType SPOT
# Transfer 100 USDT from funding (18) to trading (6)
okx account transfer --ccy USDT --amt 100 --from 18 --to 6