api-config.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. {
  2. "name": "jimeng-oh-identify",
  3. "displayName": "数字人v1.5-主体识别",
  4. "description": "数字人v1.5步骤1:识别图片中是否包含人、类人、拟人等主体。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getOhIdentifyMain",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "image_url",
  18. "token"
  19. ],
  20. "properties": {
  21. "image_url": {
  22. "type": "string",
  23. "description": "图片URL"
  24. },
  25. "token": {
  26. "type": "string",
  27. "description": "认证token"
  28. }
  29. }
  30. },
  31. "response": {
  32. "type": "object",
  33. "properties": {
  34. "code": {
  35. "type": "integer"
  36. },
  37. "data": {
  38. "type": "object",
  39. "properties": {
  40. "workId": {
  41. "type": "string"
  42. }
  43. }
  44. }
  45. }
  46. },
  47. "usageExamples": [
  48. {
  49. "name": "识别人物主体",
  50. "input": {
  51. "image_url": "https://example.com/person.jpg",
  52. "token": "Bearer r:xxx"
  53. },
  54. "description": "识别图片中是否存在可驱动的主体"
  55. }
  56. ],
  57. "relatedSkills": [
  58. "jimeng-oh-query",
  59. "jimeng-oh-detect",
  60. "jimeng-oh-generate"
  61. ],
  62. "pricing": {
  63. "unit": "秒",
  64. "price": 1,
  65. "currency": "CNY",
  66. "reference": "https://www.volcengine.com/docs/85621/1834143"
  67. },
  68. "timeout": 30000,
  69. "tokenConfig": {
  70. "type": "body",
  71. "tokenField": "token",
  72. "format": "Bearer r:{{jimengToken}}",
  73. "configFile": "~/.openclaw/voc-credentials.json",
  74. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  75. "resolutionOrder": [
  76. "configFile",
  77. "currentToken"
  78. ],
  79. "onMissing": {
  80. "action": "showPaymentQR",
  81. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  82. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  83. "pollingIntervalMs": 3000,
  84. "pollingTimeoutMs": 300000,
  85. "onPaymentSuccess": "retrySkillWithNewToken",
  86. "title": "扫码开通即梦AI生成服务",
  87. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  88. },
  89. "onBalanceInsufficient": {
  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 Token 余额不足,请扫码充值",
  97. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  98. }
  99. },
  100. "errorHandling": {
  101. "balanceInsufficient": {
  102. "conditions": [
  103. {
  104. "responseField": "code",
  105. "operator": "in",
  106. "value": [
  107. -2,
  108. -3,
  109. -10,
  110. 402,
  111. 429
  112. ]
  113. },
  114. {
  115. "responseField": "msg",
  116. "operator": "contains",
  117. "value": [
  118. "余额不足",
  119. "insufficient",
  120. "balance",
  121. "quota"
  122. ]
  123. },
  124. {
  125. "responseField": "message",
  126. "operator": "contains",
  127. "value": [
  128. "余额不足",
  129. "insufficient",
  130. "balance"
  131. ]
  132. }
  133. ],
  134. "matchMode": "any",
  135. "trigger": "tokenConfig.onBalanceInsufficient"
  136. },
  137. "unauthorized": {
  138. "conditions": [
  139. {
  140. "responseField": "code",
  141. "operator": "in",
  142. "value": [
  143. 401,
  144. 403
  145. ]
  146. },
  147. {
  148. "responseField": "msg",
  149. "operator": "contains",
  150. "value": [
  151. "unauthorized",
  152. "token",
  153. "invalid",
  154. "auth"
  155. ]
  156. }
  157. ],
  158. "matchMode": "any",
  159. "trigger": "tokenConfig.onMissing"
  160. }
  161. }
  162. }