api-config.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  78. "resolutionOrder": [
  79. "configFile",
  80. "currentToken"
  81. ],
  82. "apigId": "Vo3ROWEvDy",
  83. "paymentUrlResolution": {
  84. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  85. "steps": [
  86. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  87. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  88. "3. 拼接充值URL: https://pwa.fmode.cn/apig-pay.html?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  89. "4. 将该URL展示给用户,引导扫码支付"
  90. ],
  91. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  92. "userResolveHeaders": {
  93. "X-Parse-Application-Id": "ncloudmaster",
  94. "X-Parse-Session-Token": "{vocToken}"
  95. },
  96. "paymentBaseUrl": "https://pwa.fmode.cn/apig-pay.html",
  97. "paymentParams": {
  98. "user": "{resolvedUserId}",
  99. "apigid": "Vo3ROWEvDy",
  100. "fun_id": "HOkkX72PMF"
  101. },
  102. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  103. },
  104. "onMissing": {
  105. "action": "resolveUserThenShowPayment",
  106. "title": "扫码开通 VOC-AI 数据服务",
  107. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  108. },
  109. "onBalanceInsufficient": {
  110. "action": "resolveUserThenShowPayment",
  111. "title": "VOC-AI Token 余额不足,请扫码充值",
  112. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  113. }
  114. },
  115. "errorHandling": {
  116. "balanceInsufficient": {
  117. "conditions": [
  118. {
  119. "responseField": "code",
  120. "operator": "in",
  121. "value": [
  122. -2,
  123. -3,
  124. -10,
  125. 402,
  126. 429
  127. ]
  128. },
  129. {
  130. "responseField": "msg",
  131. "operator": "contains",
  132. "value": [
  133. "余额不足",
  134. "insufficient",
  135. "balance",
  136. "quota"
  137. ]
  138. },
  139. {
  140. "responseField": "message",
  141. "operator": "contains",
  142. "value": [
  143. "余额不足",
  144. "insufficient",
  145. "balance"
  146. ]
  147. }
  148. ],
  149. "matchMode": "any",
  150. "trigger": "tokenConfig.onBalanceInsufficient"
  151. },
  152. "unauthorized": {
  153. "conditions": [
  154. {
  155. "responseField": "code",
  156. "operator": "in",
  157. "value": [
  158. 401,
  159. 403
  160. ]
  161. },
  162. {
  163. "responseField": "msg",
  164. "operator": "contains",
  165. "value": [
  166. "unauthorized",
  167. "token",
  168. "invalid",
  169. "auth"
  170. ]
  171. }
  172. ],
  173. "matchMode": "any",
  174. "trigger": "tokenConfig.onMissing"
  175. }
  176. }
  177. }