api-config.json 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. {
  2. "name": "jimeng-actor",
  3. "displayName": "动作模仿1.0",
  4. "description": "输入一张图片和一段模版视频,将图片中的人物按照视频的动作/表情/口型驱动起来。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getActor",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "video_url",
  18. "image_url",
  19. "token"
  20. ],
  21. "properties": {
  22. "video_url": {
  23. "type": "string",
  24. "description": "模版视频URL"
  25. },
  26. "image_url": {
  27. "type": "string",
  28. "description": "图片URL"
  29. },
  30. "token": {
  31. "type": "string",
  32. "description": "认证token"
  33. }
  34. }
  35. },
  36. "response": {
  37. "type": "object",
  38. "properties": {
  39. "code": {
  40. "type": "integer"
  41. },
  42. "data": {
  43. "type": "object",
  44. "properties": {
  45. "workId": {
  46. "type": "string"
  47. }
  48. }
  49. }
  50. }
  51. },
  52. "usageExamples": [
  53. {
  54. "name": "人物动作模仿",
  55. "input": {
  56. "video_url": "https://example.com/dance.mp4",
  57. "image_url": "https://example.com/person.jpg",
  58. "token": "Bearer r:xxx"
  59. },
  60. "description": "让图片中的人物按照视频模版动作运动起来"
  61. }
  62. ],
  63. "relatedSkills": [
  64. "jimeng-task-query",
  65. "jimeng-actor-v2"
  66. ],
  67. "pricing": {
  68. "unit": "秒",
  69. "price": 0.5,
  70. "currency": "CNY",
  71. "reference": "https://www.volcengine.com/docs/85621/1544715"
  72. },
  73. "timeout": 30000,
  74. "tokenConfig": {
  75. "type": "body",
  76. "tokenField": "token",
  77. "format": "Bearer r:{{jimengToken}}",
  78. "configFile": "~/.openclaw/voc-credentials.json",
  79. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  80. "resolutionOrder": [
  81. "configFile",
  82. "currentToken"
  83. ],
  84. "onMissing": {
  85. "action": "showPaymentQR",
  86. "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  87. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  88. "pollingIntervalMs": 3000,
  89. "pollingTimeoutMs": 300000,
  90. "onPaymentSuccess": "retrySkillWithNewToken",
  91. "title": "扫码开通即梦AI生成服务",
  92. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  93. },
  94. "onBalanceInsufficient": {
  95. "action": "showPaymentQR",
  96. "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  97. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  98. "pollingIntervalMs": 3000,
  99. "pollingTimeoutMs": 300000,
  100. "onPaymentSuccess": "retrySkillWithNewToken",
  101. "title": "即梦AI Token 余额不足,请扫码充值",
  102. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  103. }
  104. },
  105. "errorHandling": {
  106. "balanceInsufficient": {
  107. "conditions": [
  108. {
  109. "responseField": "code",
  110. "operator": "in",
  111. "value": [
  112. -2,
  113. -3,
  114. -10,
  115. 402,
  116. 429
  117. ]
  118. },
  119. {
  120. "responseField": "msg",
  121. "operator": "contains",
  122. "value": [
  123. "余额不足",
  124. "insufficient",
  125. "balance",
  126. "quota"
  127. ]
  128. },
  129. {
  130. "responseField": "message",
  131. "operator": "contains",
  132. "value": [
  133. "余额不足",
  134. "insufficient",
  135. "balance"
  136. ]
  137. }
  138. ],
  139. "matchMode": "any",
  140. "trigger": "tokenConfig.onBalanceInsufficient"
  141. },
  142. "unauthorized": {
  143. "conditions": [
  144. {
  145. "responseField": "code",
  146. "operator": "in",
  147. "value": [
  148. 401,
  149. 403
  150. ]
  151. },
  152. {
  153. "responseField": "msg",
  154. "operator": "contains",
  155. "value": [
  156. "unauthorized",
  157. "token",
  158. "invalid",
  159. "auth"
  160. ]
  161. }
  162. ],
  163. "matchMode": "any",
  164. "trigger": "tokenConfig.onMissing"
  165. }
  166. }
  167. }