api-config.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {
  2. "name": "jimeng-actor-v2",
  3. "displayName": "动作模仿2.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/getActorV2",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "image_url",
  18. "video_url",
  19. "token"
  20. ],
  21. "properties": {
  22. "image_url": {
  23. "type": "string",
  24. "description": "图片URL"
  25. },
  26. "video_url": {
  27. "type": "string",
  28. "description": "模版视频URL"
  29. },
  30. "cut_result_first_second_switch": {
  31. "type": "boolean",
  32. "description": "是否裁剪结果视频第1秒,默认true",
  33. "default": true
  34. },
  35. "callback_url": {
  36. "type": "string",
  37. "description": "回调接口URL"
  38. },
  39. "token": {
  40. "type": "string",
  41. "description": "认证token"
  42. }
  43. }
  44. },
  45. "response": {
  46. "type": "object",
  47. "properties": {
  48. "code": {
  49. "type": "integer"
  50. },
  51. "data": {
  52. "type": "object",
  53. "properties": {
  54. "workId": {
  55. "type": "string"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "usageExamples": [
  62. {
  63. "name": "人物动作模仿v2",
  64. "input": {
  65. "image_url": "https://example.com/person.jpg",
  66. "video_url": "https://example.com/dance.mp4",
  67. "cut_result_first_second_switch": false,
  68. "token": "Bearer r:xxx"
  69. },
  70. "description": "使用2.0模型驱动图片人物按视频动作运动"
  71. }
  72. ],
  73. "relatedSkills": [
  74. "jimeng-task-query",
  75. "jimeng-actor"
  76. ],
  77. "pricing": {
  78. "unit": "秒",
  79. "price": 0.4,
  80. "currency": "CNY",
  81. "reference": "https://www.volcengine.com/docs/85621/2205633"
  82. },
  83. "timeout": 30000,
  84. "tokenConfig": {
  85. "type": "bearer",
  86. "configFile": "~/.openclaw/voc-credentials.json",
  87. "tokenField": "vocToken",
  88. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  89. "resolutionOrder": [
  90. "configFile",
  91. "currentToken"
  92. ],
  93. "apigId": "Vo3ROWEvDy",
  94. "paymentUrlResolution": {
  95. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  96. "steps": [
  97. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  98. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  99. "3. 拼接充值URL: https://pwa.fmode.cn/apig-pay.html?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  100. "4. 将该URL展示给用户,引导扫码支付"
  101. ],
  102. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  103. "userResolveHeaders": {
  104. "X-Parse-Application-Id": "ncloudmaster",
  105. "X-Parse-Session-Token": "{vocToken}"
  106. },
  107. "paymentBaseUrl": "https://pwa.fmode.cn/apig-pay.html",
  108. "paymentParams": {
  109. "user": "{resolvedUserId}",
  110. "apigid": "Vo3ROWEvDy",
  111. "fun_id": "HOkkX72PMF"
  112. },
  113. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  114. },
  115. "onMissing": {
  116. "action": "resolveUserThenShowPayment",
  117. "title": "扫码开通 VOC-AI 数据服务",
  118. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  119. },
  120. "onBalanceInsufficient": {
  121. "action": "resolveUserThenShowPayment",
  122. "title": "VOC-AI Token 余额不足,请扫码充值",
  123. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  124. }
  125. },
  126. "errorHandling": {
  127. "balanceInsufficient": {
  128. "conditions": [
  129. {
  130. "responseField": "code",
  131. "operator": "in",
  132. "value": [
  133. -2,
  134. -3,
  135. -10,
  136. 402,
  137. 429
  138. ]
  139. },
  140. {
  141. "responseField": "msg",
  142. "operator": "contains",
  143. "value": [
  144. "余额不足",
  145. "insufficient",
  146. "balance",
  147. "quota"
  148. ]
  149. },
  150. {
  151. "responseField": "message",
  152. "operator": "contains",
  153. "value": [
  154. "余额不足",
  155. "insufficient",
  156. "balance"
  157. ]
  158. }
  159. ],
  160. "matchMode": "any",
  161. "trigger": "tokenConfig.onBalanceInsufficient"
  162. },
  163. "unauthorized": {
  164. "conditions": [
  165. {
  166. "responseField": "code",
  167. "operator": "in",
  168. "value": [
  169. 401,
  170. 403
  171. ]
  172. },
  173. {
  174. "responseField": "msg",
  175. "operator": "contains",
  176. "value": [
  177. "unauthorized",
  178. "token",
  179. "invalid",
  180. "auth"
  181. ]
  182. }
  183. ],
  184. "matchMode": "any",
  185. "trigger": "tokenConfig.onMissing"
  186. }
  187. }
  188. }