api-config.json 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {
  2. "name": "jimeng-text2img-v31",
  3. "displayName": "即梦文生图3.1",
  4. "description": "即梦文生图3.1,画面效果升级版,画面美感塑造、风格精准多样及画面细节丰富度方面大幅提升。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getText2ImgV31",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "prompt",
  18. "token"
  19. ],
  20. "properties": {
  21. "prompt": {
  22. "type": "string",
  23. "description": "提示词,建议<=120字符,最长800字符"
  24. },
  25. "use_pre_llm": {
  26. "type": "boolean",
  27. "description": "是否开启文本扩写,默认true",
  28. "default": true
  29. },
  30. "sizeDate": {
  31. "type": "object",
  32. "description": "图片尺寸,默认1328×1328",
  33. "properties": {
  34. "width": {
  35. "type": "integer"
  36. },
  37. "height": {
  38. "type": "integer"
  39. }
  40. }
  41. },
  42. "token": {
  43. "type": "string",
  44. "description": "认证token"
  45. }
  46. }
  47. },
  48. "response": {
  49. "type": "object",
  50. "properties": {
  51. "code": {
  52. "type": "integer"
  53. },
  54. "data": {
  55. "type": "object",
  56. "properties": {
  57. "workId": {
  58. "type": "string"
  59. }
  60. }
  61. }
  62. }
  63. },
  64. "usageExamples": [
  65. {
  66. "name": "文生图-花卉艺术字",
  67. "input": {
  68. "prompt": "淡蓝紫的冷清感,一束小雏菊,右下角展示一串小的艺术字\"手捧一束小雏菊赠与你\"",
  69. "use_pre_llm": true,
  70. "sizeDate": {
  71. "width": 599,
  72. "height": 1328
  73. },
  74. "token": "Bearer r:xxx"
  75. },
  76. "description": "生成带艺术字的花卉图片"
  77. }
  78. ],
  79. "relatedSkills": [
  80. "jimeng-task-query",
  81. "jimeng-text2img-v3"
  82. ],
  83. "pricing": {
  84. "unit": "次",
  85. "price": 0.2,
  86. "currency": "CNY"
  87. },
  88. "timeout": 30000,
  89. "tokenConfig": {
  90. "type": "bearer",
  91. "configFile": "~/.openclaw/voc-credentials.json",
  92. "tokenField": "vocToken",
  93. "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
  94. "resolutionOrder": [
  95. "configFile",
  96. "currentToken"
  97. ],
  98. "apigId": "Vo3ROWEvDy",
  99. "paymentUrlResolution": {
  100. "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
  101. "steps": [
  102. "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
  103. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  104. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  105. "4. 将该URL展示给用户,引导扫码支付"
  106. ],
  107. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  108. "userResolveHeaders": {
  109. "X-Parse-Application-Id": "ncloudmaster",
  110. "X-Parse-Session-Token": "{vocToken}"
  111. },
  112. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  113. "paymentParams": {
  114. "user": "{resolvedUserId}",
  115. "apigid": "Vo3ROWEvDy",
  116. "fun_id": "HOkkX72PMF"
  117. },
  118. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  119. },
  120. "onMissing": {
  121. "action": "resolveUserThenShowPayment",
  122. "title": "扫码开通 VOC-AI 数据服务",
  123. "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
  124. },
  125. "onBalanceInsufficient": {
  126. "action": "resolveUserThenShowPayment",
  127. "title": "VOC-AI Token 余额不足,请扫码充值",
  128. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  129. }
  130. },
  131. "errorHandling": {
  132. "balanceInsufficient": {
  133. "conditions": [
  134. {
  135. "responseField": "code",
  136. "operator": "in",
  137. "value": [
  138. -2,
  139. -3,
  140. -10,
  141. 402,
  142. 429
  143. ]
  144. },
  145. {
  146. "responseField": "msg",
  147. "operator": "contains",
  148. "value": [
  149. "余额不足",
  150. "insufficient",
  151. "balance",
  152. "quota"
  153. ]
  154. },
  155. {
  156. "responseField": "message",
  157. "operator": "contains",
  158. "value": [
  159. "余额不足",
  160. "insufficient",
  161. "balance"
  162. ]
  163. }
  164. ],
  165. "matchMode": "any",
  166. "trigger": "tokenConfig.onBalanceInsufficient"
  167. },
  168. "unauthorized": {
  169. "conditions": [
  170. {
  171. "responseField": "code",
  172. "operator": "in",
  173. "value": [
  174. 401,
  175. 403
  176. ]
  177. },
  178. {
  179. "responseField": "msg",
  180. "operator": "contains",
  181. "value": [
  182. "unauthorized",
  183. "token",
  184. "invalid",
  185. "auth"
  186. ]
  187. }
  188. ],
  189. "matchMode": "any",
  190. "trigger": "tokenConfig.onMissing"
  191. }
  192. }
  193. }