api-config.json 4.7 KB

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