6DuckLearn Skills

rookie ignition

Beginner's Manual Vol.0 Ignition | Assists complete newcomers who have never used the OKX Agent Trade Kit, guiding them through the entire process of creating an API Key, configuring permissions, switching between virtual and real accounts, and performing connection self-checks in an interactive AI manner. It activates when users say "ignition", "API configuration", "help me check the connection", "ignition", "check connection", "beginner's manual", or "how to connect to okx". It does not place orders, does not involve strategies, and is purely focused on configuration guidance and connection diagnostics.

finance Tags: okx, trading, community, okx-marketplace, finance, execution, trend

6DuckLearn provenance: Community skill by 地雷先生, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/rookie-ignition). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.

Financial safety boundary: Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

🔥 小白上场手册 Vol.0 · 点火器

一句话定位:让你的 AI 第一次和 OKX 账户握手,保证所有 Skill 都能正确启动。


这本小册子解决什么

你可能遇到过这些问题:

  • 装了 Claude / Cursor 想接 OKX,但 API Key 填哪儿、怎么填不知道
  • 配置完报 401(Key 环境不匹配)502(代理连不上)50011(请求超限),不知道怎么办
  • 搞不清虚拟盘实盘有什么区别、比赛该用哪个
  • 担心 API Key 配错了被盗,但又不知道怎么才算"配对了"

这本小册子的任务:

  1. 教你正确创建 API Key 并配置权限
  2. 教 AI 做连接自检三连,告诉你当前配置是否健康
  3. 遇到报错,AI 能根据错误码告诉你具体怎么解

本 Skill 不下单、不交易,只做配置指导和连接诊断。


📖 知识地图(先扫 5 个点)

点 1 · Agent Trade Kit 是什么

OKX 官方开源的工具包,让你的 AI(Claude / Cursor 等)通过本地程序连接 OKX 账户

  • 全部本地运行,API Key 只存在你电脑的 ~/.okx/config.toml(Windows 是 C:\Users\<你的用户名>\.okx\config.toml)
  • AI 永远看不到你的 Key,它只能通过工具包"间接操作"
  • 开源协议 MIT,源码可审计:github.com/okx/agent-trade-kit

点 2 · 三条 API Key 权限铁律

创建 Key 时只勾两个,一个绝不能勾:

权限 勾不勾 原因
Read(读取) ✅ 必勾 要查余额和 K 线
Trade(交易) ✅ 必勾 要下单和挂止损
Withdraw(提现) 绝不勾 勾了等于给黑客提款通道

这条规则一辈子不会变,请刻在脑子里。

点 3 · 虚拟盘 vs 实盘(四大区别)

特征 虚拟盘 Demo 实盘 Live
资金 模拟币,输光不心疼 真钱,亏了就是亏了
入口 OKX → 交易 → 模拟交易 → 个人中心 OKX → 头像 → API
Agent 启动参数 --profile demo--demo --profile live
比赛是否计分 ❌ 不计入 只有实盘计入

⚠️ 核心规则:虚拟盘 Key 只能连虚拟盘,实盘 Key 只能连实盘,两者永远不能混用。 混用就会出现 401 Key 环境不匹配 错误。

点 4 · 为什么必须用子账户

主账户是你整个身家所在,子账户是从主账户派生的独立账户,权限、资金隔离。

用子账户给 AI 用的三个理由:

  • 子账户余额有限,AI 就算翻车也只动子账户这点钱
  • 子账户独立 API Key,万一泄露不影响主账户
  • OKX 大赛规则允许用子账户参赛,报名时选子账户即可

点 5 · 连接验证"三条自检命令"

AI 可以用下面三条命令帮你验证连接状态:

okx account balance             # 验证:账户能连上吗?
okx account positions           # 验证:有交易权限吗?
okx market ticker BTC-USDT-SWAP # 验证:能拉行情数据吗?

本 Skill 的核心就是让 AI 帮你跑这三条,并根据结果给你诊断报告。


🤖 AI 互动环节:我陪你走一遍配置

AI 触发本 Skill 时,请按以下对话流程与用户交互:

互动 1 · 起点诊断

AI 开场第一句:

"欢迎,我是你的点火助手 🔥。在帮你检查连接之前,我需要先问你 4 个问题,了解你现在走到哪一步。每个问题回答 A/B/C 即可。"

问题 A:你装 Node.js 了吗?

  • A. 装了(继续下一问)
  • B. 没装(AI 给出安装链接 https://nodejs.org,并建议安装 LTS 版本)
  • C. 不知道(AI 指导用户打开终端输入 node -v,看输出是不是 v18 或更高)

问题 B:你装 okx-trade-cli / okx-trade-mcp 了吗?

  • A. 装了
  • B. 没装(AI 输出安装命令:npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli)
  • C. 不确定(AI 指导输入 okx --version 验证)

问题 C:你现在想先用虚拟盘测试,还是直接上实盘?

  • A. 虚拟盘(AI 跳转到"虚拟盘 API 创建流程")
  • B. 实盘(AI 跳转到"实盘 API 创建流程")
  • C. 我要参加 OKX AI 大赛(AI 明确告知:比赛只计实盘成绩,但强烈建议先用虚拟盘跑 24 小时验证,再切实盘)

问题 D:你有 OKX 子账户吗?

  • A. 有
  • B. 没有(AI 引导用户去 OKX → 资产 → 子账户 → 创建,并解释子账户的三个安全好处)
  • C. 不知道什么是子账户(AI 用知识地图点 4 的内容解释)

互动 2 · API Key 创建指引(AI 根据问题 C 的回答走对应分支)

分支 1:虚拟盘 API Key

AI 告诉用户:

"请按以下步骤操作,我不会帮你代操作,你自己完成:

  1. 登录 OKX,顶部菜单点 交易 → 模拟交易
  2. 进入模拟交易界面后,点右上角 个人中心 → API 管理
  3. 创建 API Key
  4. 权限勾选:✅ Read ✅ Trade ❌ Withdraw(千万别勾这个)
  5. 设置 Passphrase(自己记住,后面要填)
  6. 创建成功后会显示 API Key / Secret Key / Passphrase 三个值

⚠️ 注意:Secret Key 只显示一次,请立刻复制到安全的地方(不要贴聊天窗口、不要截图发微信)。

完成后告诉我,我引导你下一步。"

分支 2:实盘 API Key

AI 告诉用户:

"请按以下步骤操作:

  1. 登录 OKX,点右上角 头像 → API
  2. 强烈建议:切换到子账户(如果你有),不要用主账户创建
  3. 创建 V5 API Key
  4. 权限勾选:✅ Read ✅ Trade ❌ Withdraw
  5. 是否绑定 IP:
    • 绑定:更安全,但只能在这个 IP 使用
    • 不绑定:任何 IP 可用,但 14 天不调用会自动失效(做 AI 交易基本每天都在调,一般不会失效)
  6. 设置 Passphrase 并保存三个值

⚠️ 同样,Secret Key 只显示一次,立刻保存好。"

互动 3 · 配置 config.toml

AI 指导用户执行:

okx config init

并解释交互向导里每一步:

  • Profile 名字:建议命名为 demo(虚拟盘用)或 live(实盘用)。可以同时配两套。
  • API Key / Secret Key / Passphrase:就是刚才 OKX 给你的三个值
  • Environment:选 demo 或 live,要和你的 API Key 匹配

AI 在引导中反复强调:

"⚠️ 这三个值只进这个交互式向导,千万别在我这里的聊天窗口贴出来。我永远不需要看到你的 API Key,我只需要你告诉我'我填完了'。"

互动 4 · 启动 MCP 连接

AI 告诉用户启动命令:

虚拟盘启动:

okx-trade-mcp --profile demo --modules market,swap,account

实盘启动:

okx-trade-mcp --profile live --modules market,swap,account

解释 --modules 参数:

  • market:行情数据(无需 API Key 也能用)
  • swap:永续合约下单(比赛核心模块)
  • account:账户余额和持仓查询
  • 不启用 spot / futures / option / bot,降低小白误触风险

互动 5 · 连接自检三连(本 Skill 的核心动作)

AI 此时主动执行以下三条命令,并实时反馈每一步结果:

# 自检 1:账户连接
okx account balance

AI 诊断反馈模板:

  • 若返回余额数据 → "✅ 账户连接成功。你当前账户余额:[具体数字] USDT"
  • 若返回 401 错误 → "❌ Key 环境不匹配。你的 Key 是 [demo/live] 环境创建的,但启动命令用的是 [live/demo]。请重新 okx config init 配对环境,或者换一个匹配的 Key。"
  • 若返回 502/超时 → "❌ 网络层连不上。如果你在使用代理,换一个节点;或者检查 OKX 是否在你所在地区开放。"
# 自检 2:持仓查询权限
okx account positions

AI 诊断反馈模板:

  • 若返回(空列表或持仓数据)→ "✅ Trade 权限正常。"
  • 若返回 50011(速率限制)→ "⚠️ 请求太快,等 30 秒再试。"
  • 若返回权限错误 → "❌ API Key 缺少 Trade 权限,请回 OKX 重新创建 Key 并勾选 Read + Trade。"
# 自检 3:行情数据
okx market ticker BTC-USDT-SWAP

AI 诊断反馈模板:

  • 若返回价格数据 → "✅ 行情数据正常,BTC 现价 $[数字]"
  • 若失败 → "❌ 连 market 模块都连不上,这是底层网络问题。先检查你能不能在浏览器打开 okx.com"

互动 6 · 诊断总报告

三条命令跑完后,AI 输出一份格式化的连接健康报告:

═══════════════════════════════════
      🔥 点火器 · 连接诊断报告
═══════════════════════════════════

🔌 账户连接      [✅ 通过 / ❌ 失败]
🔑 Trade 权限    [✅ 通过 / ❌ 失败]
📊 行情数据      [✅ 通过 / ❌ 失败]
🌐 运行环境      [虚拟盘 demo / 实盘 live]
💰 账户余额      [X USDT]
📐 持仓模式      [net_mode 单向 / long_short_mode 双向]
⚙️  保证金模式    [cross 全仓 / isolated 逐仓]

综合判断:
[✅ 所有检查通过,你已具备跑任何交易 Skill 的基础条件]
      或
[⚠️ X 项有问题,请按上方报错提示修复后重试]

═══════════════════════════════════

⚠️ AI 会踩的坑(必读)

坑 1:AI 不应询问、接收、存储用户的 API Key 原始值 用户的 API Key / Secret Key / Passphrase 只能写进 ~/.okx/config.toml,绝不能进聊天对话。

  • 如果用户粘贴了疑似 API Key 的字符串,AI 必须立即警告:"🚨 你刚才贴了疑似密钥的信息。请立刻回 OKX 重置这个 Key(贴过聊天窗口的密钥不能再用),然后重新配置。"
  • 本 Skill 中涉及 Key 的所有步骤,AI 只能说"请你去 xx 填 xx",不能主动替用户做

坑 2:AI 不应混淆 401 错误的两种成因 401 Unauthorized 可能有两种原因:

  • Key 环境不匹配(demo Key 连了 live 域名,或反之)
  • Key 权限不足(没勾 Trade 权限)

AI 看到 401 必须让用户先核对启动命令的 --profile 是否和 Key 环境一致,再去怀疑权限问题。

坑 3:AI 不应代替用户操作 OKX 后台 创建 API Key、改权限、开子账户、切换持仓模式——这些都必须用户自己去 OKX 界面操作。 AI 可以给详细路径和步骤,但不能说"我帮你创建"。

坑 4:AI 要主动核对合约面值 不同账户、不同地区、不同合约,合约面值(ctVal)可能不同。AI 在讲"1 张 = 多少 BTC"之前,应该跑一条 okx market instruments --instType SWAP --instId BTC-USDT-SWAPctVal 字段的实际值,不要凭记忆说。

坑 5:AI 不应把虚拟盘结果当作实盘承诺 虚拟盘的滑点、流动性、资金费率和实盘有差异。用户在 demo 跑得好,AI 不应说"那你上实盘也这个成绩",必须提醒实盘有差异。


✅ 毕业测验

AI 问用户这 3 题,3 题全过才推荐进 Vol.1:

题 1:"你的 API Key 现在配的是虚拟盘还是实盘?启动命令的 --profile 对得上吗?"

  • 答对:用户能清楚说出"Key 是 demo,启动用 --profile demo"

题 2:"你 API Key 的 Withdraw 权限勾了吗?"

  • 答对:必须是"没勾"

题 3:"连接自检三连,哪一条验证了你有 Trade 权限?"

  • 答对:okx account positions(因为 positions 是 Trade 权限才能读的)

毕业奖章 🏅

三题通过后,AI 输出:

🏅 恭喜你!你已经拿到了「小白上场手册」第 1 枚奖章:点火器 🔥

你现在的能力:
  ✅ 能正确创建和配置 API Key
  ✅ 能区分虚拟盘和实盘
  ✅ 遇到连接报错知道怎么排查

70% 的小白在这一步就卡住了,你已经赢了他们一个身位。

下一步推荐:
  👉 Vol.1 · 安全气囊  — 在你让 AI 动钱之前,先学会保护自己
  触发词:"安全气囊" / "密钥保护" / "airbag"

📎 引用其他 Skill

  • 完成本 Skill 后,建议连续装 Vol.1 · 安全气囊Vol.2 · 读仪表盘
  • 三本都过完后,可以尝试装 resilience-trader(韧性交易者)跑第一笔真实交易
  • 跑过几笔后,装 trade-mirror(交易镜子)做复盘

小白上场手册 · Vol.0 · 点火器 | 适用平台:OKX Agent Trade Kit 本 Skill 不下单,只负责连接配置与诊断。MIT 开源,欢迎 fork。

Related skills

  • alpha vantage — Cross-asset analysis is its unique advantage—it can simultaneously pull macro data such as the S&P 500, gold, the dollar index, Federal Reserve interest rates, CPI, GDP, etc., allowing one to see at a glance whether "BTC is moving with risk assets today or pricing independently." In conjunction with the OKX Trade Kit, Alpha Vantage is responsible for in-depth historical and macroeconomic context, while OKX provides real-time prices, funding rates, and order book data, with both complementing each other to form a complete analysis chain.
  • apex crypto intelligence — AI-driven multi-exchange cryptocurrency market analysis, arbitrage detection, and hedge fund-level trading reports using real-time data from major exchanges.
  • btc altcoin market pulse — Fetches live OKX market data across Bitcoin and major altcoins, analyzes price momentum, funding rates, open interest, and BTC dominance signals to produce a structured BTC + Altcoin Market Pulse report.
  • cmc okx — CoinMarketCap × OKX dual engine, a one-stop solution for all your cryptocurrency market data needs. CMC provides market cap, supply, dominance, holding distribution, project background, and macro event calendar; the OKX Trade Kit complements with real-time prices, funding rates, open interest, 70+ technical indicators, and order book depth, with both automatically linked and mutually supportive. It supports natural language triggers, whether you ask "What’s the price of Bitcoin?", "How to read the ETH daily chart?" or "Which coin is surging?", Skill automatically recognizes intent, selects tool combinations, outputs structured tables, and includes a "Quick Take" one-sentence summary.
  • congress trades — Track U.S. Congress members' stock trades in real-time, making "smart political money" impossible to hide. Sync member trade disclosure data to a local SQLite database via the Quiver Quant API, allowing flexible queries by politician name, stock code, party, date range, and trade type. Large trades exceeding the configurable amount threshold (default $15,001) automatically trigger alerts, generating structured Alert files for real-time monitoring.
  • crypto research — A systematic cryptocurrency due diligence report, covering everything from price to holding distribution, from technical aspects to a red flag checklist, all in one go. Integrating the OKX Trade Kit (real-time prices, 70+ technical indicators, funding rates, open interest, order book depth) with CoinMarketCap (market cap, token economics, whale distribution, news sentiment), a seven-step research process is executed in parallel, covering market snapshots, technical analysis, derivatives data, project fundamentals, and recent news. The analysis framework specifically distinguishes between legitimate projects and Meme coins, evaluating key signals such as whale concentration, holder trends, 200-day moving average positions, and funding rate extremes, ultimately outputting a green flag/red flag checklist and low/medium/high/very high risk ratings.