api-config.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. {
  2. "name": "jimeng-video-v3-pro",
  3. "displayName": "即梦视频生成3.0Pro",
  4. "description": "即梦视频3.0Pro,具备多镜头叙事能力,1080P专业级质感视频。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_Pro",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "token"
  18. ],
  19. "properties": {
  20. "prompt": {
  21. "type": "string",
  22. "description": "提示词(文生视频必填,图生视频可不传)"
  23. },
  24. "image_url": {
  25. "type": "string",
  26. "description": "首帧图片URL(图生视频必填)"
  27. },
  28. "image_urls": {
  29. "description": "首帧图片URL,允许传数组或单值"
  30. },
  31. "frames": {
  32. "type": "integer",
  33. "description": "帧数,范围[121,241],默认121",
  34. "default": 121
  35. },
  36. "aspect_ratio": {
  37. "type": "integer",
  38. "description": "比例编号: 1=16:9 2=4:3 3=1:1 4=3:4 5=9:16 6=21:9",
  39. "enum": [
  40. 1,
  41. 2,
  42. 3,
  43. 4,
  44. 5,
  45. 6
  46. ]
  47. },
  48. "token": {
  49. "type": "string",
  50. "description": "认证token"
  51. }
  52. }
  53. },
  54. "response": {
  55. "type": "object",
  56. "properties": {
  57. "code": {
  58. "type": "integer"
  59. },
  60. "data": {
  61. "type": "object",
  62. "properties": {
  63. "workId": {
  64. "type": "string"
  65. }
  66. }
  67. }
  68. }
  69. },
  70. "usageExamples": [
  71. {
  72. "name": "文生视频Pro",
  73. "input": {
  74. "prompt": "两个q版小女孩笑着面向镜头慢慢地跑",
  75. "frames": 121,
  76. "aspect_ratio": 5,
  77. "token": "Bearer r:xxx"
  78. },
  79. "description": "文本生成9:16竖屏Pro级视频"
  80. },
  81. {
  82. "name": "图生视频Pro",
  83. "input": {
  84. "prompt": "人物缓缓转头微笑",
  85. "image_url": "https://example.com/photo.png",
  86. "frames": 121,
  87. "aspect_ratio": 5,
  88. "token": "Bearer r:xxx"
  89. },
  90. "description": "首帧图片驱动生成Pro级视频"
  91. }
  92. ],
  93. "relatedSkills": [
  94. "jimeng-task-query",
  95. "jimeng-video-v3-720p",
  96. "jimeng-video-v3-1080p"
  97. ],
  98. "pricing": {
  99. "unit": "秒",
  100. "price": 1,
  101. "currency": "CNY"
  102. },
  103. "timeout": 30000,
  104. "tokenConfig": {
  105. "type": "bearer",
  106. "configFile": "~/.openclaw/voc-credentials.json",
  107. "tokenField": "vocToken",
  108. "resolutionOrder": [
  109. "configFile"
  110. ],
  111. "apigId": "Vo3ROWEvDy",
  112. "paymentUrlResolution": {
  113. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  114. "steps": [
  115. "1. 从 voc-credentials.json 获取当前 session token",
  116. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  117. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  118. "4. 将该URL展示给用户,引导扫码支付"
  119. ],
  120. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  121. "userResolveHeaders": {
  122. "X-Parse-Application-Id": "ncloudmaster",
  123. "X-Parse-Session-Token": "{vocToken}"
  124. },
  125. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  126. "paymentParams": {
  127. "user": "{resolvedUserId}",
  128. "apigid": "Vo3ROWEvDy",
  129. "fun_id": "HOkkX72PMF"
  130. },
  131. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  132. },
  133. "onMissing": {
  134. "action": "showPaymentQR",
  135. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  136. "title": "扫码开通 VOC-AI 数据服务",
  137. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  138. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  139. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  140. },
  141. "onBalanceInsufficient": {
  142. "action": "resolveUserThenShowPayment",
  143. "title": "VOC-AI Token 余额不足,请扫码充值",
  144. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  145. }
  146. },
  147. "errorHandling": {
  148. "balanceInsufficient": {
  149. "conditions": [
  150. {
  151. "responseField": "code",
  152. "operator": "in",
  153. "value": [
  154. -2,
  155. -3,
  156. -10,
  157. 402,
  158. 429
  159. ]
  160. },
  161. {
  162. "responseField": "msg",
  163. "operator": "contains",
  164. "value": [
  165. "余额不足",
  166. "insufficient",
  167. "balance",
  168. "quota",
  169. "没有开通",
  170. "权限或余额"
  171. ]
  172. },
  173. {
  174. "responseField": "mess",
  175. "operator": "contains",
  176. "value": [
  177. "余额不足",
  178. "insufficient",
  179. "balance",
  180. "quota",
  181. "没有开通",
  182. "权限或余额"
  183. ]
  184. },
  185. {
  186. "responseField": "message",
  187. "operator": "contains",
  188. "value": [
  189. "余额不足",
  190. "insufficient",
  191. "balance",
  192. "没有开通",
  193. "权限或余额"
  194. ]
  195. }
  196. ],
  197. "matchMode": "any",
  198. "trigger": "tokenConfig.onBalanceInsufficient"
  199. },
  200. "unauthorized": {
  201. "conditions": [
  202. {
  203. "responseField": "code",
  204. "operator": "in",
  205. "value": [
  206. 401,
  207. 403
  208. ]
  209. },
  210. {
  211. "responseField": "msg",
  212. "operator": "contains",
  213. "value": [
  214. "unauthorized",
  215. "token",
  216. "invalid",
  217. "auth"
  218. ]
  219. }
  220. ],
  221. "matchMode": "any",
  222. "trigger": "tokenConfig.onMissing"
  223. }
  224. }
  225. }