api-config.json 5.6 KB

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