api-config.json 5.6 KB

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