api-config.json 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. {
  2. "name": "jimeng-video-v3-720p",
  3. "displayName": "视频生成3.0(720p)",
  4. "description": "即梦视频3.0 720P,支持文生视频、图生视频(首帧/首尾帧/运镜),高性价比之选。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_720p",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "prompt",
  18. "method",
  19. "token"
  20. ],
  21. "properties": {
  22. "prompt": {
  23. "type": "string",
  24. "description": "提示词,建议<=400字,最长800字"
  25. },
  26. "frames": {
  27. "type": "integer",
  28. "description": "帧数,范围[121,241],默认121",
  29. "default": 121
  30. },
  31. "method": {
  32. "type": "string",
  33. "description": "生成方式: 1文生视频 2首帧 3首尾帧 4运镜",
  34. "enum": [
  35. "1",
  36. "2",
  37. "3",
  38. "4"
  39. ]
  40. },
  41. "config": {
  42. "type": "object",
  43. "description": "配置参数,根据method不同而不同",
  44. "properties": {
  45. "aspect_ratio": {
  46. "type": "string",
  47. "description": "长宽比(method=1)",
  48. "enum": [
  49. "16:9",
  50. "4:3",
  51. "1:1",
  52. "3:4",
  53. "9:16",
  54. "21:9"
  55. ]
  56. },
  57. "image_urls": {
  58. "type": "array",
  59. "items": {
  60. "type": "string"
  61. },
  62. "description": "图片URL(method=2/3/4)"
  63. },
  64. "template_id": {
  65. "type": "string",
  66. "description": "运镜模板ID(method=4)"
  67. },
  68. "camera_strength": {
  69. "type": "string",
  70. "description": "运镜强度(method=4)",
  71. "enum": [
  72. "weak",
  73. "medium",
  74. "strong"
  75. ]
  76. }
  77. }
  78. },
  79. "token": {
  80. "type": "string",
  81. "description": "认证token"
  82. }
  83. }
  84. },
  85. "response": {
  86. "type": "object",
  87. "properties": {
  88. "code": {
  89. "type": "integer"
  90. },
  91. "data": {
  92. "type": "object",
  93. "properties": {
  94. "workId": {
  95. "type": "string"
  96. }
  97. }
  98. }
  99. }
  100. },
  101. "usageExamples": [
  102. {
  103. "name": "文生视频-16:9",
  104. "input": {
  105. "prompt": "一只小猫在草地上奔跑",
  106. "frames": 121,
  107. "method": "1",
  108. "config": {
  109. "aspect_ratio": "16:9"
  110. },
  111. "token": "Bearer r:xxx"
  112. },
  113. "description": "文本生成16:9 720p视频"
  114. },
  115. {
  116. "name": "图生视频-运镜",
  117. "input": {
  118. "prompt": "运镜拉远效果",
  119. "frames": 121,
  120. "method": "4",
  121. "config": {
  122. "image_urls": [
  123. "https://example.com/photo.jpg"
  124. ],
  125. "template_id": "quick_pull_back",
  126. "camera_strength": "medium"
  127. },
  128. "token": "Bearer r:xxx"
  129. },
  130. "description": "首帧图+超级拉远运镜模板生成视频"
  131. }
  132. ],
  133. "relatedSkills": [
  134. "jimeng-task-query",
  135. "jimeng-video-v3-1080p",
  136. "jimeng-video-v3-pro"
  137. ],
  138. "pricing": {
  139. "unit": "秒",
  140. "price": 0.28,
  141. "currency": "CNY"
  142. },
  143. "timeout": 30000,
  144. "tokenConfig": {
  145. "type": "bearer",
  146. "configFile": "~/.openclaw/voc-credentials.json",
  147. "tokenField": "vocToken",
  148. "resolutionOrder": [
  149. "configFile"
  150. ],
  151. "apigId": "Vo3ROWEvDy",
  152. "paymentUrlResolution": {
  153. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  154. "steps": [
  155. "1. 从 voc-credentials.json 获取当前 session token",
  156. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  157. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  158. "4. 将该URL展示给用户,引导扫码支付"
  159. ],
  160. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  161. "userResolveHeaders": {
  162. "X-Parse-Application-Id": "ncloudmaster",
  163. "X-Parse-Session-Token": "{vocToken}"
  164. },
  165. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  166. "paymentParams": {
  167. "user": "{resolvedUserId}",
  168. "apigid": "Vo3ROWEvDy",
  169. "fun_id": "HOkkX72PMF"
  170. },
  171. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  172. },
  173. "onMissing": {
  174. "action": "showPaymentQR",
  175. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  176. "title": "扫码开通 VOC-AI 数据服务",
  177. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  178. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  179. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  180. },
  181. "onBalanceInsufficient": {
  182. "action": "resolveUserThenShowPayment",
  183. "title": "VOC-AI Token 余额不足,请扫码充值",
  184. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  185. }
  186. },
  187. "errorHandling": {
  188. "balanceInsufficient": {
  189. "conditions": [
  190. {
  191. "responseField": "code",
  192. "operator": "in",
  193. "value": [
  194. -2,
  195. -3,
  196. -10,
  197. 402,
  198. 429
  199. ]
  200. },
  201. {
  202. "responseField": "msg",
  203. "operator": "contains",
  204. "value": [
  205. "余额不足",
  206. "insufficient",
  207. "balance",
  208. "quota",
  209. "没有开通",
  210. "权限或余额"
  211. ]
  212. },
  213. {
  214. "responseField": "mess",
  215. "operator": "contains",
  216. "value": [
  217. "余额不足",
  218. "insufficient",
  219. "balance",
  220. "quota",
  221. "没有开通",
  222. "权限或余额"
  223. ]
  224. },
  225. {
  226. "responseField": "message",
  227. "operator": "contains",
  228. "value": [
  229. "余额不足",
  230. "insufficient",
  231. "balance",
  232. "没有开通",
  233. "权限或余额"
  234. ]
  235. }
  236. ],
  237. "matchMode": "any",
  238. "trigger": "tokenConfig.onBalanceInsufficient"
  239. },
  240. "unauthorized": {
  241. "conditions": [
  242. {
  243. "responseField": "code",
  244. "operator": "in",
  245. "value": [
  246. 401,
  247. 403
  248. ]
  249. },
  250. {
  251. "responseField": "msg",
  252. "operator": "contains",
  253. "value": [
  254. "unauthorized",
  255. "token",
  256. "invalid",
  257. "auth"
  258. ]
  259. }
  260. ],
  261. "matchMode": "any",
  262. "trigger": "tokenConfig.onMissing"
  263. }
  264. }
  265. }