api-config.json 5.1 KB

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