api-config.json 5.6 KB

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