api-config.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {
  2. "name": "jimeng-text2img-v3",
  3. "displayName": "即梦文生图3.0",
  4. "description": "即梦文生图3.0,文字响应准确度高,支持艺术字体和不同字重,人像质感逼真,支持高清大图输出。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getText2ImgV3",
  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. "description": "图片宽"
  37. },
  38. "height": {
  39. "type": "integer",
  40. "description": "图片高"
  41. }
  42. }
  43. },
  44. "token": {
  45. "type": "string",
  46. "description": "认证token"
  47. }
  48. }
  49. },
  50. "response": {
  51. "type": "object",
  52. "properties": {
  53. "code": {
  54. "type": "integer",
  55. "description": "200表示成功"
  56. },
  57. "data": {
  58. "type": "object",
  59. "properties": {
  60. "workId": {
  61. "type": "string",
  62. "description": "任务ID"
  63. }
  64. }
  65. }
  66. }
  67. },
  68. "usageExamples": [
  69. {
  70. "name": "文生图-古风人像",
  71. "input": {
  72. "prompt": "芙蓉面美如远山秀,杏仁眼灵性儿透。",
  73. "use_pre_llm": true,
  74. "sizeDate": {
  75. "width": 599,
  76. "height": 1328
  77. },
  78. "token": "Bearer r:xxx"
  79. },
  80. "description": "生成古风人像图片"
  81. }
  82. ],
  83. "relatedSkills": [
  84. "jimeng-task-query",
  85. "jimeng-text2img-v31",
  86. "jimeng-img-v4"
  87. ],
  88. "pricing": {
  89. "unit": "次",
  90. "price": 0.2,
  91. "currency": "CNY"
  92. },
  93. "timeout": 30000,
  94. "tokenConfig": {
  95. "type": "body",
  96. "tokenField": "token",
  97. "format": "Bearer r:{{jimengToken}}",
  98. "configFile": "~/.openclaw/voc-credentials.json",
  99. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  100. "resolutionOrder": [
  101. "configFile",
  102. "currentToken"
  103. ],
  104. "onMissing": {
  105. "action": "showPaymentQR",
  106. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  107. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  108. "pollingIntervalMs": 3000,
  109. "pollingTimeoutMs": 300000,
  110. "onPaymentSuccess": "retrySkillWithNewToken",
  111. "title": "扫码开通即梦AI生成服务",
  112. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  113. },
  114. "onBalanceInsufficient": {
  115. "action": "showPaymentQR",
  116. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  117. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  118. "pollingIntervalMs": 3000,
  119. "pollingTimeoutMs": 300000,
  120. "onPaymentSuccess": "retrySkillWithNewToken",
  121. "title": "即梦AI Token 余额不足,请扫码充值",
  122. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  123. }
  124. },
  125. "errorHandling": {
  126. "balanceInsufficient": {
  127. "conditions": [
  128. {
  129. "responseField": "code",
  130. "operator": "in",
  131. "value": [
  132. -2,
  133. -3,
  134. -10,
  135. 402,
  136. 429
  137. ]
  138. },
  139. {
  140. "responseField": "msg",
  141. "operator": "contains",
  142. "value": [
  143. "余额不足",
  144. "insufficient",
  145. "balance",
  146. "quota"
  147. ]
  148. },
  149. {
  150. "responseField": "message",
  151. "operator": "contains",
  152. "value": [
  153. "余额不足",
  154. "insufficient",
  155. "balance"
  156. ]
  157. }
  158. ],
  159. "matchMode": "any",
  160. "trigger": "tokenConfig.onBalanceInsufficient"
  161. },
  162. "unauthorized": {
  163. "conditions": [
  164. {
  165. "responseField": "code",
  166. "operator": "in",
  167. "value": [
  168. 401,
  169. 403
  170. ]
  171. },
  172. {
  173. "responseField": "msg",
  174. "operator": "contains",
  175. "value": [
  176. "unauthorized",
  177. "token",
  178. "invalid",
  179. "auth"
  180. ]
  181. }
  182. ],
  183. "matchMode": "any",
  184. "trigger": "tokenConfig.onMissing"
  185. }
  186. }
  187. }