api-config.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  79. "resolutionOrder": [
  80. "configFile",
  81. "currentToken"
  82. ],
  83. "apigId": "Vo3ROWEvDy",
  84. "paymentUrlResolution": {
  85. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  86. "steps": [
  87. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  88. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  89. "3. 拼接充值URL: https://pwa.fmode.cn/apig-pay.html?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  90. "4. 将该URL展示给用户,引导扫码支付"
  91. ],
  92. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  93. "userResolveHeaders": {
  94. "X-Parse-Application-Id": "ncloudmaster",
  95. "X-Parse-Session-Token": "{vocToken}"
  96. },
  97. "paymentBaseUrl": "https://pwa.fmode.cn/apig-pay.html",
  98. "paymentParams": {
  99. "user": "{resolvedUserId}",
  100. "apigid": "Vo3ROWEvDy",
  101. "fun_id": "HOkkX72PMF"
  102. },
  103. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  104. },
  105. "onMissing": {
  106. "action": "resolveUserThenShowPayment",
  107. "title": "扫码开通 VOC-AI 数据服务",
  108. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  109. },
  110. "onBalanceInsufficient": {
  111. "action": "resolveUserThenShowPayment",
  112. "title": "VOC-AI Token 余额不足,请扫码充值",
  113. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  114. }
  115. },
  116. "errorHandling": {
  117. "balanceInsufficient": {
  118. "conditions": [
  119. {
  120. "responseField": "code",
  121. "operator": "in",
  122. "value": [
  123. -2,
  124. -3,
  125. -10,
  126. 402,
  127. 429
  128. ]
  129. },
  130. {
  131. "responseField": "msg",
  132. "operator": "contains",
  133. "value": [
  134. "余额不足",
  135. "insufficient",
  136. "balance",
  137. "quota"
  138. ]
  139. },
  140. {
  141. "responseField": "message",
  142. "operator": "contains",
  143. "value": [
  144. "余额不足",
  145. "insufficient",
  146. "balance"
  147. ]
  148. }
  149. ],
  150. "matchMode": "any",
  151. "trigger": "tokenConfig.onBalanceInsufficient"
  152. },
  153. "unauthorized": {
  154. "conditions": [
  155. {
  156. "responseField": "code",
  157. "operator": "in",
  158. "value": [
  159. 401,
  160. 403
  161. ]
  162. },
  163. {
  164. "responseField": "msg",
  165. "operator": "contains",
  166. "value": [
  167. "unauthorized",
  168. "token",
  169. "invalid",
  170. "auth"
  171. ]
  172. }
  173. ],
  174. "matchMode": "any",
  175. "trigger": "tokenConfig.onMissing"
  176. }
  177. }
  178. }