api-config.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {
  2. "name": "jimeng-super-resolution",
  3. "displayName": "智能超清",
  4. "description": "基于seedream基模将图像超清到4K/8K,全面提升画面质感。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getSuperResolution",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "image_urls",
  18. "token"
  19. ],
  20. "properties": {
  21. "image_urls": {
  22. "type": "array",
  23. "items": {
  24. "type": "string"
  25. },
  26. "description": "图片文件URL,需输入1张"
  27. },
  28. "resolution": {
  29. "type": "string",
  30. "description": "分辨率,默认4k",
  31. "default": "4k",
  32. "enum": [
  33. "4k",
  34. "8k"
  35. ]
  36. },
  37. "scale": {
  38. "type": "number",
  39. "description": "细节生成程度,默认50,范围[0,100]",
  40. "default": 50
  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": "超清到4K",
  67. "input": {
  68. "image_urls": [
  69. "https://example.com/photo.jpg"
  70. ],
  71. "resolution": "4k",
  72. "scale": 100,
  73. "token": "Bearer r:xxx"
  74. },
  75. "description": "将图片超清处理到4K分辨率"
  76. }
  77. ],
  78. "relatedSkills": [
  79. "jimeng-task-query"
  80. ],
  81. "pricing": {
  82. "unit": "次",
  83. "price": 0.4,
  84. "currency": "CNY",
  85. "reference": "https://www.volcengine.com/docs/86081/1660170"
  86. },
  87. "timeout": 30000,
  88. "tokenConfig": {
  89. "type": "body",
  90. "tokenField": "token",
  91. "format": "Bearer r:{{jimengToken}}",
  92. "configFile": "~/.openclaw/voc-credentials.json",
  93. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  94. "resolutionOrder": [
  95. "configFile",
  96. "currentToken"
  97. ],
  98. "onMissing": {
  99. "action": "showPaymentQR",
  100. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  101. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  102. "pollingIntervalMs": 3000,
  103. "pollingTimeoutMs": 300000,
  104. "onPaymentSuccess": "retrySkillWithNewToken",
  105. "title": "扫码开通即梦AI生成服务",
  106. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  107. },
  108. "onBalanceInsufficient": {
  109. "action": "showPaymentQR",
  110. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  111. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  112. "pollingIntervalMs": 3000,
  113. "pollingTimeoutMs": 300000,
  114. "onPaymentSuccess": "retrySkillWithNewToken",
  115. "title": "即梦AI Token 余额不足,请扫码充值",
  116. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  117. }
  118. },
  119. "errorHandling": {
  120. "balanceInsufficient": {
  121. "conditions": [
  122. {
  123. "responseField": "code",
  124. "operator": "in",
  125. "value": [
  126. -2,
  127. -3,
  128. -10,
  129. 402,
  130. 429
  131. ]
  132. },
  133. {
  134. "responseField": "msg",
  135. "operator": "contains",
  136. "value": [
  137. "余额不足",
  138. "insufficient",
  139. "balance",
  140. "quota"
  141. ]
  142. },
  143. {
  144. "responseField": "message",
  145. "operator": "contains",
  146. "value": [
  147. "余额不足",
  148. "insufficient",
  149. "balance"
  150. ]
  151. }
  152. ],
  153. "matchMode": "any",
  154. "trigger": "tokenConfig.onBalanceInsufficient"
  155. },
  156. "unauthorized": {
  157. "conditions": [
  158. {
  159. "responseField": "code",
  160. "operator": "in",
  161. "value": [
  162. 401,
  163. 403
  164. ]
  165. },
  166. {
  167. "responseField": "msg",
  168. "operator": "contains",
  169. "value": [
  170. "unauthorized",
  171. "token",
  172. "invalid",
  173. "auth"
  174. ]
  175. }
  176. ],
  177. "matchMode": "any",
  178. "trigger": "tokenConfig.onMissing"
  179. }
  180. }
  181. }