api-config.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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": "body",
  129. "tokenField": "token",
  130. "format": "Bearer r:{{jimengToken}}",
  131. "configFile": "~/.openclaw/voc-credentials.json",
  132. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  133. "resolutionOrder": [
  134. "configFile",
  135. "currentToken"
  136. ],
  137. "onMissing": {
  138. "action": "showPaymentQR",
  139. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  140. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  141. "pollingIntervalMs": 3000,
  142. "pollingTimeoutMs": 300000,
  143. "onPaymentSuccess": "retrySkillWithNewToken",
  144. "title": "扫码开通即梦AI生成服务",
  145. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  146. },
  147. "onBalanceInsufficient": {
  148. "action": "showPaymentQR",
  149. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  150. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  151. "pollingIntervalMs": 3000,
  152. "pollingTimeoutMs": 300000,
  153. "onPaymentSuccess": "retrySkillWithNewToken",
  154. "title": "即梦AI Token 余额不足,请扫码充值",
  155. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  156. }
  157. },
  158. "errorHandling": {
  159. "balanceInsufficient": {
  160. "conditions": [
  161. {
  162. "responseField": "code",
  163. "operator": "in",
  164. "value": [
  165. -2,
  166. -3,
  167. -10,
  168. 402,
  169. 429
  170. ]
  171. },
  172. {
  173. "responseField": "msg",
  174. "operator": "contains",
  175. "value": [
  176. "余额不足",
  177. "insufficient",
  178. "balance",
  179. "quota"
  180. ]
  181. },
  182. {
  183. "responseField": "message",
  184. "operator": "contains",
  185. "value": [
  186. "余额不足",
  187. "insufficient",
  188. "balance"
  189. ]
  190. }
  191. ],
  192. "matchMode": "any",
  193. "trigger": "tokenConfig.onBalanceInsufficient"
  194. },
  195. "unauthorized": {
  196. "conditions": [
  197. {
  198. "responseField": "code",
  199. "operator": "in",
  200. "value": [
  201. 401,
  202. 403
  203. ]
  204. },
  205. {
  206. "responseField": "msg",
  207. "operator": "contains",
  208. "value": [
  209. "unauthorized",
  210. "token",
  211. "invalid",
  212. "auth"
  213. ]
  214. }
  215. ],
  216. "matchMode": "any",
  217. "trigger": "tokenConfig.onMissing"
  218. }
  219. }
  220. }