api-config.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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": "body",
  75. "tokenField": "token",
  76. "format": "Bearer r:{{jimengToken}}",
  77. "configFile": "~/.openclaw/voc-credentials.json",
  78. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  79. "resolutionOrder": [
  80. "configFile",
  81. "currentToken"
  82. ],
  83. "onMissing": {
  84. "action": "showPaymentQR",
  85. "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  86. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  87. "pollingIntervalMs": 3000,
  88. "pollingTimeoutMs": 300000,
  89. "onPaymentSuccess": "retrySkillWithNewToken",
  90. "title": "扫码开通即梦AI生成服务",
  91. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  92. },
  93. "onBalanceInsufficient": {
  94. "action": "showPaymentQR",
  95. "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  96. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  97. "pollingIntervalMs": 3000,
  98. "pollingTimeoutMs": 300000,
  99. "onPaymentSuccess": "retrySkillWithNewToken",
  100. "title": "即梦AI Token 余额不足,请扫码充值",
  101. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  102. }
  103. },
  104. "errorHandling": {
  105. "balanceInsufficient": {
  106. "conditions": [
  107. {
  108. "responseField": "code",
  109. "operator": "in",
  110. "value": [
  111. -2,
  112. -3,
  113. -10,
  114. 402,
  115. 429
  116. ]
  117. },
  118. {
  119. "responseField": "msg",
  120. "operator": "contains",
  121. "value": [
  122. "余额不足",
  123. "insufficient",
  124. "balance",
  125. "quota"
  126. ]
  127. },
  128. {
  129. "responseField": "message",
  130. "operator": "contains",
  131. "value": [
  132. "余额不足",
  133. "insufficient",
  134. "balance"
  135. ]
  136. }
  137. ],
  138. "matchMode": "any",
  139. "trigger": "tokenConfig.onBalanceInsufficient"
  140. },
  141. "unauthorized": {
  142. "conditions": [
  143. {
  144. "responseField": "code",
  145. "operator": "in",
  146. "value": [
  147. 401,
  148. 403
  149. ]
  150. },
  151. {
  152. "responseField": "msg",
  153. "operator": "contains",
  154. "value": [
  155. "unauthorized",
  156. "token",
  157. "invalid",
  158. "auth"
  159. ]
  160. }
  161. ],
  162. "matchMode": "any",
  163. "trigger": "tokenConfig.onMissing"
  164. }
  165. }
  166. }