api-config.json 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. {
  2. "name": "jimeng-oh-generate",
  3. "displayName": "数字人v1.5-视频生成",
  4. "description": "OmniHuman1.5数字人模型,根据单张图片+音频生成高质量数字人视频。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getOmniHuman",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "audio_url",
  18. "token"
  19. ],
  20. "properties": {
  21. "workId": {
  22. "type": "string",
  23. "description": "步骤1的workId,与taskId二选一"
  24. },
  25. "taskId": {
  26. "type": "string",
  27. "description": "任务ID,与workId二选一"
  28. },
  29. "audio_url": {
  30. "type": "string",
  31. "description": "音频URL"
  32. },
  33. "prompt": {
  34. "type": "string",
  35. "description": "提示词,调整画面/动作/运镜"
  36. },
  37. "pe_fast_mode": {
  38. "type": "boolean",
  39. "description": "快速模式,默认false",
  40. "default": false
  41. },
  42. "mask_url": {
  43. "type": "array",
  44. "items": {
  45. "type": "string"
  46. },
  47. "description": "掩码图URL列表,指定讲话主体"
  48. },
  49. "token": {
  50. "type": "string",
  51. "description": "认证token"
  52. }
  53. }
  54. },
  55. "response": {
  56. "type": "object",
  57. "properties": {
  58. "code": {
  59. "type": "integer"
  60. },
  61. "data": {
  62. "type": "object",
  63. "properties": {
  64. "tip": {
  65. "type": "string"
  66. },
  67. "isContinue": {
  68. "type": "boolean"
  69. },
  70. "isFinish": {
  71. "type": "boolean"
  72. }
  73. }
  74. }
  75. }
  76. },
  77. "usageExamples": [
  78. {
  79. "name": "数字人朗读",
  80. "input": {
  81. "workId": "qH58sm1wMr",
  82. "audio_url": "https://example.com/speech.mp3",
  83. "prompt": "数字人朗读测试",
  84. "pe_fast_mode": false,
  85. "mask_url": [],
  86. "token": "Bearer r:xxx"
  87. },
  88. "description": "驱动图片中的人物按音频朗读"
  89. }
  90. ],
  91. "relatedSkills": [
  92. "jimeng-oh-identify",
  93. "jimeng-oh-detect",
  94. "jimeng-oh-query"
  95. ],
  96. "pricing": {
  97. "unit": "秒",
  98. "price": 1,
  99. "currency": "CNY",
  100. "reference": "https://www.volcengine.com/docs/85621/1834143"
  101. },
  102. "timeout": 30000,
  103. "tokenConfig": {
  104. "type": "bearer",
  105. "configFile": "~/.openclaw/voc-credentials.json",
  106. "tokenField": "vocToken",
  107. "resolutionOrder": [
  108. "configFile"
  109. ],
  110. "apigId": "Vo3ROWEvDy",
  111. "paymentUrlResolution": {
  112. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  113. "steps": [
  114. "1. 从 voc-credentials.json 获取当前 session token",
  115. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  116. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  117. "4. 将该URL展示给用户,引导扫码支付"
  118. ],
  119. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  120. "userResolveHeaders": {
  121. "X-Parse-Application-Id": "ncloudmaster",
  122. "X-Parse-Session-Token": "{vocToken}"
  123. },
  124. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  125. "paymentParams": {
  126. "user": "{resolvedUserId}",
  127. "apigid": "Vo3ROWEvDy",
  128. "fun_id": "HOkkX72PMF"
  129. },
  130. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  131. },
  132. "onMissing": {
  133. "action": "showPaymentQR",
  134. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  135. "title": "扫码开通 VOC-AI 数据服务",
  136. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  137. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  138. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  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. },
  172. {
  173. "responseField": "mess",
  174. "operator": "contains",
  175. "value": [
  176. "余额不足",
  177. "insufficient",
  178. "balance",
  179. "quota",
  180. "没有开通",
  181. "权限或余额"
  182. ]
  183. },
  184. {
  185. "responseField": "message",
  186. "operator": "contains",
  187. "value": [
  188. "余额不足",
  189. "insufficient",
  190. "balance",
  191. "没有开通",
  192. "权限或余额"
  193. ]
  194. }
  195. ],
  196. "matchMode": "any",
  197. "trigger": "tokenConfig.onBalanceInsufficient"
  198. },
  199. "unauthorized": {
  200. "conditions": [
  201. {
  202. "responseField": "code",
  203. "operator": "in",
  204. "value": [
  205. 401,
  206. 403
  207. ]
  208. },
  209. {
  210. "responseField": "msg",
  211. "operator": "contains",
  212. "value": [
  213. "unauthorized",
  214. "token",
  215. "invalid",
  216. "auth"
  217. ]
  218. }
  219. ],
  220. "matchMode": "any",
  221. "trigger": "tokenConfig.onMissing"
  222. }
  223. }
  224. }