api-config.json 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. {
  2. "name": "jimeng-inpaint",
  3. "displayName": "交互编辑(局部重绘/消除笔)",
  4. "description": "通过涂抹选区建立重绘区域,支持局部重绘和消除笔功能。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getInpaint",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "image_urls",
  18. "prompt",
  19. "token"
  20. ],
  21. "properties": {
  22. "image_urls": {
  23. "type": "array",
  24. "items": {
  25. "type": "string"
  26. },
  27. "description": "图片文件URL,需输入2张(原图+mask图)"
  28. },
  29. "prompt": {
  30. "type": "string",
  31. "description": "提示词,消除场景输入\"删除\",文字修改放在\"\"内"
  32. },
  33. "token": {
  34. "type": "string",
  35. "description": "认证token"
  36. }
  37. }
  38. },
  39. "response": {
  40. "type": "object",
  41. "properties": {
  42. "code": {
  43. "type": "integer"
  44. },
  45. "data": {
  46. "type": "object",
  47. "properties": {
  48. "workId": {
  49. "type": "string"
  50. }
  51. }
  52. }
  53. }
  54. },
  55. "usageExamples": [
  56. {
  57. "name": "局部重绘-替换人物",
  58. "input": {
  59. "image_urls": [
  60. "https://example.com/original.png",
  61. "https://example.com/mask.png"
  62. ],
  63. "prompt": "将小女孩换成古风仙子",
  64. "token": "Bearer r:xxx"
  65. },
  66. "description": "使用mask标记区域,重绘为古风仙子"
  67. }
  68. ],
  69. "relatedSkills": [
  70. "jimeng-task-query"
  71. ],
  72. "pricing": {
  73. "unit": "次",
  74. "price": 0.2,
  75. "currency": "CNY",
  76. "reference": "https://www.volcengine.com/docs/86081/1660170"
  77. },
  78. "timeout": 30000,
  79. "tokenConfig": {
  80. "type": "body",
  81. "tokenField": "token",
  82. "format": "Bearer r:{{jimengToken}}",
  83. "configFile": "~/.openclaw/voc-credentials.json",
  84. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  85. "resolutionOrder": [
  86. "configFile",
  87. "currentToken"
  88. ],
  89. "onMissing": {
  90. "action": "showPaymentQR",
  91. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  92. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  93. "pollingIntervalMs": 3000,
  94. "pollingTimeoutMs": 300000,
  95. "onPaymentSuccess": "retrySkillWithNewToken",
  96. "title": "扫码开通即梦AI生成服务",
  97. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  98. },
  99. "onBalanceInsufficient": {
  100. "action": "showPaymentQR",
  101. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  102. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  103. "pollingIntervalMs": 3000,
  104. "pollingTimeoutMs": 300000,
  105. "onPaymentSuccess": "retrySkillWithNewToken",
  106. "title": "即梦AI Token 余额不足,请扫码充值",
  107. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  108. }
  109. },
  110. "errorHandling": {
  111. "balanceInsufficient": {
  112. "conditions": [
  113. {
  114. "responseField": "code",
  115. "operator": "in",
  116. "value": [
  117. -2,
  118. -3,
  119. -10,
  120. 402,
  121. 429
  122. ]
  123. },
  124. {
  125. "responseField": "msg",
  126. "operator": "contains",
  127. "value": [
  128. "余额不足",
  129. "insufficient",
  130. "balance",
  131. "quota"
  132. ]
  133. },
  134. {
  135. "responseField": "message",
  136. "operator": "contains",
  137. "value": [
  138. "余额不足",
  139. "insufficient",
  140. "balance"
  141. ]
  142. }
  143. ],
  144. "matchMode": "any",
  145. "trigger": "tokenConfig.onBalanceInsufficient"
  146. },
  147. "unauthorized": {
  148. "conditions": [
  149. {
  150. "responseField": "code",
  151. "operator": "in",
  152. "value": [
  153. 401,
  154. 403
  155. ]
  156. },
  157. {
  158. "responseField": "msg",
  159. "operator": "contains",
  160. "value": [
  161. "unauthorized",
  162. "token",
  163. "invalid",
  164. "auth"
  165. ]
  166. }
  167. ],
  168. "matchMode": "any",
  169. "trigger": "tokenConfig.onMissing"
  170. }
  171. }
  172. }