Sora2 数据查询与视频生成工具,通过 MaxHub API 接入 OpenAI Sora2(sora.chatgpt.com)平台,覆盖作品详情、评论回复、Remix 衍生、视频下载、用户资料、社交关系、Cameo 出镜、首页推荐、用户搜索及视频生成任务等全部能力。专注服务于 Sora2 内容创作者、AI 视频研究者、社媒分析师与自动化工作流场景,帮助用户快速采集 Sora2 数据、提取爆款规律、批量生成 AI 视频内容。
> 架构亮点:本 Skill 采用三层结构 — Atomic 原子层(端点的标准化封装)+ Recipe 编排层(多步业务场景脚本)+ Reference 详情层(端点 5 区契约)。Agent 可按"目标 → recipes 匹配 → atoms 映射 → reference 详情"四步路径精准调用,杜绝臆造。
> ### 📋 数据传输与隐私声明(请认真阅读)
>
> 1. 第三方传输:您提供的所有 ID、关键词、链接、cookie 等参数都会通过 HTTPS 发送到 https://www.aconfig.cn(MaxHub 数据服务)进行处理。
> 2. UGC 隐私:拉回的评论 / 弹幕 / 动态 / 私信 / 联系人等内容可能包含个人信息或敏感 UGC,请勿写入未授权的数据库或公开发布。
> 3. 凭证保护:建议使用独立测试账号、定期轮换 API Key;禁止传入主力生产账号的 cookie 或 session 凭证。
> 4. 合规责任:使用方需自行确保符合所在地区的数据保护法律(《个人信息保护法》/ GDPR / 平台 ToS 等),平台账号的合规性由使用方承担。
请前往 MaxHub 控制台 注册账号并获取 API Key。
方案 1:OpenClaw 配置
将 MAXHUB_API_KEY 添加到 ~/.openclaw/openclaw.json 中:
{ "env": { "MAXHUB_API_KEY": "ak_xxxx..." } }
方案 2:终端环境变量
export MAXHUB_API_KEY="ak_xxxx..."
本 Skill 不需要额外脚本依赖,所有调用通过 curl 完成 HTTP 请求即可,无第三方库依赖。
| 环境变量 | 说明 | 是否必填 | 获取方式 |
|---|---|---|---|
| --- | --- | --- | --- |
MAXHUB_API_KEY | MaxHub 数据 API Key | 是 | MaxHub 控制台 |
> 此小节定义 agent 在每次接到用户请求时的标准决策流程。严格按此顺序执行可大幅提升命中率与减少误调用。
| 步骤 | 何时读 | 加载文件 | 估算 token |
|---|---|---|---|
| ------ | ------- | --------- | ----------- |
| ① 永远先读 | 接到任何请求时 | SKILL.md §0.1(不支持清单)+ §4(本节) | ~1K |
| ② 选择 recipe | 用户语义清晰时 | references/recipes/_index.md(仅索引) | ~1.5K |
| ③ 加载 recipe 详情 | 匹配到具体 recipe 时 | references/recipes/ 的对应段落 | ~500/段 |
| ④ 加载端点详情 | 自定义链路或参数不明时 | references/ 单文件 | ~3K |
| ⑤ 路径白名单校验 | 调用前 | grep '(禁止整体读) | ~50 行 |
| ⑥ 跨端点字段路由 | 链式调用时 | references/param-mappings.md § 字段流字典 | ~1K |
references/recipes/_index.md,扫 trigger_keywords 列references/atoms/_index.md,按 chain_role 列定位起点(starter)和终点(terminal)⭐⭐⭐ 首选 标记的端点;不到必要不用 ⭐ 条件 端点param-mappings.md § 字段流字典 决定,禁止自行猜 json_path| 端点 risk | 必做自检 | 步骤数 |
|---|---|---|
| ---------- | --------- | ------- |
risk: low | ① 路径在 endpoints_whitelist.yaml | 1 步 |
risk: medium | ① 路径 ② method ③ 必填参数 ④ 写入确认 | 4 步 |
risk: high | 4 步 + 显式向用户确认参数与意图 | 5 步 |
risk: critical(restricted) | 6 步高风险确认流程(详见 §高风险能力清单) | 6 步 |
> 旧 SKILL 强制所有调用都做 4 步——现按 risk 等级简化。low 端点(占绝大多数)只校验路径即可。
| 现象 | 行动 | 重试 |
|---|---|---|
| ------ | ------ | ------ |
| 404 / 410 | §3.1(A) 5 步防臆造自检 → 通过才 STOP;禁止自改路径段重试 | 0 |
| 400 / 422 | §3.1(B) 6 步防参数臆造自检 → 通过才修参重试 | ≤1 |
| 401 / 402 / 403 | STOP,告知用户去 https://www.aconfig.cn 处理 | 0 |
| 429 | 读 Retry-After 退避;无该头时指数退避+jitter | ≤2 |
| 5xx | 等 3 秒重试 → 仍失败走端点级"降级/替换" | 1 |
HTTP 200 + code != 0 | 读 message_zh 报告用户;不重试(业务错误重试无用) | 0 |
https://www.aconfig.cn 三方接口| 规则 | 说明 |
|---|---|
| ------ | ------ |
| 🔒 只读优先 | 默认仅用于数据查询;create_video / upload_image 为写入接口,须用户明确确认参数后调用 |
| 🚫 禁止臆造路径 | 仅使用 references/endpoints_whitelist.yaml 中的端点,不得自行拼接、改版本号、加路径段 |
| 🧭 优先走编排 | 优先尝试匹配 recipes/_index.md 中的预编排脚本;命中即按 Atomic Steps 顺序调用,避免临场拼凑 |
| 📋 数据流向第三方 | 所有请求发送至 https://www.aconfig.cn,请使用独立测试账号并定期轮换 API Key |
| 🔑 凭证保护 | 不暴露 API Key、Cookie、Token 至日志或对话 |
> Agent 接到用户请求后,优先按"先编排、后原子、再详情"的顺序进入文档,避免一上来就读全部 reference。
用户输入
↓
① 读 recipes/_index.md(轻量索引,~100 行)
↓ 匹配 trigger_keywords(命中 → 走 Recipe;未命中 → 步骤 ②)
↓
② 读 atoms/_index.md(原子映射表,~30 行核心)
↓ 按业务别名找 atom_id → endpoint_id → reference 文件
↓
③ 仅在需要 5 区契约(IN/OUT/ERR)时,读对应 reference 文件
↓
④ 调用前比对 endpoints_whitelist.yaml 完成 4 步 Pre-call 自检
Step 1 — 检查 API Key
[ -n "${MAXHUB_API_KEY:-}" ] && echo "ok" || echo "missing"
若返回 missing,停止并提示用户配置 MAXHUB_API_KEY。
Step 2 — 优先匹配 Recipe(编排层)
读 references/recipes/_index.md,按用户目标匹配 trigger_keywords:
| Recipe 文件 | 覆盖场景 | 典型触发词 |
|---|---|---|
| ----------- | --------- | ---------- |
recipes/post.md | 作品全维度分析、评论回复链、Remix 传播图谱、视频下载 | 帖子分析、评论、回复、二创、下载 |
recipes/user.md | 用户画像、作品列表、社交关系、Cameo 出镜分析 | 用户分析、粉丝、关注、Cameo |
recipes/tools.md | AI 视频生成(文生/图生)、任务轮询、Cameo 热榜 | 生成视频、文生视频、图生视频、热榜 |
命中 Recipe → 直接按其 Atomic Steps 顺序执行,跳到 Step 5。
Step 3 — Recipe 未命中:进入原子层
读 references/atoms/_index.md,按业务别名(atom_id)找到对应 endpoint_id:
| 业务别名 | atom_id | 端点 | 用途 |
|---|---|---|---|
| --------- | --------- | ----- | ------ |
| 查作品 | get_post | get_post_detail | 作品详情 |
| 查评论 | list_comments | get_post_comments | 一级评论 |
| 查回复 | list_replies | get_comment_replies | 二级回复 |
| 查 Remix | list_remix | get_post_remix_list | 二创列表 |
| 查下载 | get_download | get_video_download_info | 无水印 URL |
| 查 Feed | get_feed | get_feed | 推荐流 |
| 搜用户 | search_users | search_users | 用户名搜索 |
| 查用户主页 | get_profile | get_user_profile | 用户资料 |
| 查用户作品 | list_user_posts | get_user_posts | 用户作品 |
| 查关注 | list_following | get_user_following | 关注列表 |
| 查粉丝 | list_followers | get_user_followers | 粉丝列表 |
| 查 Cameo 出镜 | list_cameo | get_user_cameo_appearances | 出镜记录 |
| 上传图片 ⚠️ | upload_image | upload_image | 写入:图片上传 |
| 创建视频 ⚠️ | create_video | create_video | 写入:AI 视频生成 |
| 查任务状态 | get_task_status | get_task_status | 异步任务进度 |
| 查任务详情 | get_task_detail | get_task_detail | 最终视频 URL |
| 查 Cameo 热榜 | get_cameo_board | get_cameo_leaderboard | 全平台热榜 |
Step 4 — 仅按需读 reference 详情层
按 atom 表中 file 字段找对应详情:
| Reference 文件 | 覆盖端点数 | 5 区结构 |
|---|---|---|
| -------------- | ----------- | --------- |
references/post.md | 6 | 用途 / USE 边界 / IN(参数表)/ OUT(链式字段)/ ERR(错误处理) |
references/user.md | 6 | 同上 |
references/tools.md | 5 | 同上(含写入端点的 requires_user_confirmation 标记) |
references/param-mappings.md | — | 中枢索引(全局红线 + 字段流字典 + 错误处理 + 替换矩阵) |
references/endpoints_whitelist.yaml | 17 | 路径硬白名单 + Pre-call 4 步自检协议 |
references/update.md | — | SkillHub / ClawHub / GitHub 三通道更新 |
Step 5 — 执行并验证
endpoints_whitelist.yaml 完成 4 步 Pre-call 自检(路径 → method → 必填 → 写入确认)message_zh 报告用户,不重试| 用户场景 | 链路 | 字段流 | Recipe 位置 |
|---|---|---|---|
| --------- | ------ | ------- | ------------ |
| 查作品 + 评论 + 回复 | get_post → list_comments → list_replies | post_id → comment_id 接力 | recipes/post.md |
| 下载作品视频 | get_post → get_download | post_id 复用 | recipes/post.md |
| 看作品 + 二创 | get_post → list_remix | post_id 复用 | recipes/post.md |
| 用户名 → 用户作品 | search_users → get_profile → list_user_posts | username → user_id | recipes/user.md |
| 文生视频(异步) | create_video → 轮询 get_task_status → get_task_detail | task_id 接力 | recipes/tools.md |
| 图生视频(异步) | upload_image → create_video → 轮询 → get_task_detail | image_id → task_id | recipes/tools.md |
| Cameo 热榜 → 用户主页 | get_cameo_board → get_profile | user_id 复用 | recipes/tools.md |
收到 404 时(A):
收到 400 / 422 时(B):
message_zh 排查pending / running 不视为失败,必须继续轮询task_id 返回用户| 触发条件 | 推荐操作 |
|---|---|
| --------- | --------- |
| 合法路径持续 404 / 410 | skillhub upgrade maxhub-sora2(国内)或 clawhub upgrade maxhub-sora2(国际) |
| 用户问"版本是多少" | 当前版本 v3.7.2,访问 https://skillhub.cn/skills/maxhub-sora2 |
| 多端点连续 410 | skillhub upgrade maxhub-sora2 --force |
| 401 / 402 / 403 | 不是版本问题,去 https://www.aconfig.cn 处理 |
| 场景 | 命令 | ||
|---|---|---|---|
| --- | --- | ||
| 查 API Key | `[ -n "${MAXHUB_API_KEY:-}" ] && echo "ok" \ | \ | echo "missing"` |
| 查作品详情 | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/sora2/get_post_detail?post_id=s_xxx" | ||
| 查作品评论 | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/sora2/get_post_comments?post_id=s_xxx" | ||
| 查任务状态(轮询) | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/sora2/get_task_status?task_id=xxx" | ||
| 检查 SKILL 更新 | skillhub info maxhub-sora2 或 clawhub info maxhub-sora2 |
用户输入:「帮我看 Sora2 某个 post_id 的二创列表」
Agent 执行步骤:
references/recipes/_index.md → 找到 trigger 命中 → 选最长匹配的 recipereferences/recipes/.md 中对应段落,拿到 Inputs / Atomic Steps / Outputgrep 一下 endpoints_whitelist.yaml 确认存在$.data.bvid)按 recipe 的 extract 列绑定为变量,传给下游端点反例(agent 不要这么做):
endpoints_whitelist.yaml(大文件,浪费上下文)extract 列,自己猜 json_pathrecipes/post.md 中的 trending_post_analysis Recipe → 自动按 get_feed → get_post 链路执行recipes/tools.md 中的 cameo_full_dataset Recipe → 按 get_cameo_board → list_cameo 批量执行recipes/tools.md 中的 text_to_video_async Recipe → 串行 create_video → 子会话轮询 get_task_status → get_task_detailrecipes/post.md 中的 remix_chain_analysis Recipe → get_post → list_remix → get_profile 三步走maxhub-sora2/
├── SKILL.md # Skill 定义与使用文档(本文件)
├── README.md # 英文项目说明
├── README_CN.md # 中文项目说明
├── _meta.json # 版本元信息(version: 3.7.2)
└── references/
├── atoms/ # ⚛️ 原子层(标准化端点封装)
│ └── _index.md # 17 端点 × 业务别名映射表(atom_id / chain_role / idempotent / write_op)
├── recipes/ # 📜 编排层(多步业务场景脚本)
│ ├── _index.md # 全部 Recipe 索引(trigger_keywords + 文件路径)
│ ├── post.md # 作品域 Recipes(详情/评论/Remix/下载等)
│ ├── user.md # 用户域 Recipes(画像/社交/Cameo 出镜)
│ └── tools.md # 工具域 Recipes(视频生成/任务轮询/热榜)
├── post.md # 📖 Reference 详情:作品域 6 端点(5 区契约)
├── user.md # 📖 Reference 详情:用户域 6 端点
├── tools.md # 📖 Reference 详情:工具域 5 端点(含写入)
├── param-mappings.md # 🔗 中枢索引(全局红线 + 字段流字典 + 错误处理 + 替换矩阵)
├── endpoints_whitelist.yaml # 🛡️ 17 端点路径硬白名单 + Pre-call 4 步自检协议
└── update.md # 🔄 SKILL 更新机制(SkillHub / ClawHub / GitHub)
| 组件 | 技术 | 说明 |
|---|---|---|
| ------ | ------ | ------ |
| 调用方式 | curl + Bearer Token | HTTP GET 请求,参数通过 query string 传递 |
| 数据接口 | MaxHub API | https://www.aconfig.cn/api/v1/sora2/*,通过 MAXHUB_API_KEY 鉴权 |
| 原子层 | atoms/_index.md | 端点封装为 atom,含业务别名 + 链路角色 + 幂等性 + 写入标记 |
| 编排层 | recipes/*.md | 多步业务脚本,含 trigger_keywords + Atomic Steps + 字段流绑定 + on_err |
| 路径校验 | YAML 硬白名单 | endpoints_whitelist.yaml 提供 17 端点的逐字符校验 + 4 步 Pre-call 协议 |
| 错误处理 | 决策表 + 自检清单 | HTTP 状态码权威定义 + 防臆造自检(A/B 双轨)+ 重试策略矩阵 |
| 输出格式 | JSON Standard MaxHub Response | {code, message, message_zh, data, cache_url} |
| 更新通道 | SkillHub / ClawHub / GitHub | 国内 ⭐⭐⭐ SkillHub(腾讯云 CDN)/ 国际 ⭐⭐⭐ ClawHub / 降级 GitHub |
| 领域 | 端点数 | 原子数 | Recipes 数 | Reference 文件 |
|---|---|---|---|---|
| ------ | -------- | ------- | ---------- | --------------- |
| 作品(Posts) | 6 | 6 | 5+ | post.md |
| 用户(Users) | 6 | 6 | 4+ | user.md |
| 工具与 Cameo(Tools) | 5 | 5 | 5+ | tools.md |
| 合计 | 17 | 17 | 14 | — |
共 9 个版本