api-config.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. {
  2. "name": "jimeng-oh-query",
  3. "displayName": "数字人任务查询",
  4. "description": "查询数字人流程中主体识别和视频生成的任务状态。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getOhDateByTask",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "routerName",
  18. "token"
  19. ],
  20. "properties": {
  21. "workId": {
  22. "type": "string",
  23. "description": "作品ID,与taskId二选一"
  24. },
  25. "taskId": {
  26. "type": "string",
  27. "description": "任务ID,与workId二选一"
  28. },
  29. "routerName": {
  30. "type": "string",
  31. "description": "查询接口名称",
  32. "enum": [
  33. "getOhIdentifyMain",
  34. "getOmniHuman"
  35. ]
  36. },
  37. "logo_info": {
  38. "type": "object",
  39. "description": "水印信息,仅routerName=getOmniHuman时生效",
  40. "properties": {
  41. "add_logo": {
  42. "type": "boolean",
  43. "default": false
  44. },
  45. "position": {
  46. "type": "integer",
  47. "default": 0
  48. },
  49. "language": {
  50. "type": "integer",
  51. "default": 0
  52. },
  53. "opacity": {
  54. "type": "number",
  55. "default": 1
  56. },
  57. "logo_text_content": {
  58. "type": "string"
  59. }
  60. }
  61. },
  62. "token": {
  63. "type": "string",
  64. "description": "认证token"
  65. }
  66. }
  67. },
  68. "response": {
  69. "type": "object",
  70. "properties": {
  71. "code": {
  72. "type": "integer"
  73. },
  74. "data": {
  75. "type": "object",
  76. "properties": {
  77. "tip": {
  78. "type": "string",
  79. "description": "状态提示文字"
  80. },
  81. "isContinue": {
  82. "type": "boolean",
  83. "description": "是否可继续后续步骤"
  84. },
  85. "isFinish": {
  86. "type": "boolean",
  87. "description": "是否生成完成"
  88. }
  89. }
  90. }
  91. }
  92. },
  93. "usageExamples": [
  94. {
  95. "name": "查询主体识别结果",
  96. "input": {
  97. "workId": "qH58sm1wMr",
  98. "routerName": "getOhIdentifyMain",
  99. "token": "Bearer r:xxx"
  100. },
  101. "description": "查询步骤1主体识别是否完成"
  102. },
  103. {
  104. "name": "查询视频生成结果",
  105. "input": {
  106. "workId": "qH58sm1wMr",
  107. "routerName": "getOmniHuman",
  108. "token": "Bearer r:xxx"
  109. },
  110. "description": "查询步骤3数字人视频是否生成完成"
  111. }
  112. ],
  113. "pollingConfig": {
  114. "intervalMs": 3000,
  115. "maxAttempts": 120,
  116. "completionCondition": {
  117. "getOhIdentifyMain": "data.isContinue === true",
  118. "getOmniHuman": "data.isFinish === true"
  119. }
  120. },
  121. "relatedSkills": [
  122. "jimeng-oh-identify",
  123. "jimeng-oh-detect",
  124. "jimeng-oh-generate"
  125. ],
  126. "timeout": 15000,
  127. "tokenConfig": {
  128. "type": "bearer",
  129. "configFile": "~/.openclaw/voc-credentials.json",
  130. "tokenField": "vocToken",
  131. "resolutionOrder": [
  132. "configFile"
  133. ],
  134. "apigId": "Vo3ROWEvDy",
  135. "paymentUrlResolution": {
  136. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  137. "steps": [
  138. "1. 从 voc-credentials.json 获取当前 session token",
  139. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  140. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  141. "4. 将该URL展示给用户,引导扫码支付"
  142. ],
  143. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  144. "userResolveHeaders": {
  145. "X-Parse-Application-Id": "ncloudmaster",
  146. "X-Parse-Session-Token": "{vocToken}"
  147. },
  148. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  149. "paymentParams": {
  150. "user": "{resolvedUserId}",
  151. "apigid": "Vo3ROWEvDy",
  152. "fun_id": "HOkkX72PMF"
  153. },
  154. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  155. },
  156. "onMissing": {
  157. "action": "showPaymentQR",
  158. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  159. "title": "扫码开通 VOC-AI 数据服务",
  160. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  161. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  162. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  163. },
  164. "onBalanceInsufficient": {
  165. "action": "resolveUserThenShowPayment",
  166. "title": "VOC-AI Token 余额不足,请扫码充值",
  167. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  168. }
  169. },
  170. "errorHandling": {
  171. "balanceInsufficient": {
  172. "conditions": [
  173. {
  174. "responseField": "code",
  175. "operator": "in",
  176. "value": [
  177. -2,
  178. -3,
  179. -10,
  180. 402,
  181. 429
  182. ]
  183. },
  184. {
  185. "responseField": "msg",
  186. "operator": "contains",
  187. "value": [
  188. "余额不足",
  189. "insufficient",
  190. "balance",
  191. "quota",
  192. "没有开通",
  193. "权限或余额"
  194. ]
  195. },
  196. {
  197. "responseField": "mess",
  198. "operator": "contains",
  199. "value": [
  200. "余额不足",
  201. "insufficient",
  202. "balance",
  203. "quota",
  204. "没有开通",
  205. "权限或余额"
  206. ]
  207. },
  208. {
  209. "responseField": "message",
  210. "operator": "contains",
  211. "value": [
  212. "余额不足",
  213. "insufficient",
  214. "balance",
  215. "没有开通",
  216. "权限或余额"
  217. ]
  218. }
  219. ],
  220. "matchMode": "any",
  221. "trigger": "tokenConfig.onBalanceInsufficient"
  222. },
  223. "unauthorized": {
  224. "conditions": [
  225. {
  226. "responseField": "code",
  227. "operator": "in",
  228. "value": [
  229. 401,
  230. 403
  231. ]
  232. },
  233. {
  234. "responseField": "msg",
  235. "operator": "contains",
  236. "value": [
  237. "unauthorized",
  238. "token",
  239. "invalid",
  240. "auth"
  241. ]
  242. }
  243. ],
  244. "matchMode": "any",
  245. "trigger": "tokenConfig.onMissing"
  246. }
  247. }
  248. }