api-config.json 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. "resolutionOrder": [
  89. "configFile"
  90. ],
  91. "apigId": "Vo3ROWEvDy",
  92. "paymentUrlResolution": {
  93. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  94. "steps": [
  95. "1. 从 voc-credentials.json 获取当前 session token",
  96. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  97. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  98. "4. 将该URL展示给用户,引导扫码支付"
  99. ],
  100. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  101. "userResolveHeaders": {
  102. "X-Parse-Application-Id": "ncloudmaster",
  103. "X-Parse-Session-Token": "{vocToken}"
  104. },
  105. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  106. "paymentParams": {
  107. "user": "{resolvedUserId}",
  108. "apigid": "Vo3ROWEvDy",
  109. "fun_id": "HOkkX72PMF"
  110. },
  111. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  112. },
  113. "onMissing": {
  114. "action": "showPaymentQR",
  115. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  116. "title": "扫码开通 VOC-AI 数据服务",
  117. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  118. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  119. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  120. },
  121. "onBalanceInsufficient": {
  122. "action": "resolveUserThenShowPayment",
  123. "title": "VOC-AI Token 余额不足,请扫码充值",
  124. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  125. }
  126. },
  127. "errorHandling": {
  128. "balanceInsufficient": {
  129. "conditions": [
  130. {
  131. "responseField": "code",
  132. "operator": "in",
  133. "value": [
  134. -2,
  135. -3,
  136. -10,
  137. 402,
  138. 429
  139. ]
  140. },
  141. {
  142. "responseField": "msg",
  143. "operator": "contains",
  144. "value": [
  145. "余额不足",
  146. "insufficient",
  147. "balance",
  148. "quota",
  149. "没有开通",
  150. "权限或余额"
  151. ]
  152. },
  153. {
  154. "responseField": "mess",
  155. "operator": "contains",
  156. "value": [
  157. "余额不足",
  158. "insufficient",
  159. "balance",
  160. "quota",
  161. "没有开通",
  162. "权限或余额"
  163. ]
  164. },
  165. {
  166. "responseField": "message",
  167. "operator": "contains",
  168. "value": [
  169. "余额不足",
  170. "insufficient",
  171. "balance",
  172. "没有开通",
  173. "权限或余额"
  174. ]
  175. }
  176. ],
  177. "matchMode": "any",
  178. "trigger": "tokenConfig.onBalanceInsufficient"
  179. },
  180. "unauthorized": {
  181. "conditions": [
  182. {
  183. "responseField": "code",
  184. "operator": "in",
  185. "value": [
  186. 401,
  187. 403
  188. ]
  189. },
  190. {
  191. "responseField": "msg",
  192. "operator": "contains",
  193. "value": [
  194. "unauthorized",
  195. "token",
  196. "invalid",
  197. "auth"
  198. ]
  199. }
  200. ],
  201. "matchMode": "any",
  202. "trigger": "tokenConfig.onMissing"
  203. }
  204. }
  205. }