api-config.json 5.6 KB

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