api-config.json 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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": "bearer",
  71. "configFile": "~/.openclaw/voc-credentials.json",
  72. "tokenField": "vocToken",
  73. "resolutionOrder": [
  74. "configFile"
  75. ],
  76. "apigId": "Vo3ROWEvDy",
  77. "paymentUrlResolution": {
  78. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  79. "steps": [
  80. "1. 从 voc-credentials.json 获取当前 session token",
  81. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  82. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  83. "4. 将该URL展示给用户,引导扫码支付"
  84. ],
  85. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  86. "userResolveHeaders": {
  87. "X-Parse-Application-Id": "ncloudmaster",
  88. "X-Parse-Session-Token": "{vocToken}"
  89. },
  90. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  91. "paymentParams": {
  92. "user": "{resolvedUserId}",
  93. "apigid": "Vo3ROWEvDy",
  94. "fun_id": "HOkkX72PMF"
  95. },
  96. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  97. },
  98. "onMissing": {
  99. "action": "showPaymentQR",
  100. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  101. "title": "扫码开通 VOC-AI 数据服务",
  102. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  103. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  104. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  105. },
  106. "onBalanceInsufficient": {
  107. "action": "resolveUserThenShowPayment",
  108. "title": "VOC-AI Token 余额不足,请扫码充值",
  109. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  110. }
  111. },
  112. "errorHandling": {
  113. "balanceInsufficient": {
  114. "conditions": [
  115. {
  116. "responseField": "code",
  117. "operator": "in",
  118. "value": [
  119. -2,
  120. -3,
  121. -10,
  122. 402,
  123. 429
  124. ]
  125. },
  126. {
  127. "responseField": "msg",
  128. "operator": "contains",
  129. "value": [
  130. "余额不足",
  131. "insufficient",
  132. "balance",
  133. "quota",
  134. "没有开通",
  135. "权限或余额"
  136. ]
  137. },
  138. {
  139. "responseField": "mess",
  140. "operator": "contains",
  141. "value": [
  142. "余额不足",
  143. "insufficient",
  144. "balance",
  145. "quota",
  146. "没有开通",
  147. "权限或余额"
  148. ]
  149. },
  150. {
  151. "responseField": "message",
  152. "operator": "contains",
  153. "value": [
  154. "余额不足",
  155. "insufficient",
  156. "balance",
  157. "没有开通",
  158. "权限或余额"
  159. ]
  160. }
  161. ],
  162. "matchMode": "any",
  163. "trigger": "tokenConfig.onBalanceInsufficient"
  164. },
  165. "unauthorized": {
  166. "conditions": [
  167. {
  168. "responseField": "code",
  169. "operator": "in",
  170. "value": [
  171. 401,
  172. 403
  173. ]
  174. },
  175. {
  176. "responseField": "msg",
  177. "operator": "contains",
  178. "value": [
  179. "unauthorized",
  180. "token",
  181. "invalid",
  182. "auth"
  183. ]
  184. }
  185. ],
  186. "matchMode": "any",
  187. "trigger": "tokenConfig.onMissing"
  188. }
  189. }
  190. }