@desplega.ai/agent-swarm 2.13.0 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/dist/acp-adapter-xtj40wd8.js +17 -0
  2. package/dist/{acp-targets-86f0sh6g.js → acp-targets-n7vm5atw.js} +10 -10
  3. package/dist/{actions-zv8vcxvr.js → actions-hq6wp9xv.js} +27 -27
  4. package/dist/{agent-fs-provision-jqshb33y.js → agent-fs-provision-y0qc1rdd.js} +4 -4
  5. package/dist/{amp-adapter-gt503ywc.js → amp-adapter-1qqs6h91.js} +3 -3
  6. package/dist/{app-6t4k5rh1.js → app-7m4z44rv.js} +10 -10
  7. package/dist/{approval-notifications-fcfw063h.js → approval-notifications-8sr41gjx.js} +11 -11
  8. package/dist/{assistant-9dzybh12.js → assistant-hkczwfv6.js} +28 -28
  9. package/dist/{boot-args-schema-xzfp2feg.js → boot-args-schema-8025snev.js} +1 -1
  10. package/dist/{boot-reembed-r88wngfg.js → boot-reembed-15m87nr1.js} +1 -1
  11. package/dist/{boot-reembed-3jz0p2jk.js → boot-reembed-4bbpxjh1.js} +1 -1
  12. package/dist/{boot-scrub-sweep-scrqhw48.js → boot-scrub-sweep-eajr97e9.js} +2 -2
  13. package/dist/{boot-seeds-vb2dcrrb.js → boot-seeds-9cwy39jx.js} +4 -4
  14. package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
  15. package/dist/{claude-adapter-h3mp9hgs.js → claude-adapter-g61wa4rt.js} +9 -9
  16. package/dist/{claude-managed-adapter-kpbyj2vb.js → claude-managed-adapter-znkk0prm.js} +3 -3
  17. package/dist/{claude-managed-setup-0efr3wkg.js → claude-managed-setup-f1wndkr2.js} +2 -2
  18. package/dist/{claude-sdk-session-03dw669q.js → claude-sdk-session-687xzf21.js} +20763 -19381
  19. package/dist/{cli-gfcv679k.js → cli-04103ryh.js} +1 -1
  20. package/dist/{cli-hbq0kwxz.js → cli-0a336ze7.js} +4 -4
  21. package/dist/{cli-1v82d2w6.js → cli-0fx95c06.js} +4 -4
  22. package/dist/{cli-wxwv3t11.js → cli-0m77n7ej.js} +3 -3
  23. package/dist/{cli-j53hpbsm.js → cli-0xwb7zpt.js} +2 -2
  24. package/dist/{cli-0dg7ytxm.js → cli-13t0smbk.js} +917 -23
  25. package/dist/{cli-0pazkmd4.js → cli-1b5axkt1.js} +4 -4
  26. package/dist/{cli-6h88mn9q.js → cli-1carhg8g.js} +4 -4
  27. package/dist/{cli-hgsxnjyg.js → cli-1dr5at77.js} +10 -10
  28. package/dist/{cli-0jkenasr.js → cli-2v4xxnx2.js} +1 -1
  29. package/dist/{cli-dnh64e8e.js → cli-32xndx6b.js} +6 -6
  30. package/dist/{cli-hpb9x72z.js → cli-3m8vqehw.js} +9 -9
  31. package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
  32. package/dist/{cli-7dbhnsj9.js → cli-3zyme1wt.js} +4 -4
  33. package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
  34. package/dist/{cli-t35hx078.js → cli-4h90xaet.js} +2 -2
  35. package/dist/{cli-117g15t4.js → cli-4mj5g29m.js} +8 -8
  36. package/dist/{cli-47hz21se.js → cli-4tbvndmm.js} +4 -5
  37. package/dist/{cli-tn91wc6e.js → cli-50whymxq.js} +1 -1
  38. package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
  39. package/dist/{cli-xfjn2kyq.js → cli-5v6b2am8.js} +5 -5
  40. package/dist/{cli-49f5jyhh.js → cli-6r1dwegd.js} +3 -3
  41. package/dist/{cli-kspxjftk.js → cli-7ewre3dm.js} +15 -6
  42. package/dist/{cli-n3qe7tyr.js → cli-84xtgbn6.js} +35 -2
  43. package/dist/{cli-w14j2z4k.js → cli-8cmjkbvj.js} +2 -2
  44. package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
  45. package/dist/{cli-9m9kyw77.js → cli-8rbkw18r.js} +2 -2
  46. package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
  47. package/dist/{cli-f1952kjy.js → cli-9xx36trj.js} +4 -4
  48. package/dist/{cli-hc6e4tac.js → cli-a8ts6x1n.js} +6 -6
  49. package/dist/{cli-mh7pdxe0.js → cli-aebswqmz.js} +12 -12
  50. package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
  51. package/dist/{cli-b2jh3dyb.js → cli-bjmq14k9.js} +4 -4
  52. package/dist/{cli-mz34pxbk.js → cli-byxsctca.js} +11 -11
  53. package/dist/{cli-dka73bak.js → cli-c0tyzt73.js} +152 -12
  54. package/dist/{cli-wv20kbr3.js → cli-c8kqmzzf.js} +5 -5
  55. package/dist/{cli-qhhb30e8.js → cli-cd9acnvd.js} +9 -9
  56. package/dist/{cli-wndegmns.js → cli-cmgdptmx.js} +3 -3
  57. package/dist/{cli-1dbv9mj9.js → cli-cn6fpa1p.js} +1 -1
  58. package/dist/{cli-wrhbym01.js → cli-cp0m07wb.js} +6 -6
  59. package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
  60. package/dist/{cli-g6j6ac3h.js → cli-cqxwjb93.js} +2 -2
  61. package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
  62. package/dist/{cli-qm3ntjqs.js → cli-dd57p1gd.js} +13 -13
  63. package/dist/{cli-tstj6e8e.js → cli-fn8aj7gb.js} +250 -55
  64. package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
  65. package/dist/{cli-2skf1mdf.js → cli-gedf48yw.js} +4 -4
  66. package/dist/{cli-c8v2yvej.js → cli-gq6qhmrr.js} +2 -2
  67. package/dist/{cli-sq913bh1.js → cli-grcc2h2g.js} +8 -8
  68. package/dist/{cli-qec9bynj.js → cli-h03j6je3.js} +3 -3
  69. package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
  70. package/dist/{cli-jj3c5nyb.js → cli-h9bejmkf.js} +76 -39
  71. package/dist/{cli-ct8sz3np.js → cli-hs3mqswp.js} +6 -6
  72. package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
  73. package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
  74. package/dist/{cli-y4a4458j.js → cli-jhtvt7gn.js} +3 -3
  75. package/dist/{cli-dkejt425.js → cli-mmw2sjaf.js} +7 -7
  76. package/dist/{cli-50w82h6m.js → cli-mwxez0pz.js} +1 -0
  77. package/dist/{cli-avxh26pd.js → cli-nk8swfpx.js} +4 -4
  78. package/dist/{cli-fhvk2nvp.js → cli-p7g7wd9n.js} +9 -9
  79. package/dist/{cli-bhgrhedp.js → cli-q8aq48v1.js} +1 -1
  80. package/dist/{cli-6a40p4kv.js → cli-qn79645p.js} +1 -1
  81. package/dist/{cli-nc6a8b5b.js → cli-qx1dwrr5.js} +2 -2
  82. package/dist/{cli-sdh61g52.js → cli-s6fhqbz1.js} +2 -2
  83. package/dist/{cli-eb279wn3.js → cli-sfajkbd7.js} +2 -2
  84. package/dist/{cli-z64t9pe6.js → cli-snypfjgj.js} +1 -1
  85. package/dist/{cli-ytc7fpza.js → cli-t25rq8mg.js} +4 -4
  86. package/dist/{cli-zqmmy073.js → cli-t90k0phh.js} +18 -18
  87. package/dist/{cli-fz9pcjsw.js → cli-tzzas8rb.js} +4 -4
  88. package/dist/{cli-rtmqzat7.js → cli-vdfngx2g.js} +2 -2
  89. package/dist/{cli-9w8712tq.js → cli-vr4eyq6p.js} +43 -14
  90. package/dist/{cli-z4f346g5.js → cli-vx9acp12.js} +1 -1
  91. package/dist/{cli-y518qkjg.js → cli-w24f3j49.js} +10 -10
  92. package/dist/{cli-yn4kt85g.js → cli-w41bvvms.js} +1 -1
  93. package/dist/{cli-9fsagra4.js → cli-w6c6dj91.js} +1 -1
  94. package/dist/{cli-kde4ky90.js → cli-x5yb8zc8.js} +2 -2
  95. package/dist/{cli-48nvk6sb.js → cli-xhkek467.js} +2 -2
  96. package/dist/{cli-avqkr20b.js → cli-y6qqbpwc.js} +2 -2
  97. package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
  98. package/dist/{cli-prf7kz78.js → cli-yeh3g1q6.js} +603 -78
  99. package/dist/{cli-ajjvqhf3.js → cli-z6m6xzxt.js} +2 -2
  100. package/dist/{cli-2jk4s7z1.js → cli-zaate0rd.js} +3 -3
  101. package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
  102. package/dist/{cli-0b655smz.js → cli-zvpkrgsc.js} +5 -5
  103. package/dist/cli.js +27 -27
  104. package/dist/{codex-adapter-f3yp0kaj.js → codex-adapter-ysfg6ty3.js} +8 -8
  105. package/dist/{codex-hook-262cekfp.js → codex-hook-c0nvm30r.js} +2 -2
  106. package/dist/{codex-login-1ven7yje.js → codex-login-ven5cz5j.js} +1 -1
  107. package/dist/{codex-session-runner-ns4mv70p.js → codex-session-runner-823scr6g.js} +9 -9
  108. package/dist/{commands-5bzf2tfw.js → commands-5rbm07fz.js} +3 -3
  109. package/dist/{controller-5xt7kvfm.js → controller-wn3vd217.js} +3 -3
  110. package/dist/{controllers-connect-0gg13mzp.js → controllers-connect-34jzhfft.js} +28 -28
  111. package/dist/core-kdehq26g.js +42 -0
  112. package/dist/{cursor-adapter-p0c5zv6r.js → cursor-adapter-w1681kp1.js} +2 -2
  113. package/dist/{db-2s68ycq7.js → db-6bkgbfwk.js} +3 -3
  114. package/dist/{db-q7q639k5.js → db-hcj16x7z.js} +2 -2
  115. package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
  116. package/dist/{dispatcher-j2y1q7ae.js → dispatcher-jgjqrfzv.js} +25 -25
  117. package/dist/{docker-1b41eysj.js → docker-1h33jvh9.js} +2 -2
  118. package/dist/{dsh-adapter-pgnkf4st.js → dsh-adapter-g9yqv09y.js} +2 -2
  119. package/dist/{e2b-xm60c8ad.js → e2b-jnk0yeva.js} +2 -2
  120. package/dist/{e2b-ew8c5j5v.js → e2b-y7e5kmzf.js} +2 -2
  121. package/dist/{easter-egg-3d-0kea97jf.js → easter-egg-3d-w17nsny6.js} +1 -1
  122. package/dist/{embedding-space-3n6mhhmy.js → embedding-space-v06fwy7b.js} +6 -6
  123. package/dist/{embeddings-jfmj6yme.js → embeddings-g50dxea4.js} +1 -1
  124. package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
  125. package/dist/{execute-tjrej979.js → execute-1n36haw1.js} +1 -1
  126. package/dist/{external-channel-jy8w2gg3.js → external-channel-43tv8pg6.js} +2 -2
  127. package/dist/fx-adapter-bvh05t4a.js +20 -0
  128. package/dist/grok-adapter-my5j8mdf.js +20 -0
  129. package/dist/handlers-wyymeeqh.js +41 -0
  130. package/dist/heartbeat-sf3nk937.js +50 -0
  131. package/dist/{hook-bpnncsec.js → hook-dqph1e05.js} +8 -8
  132. package/dist/{hook-fv1jwrv7.js → hook-m1m9dm6w.js} +6 -6
  133. package/dist/{http-bpa26czn.js → http-w0th1cz9.js} +160 -102
  134. package/dist/index-22khdtby.js +44 -0
  135. package/dist/{index-mpj0z9e0.js → index-c0e8en64.js} +1 -1
  136. package/dist/{index-620y7jzq.js → index-e8pz8qdg.js} +3 -3
  137. package/dist/{index-8p0j4h4j.js → index-ez823q84.js} +94 -89
  138. package/dist/{index-w216g9y9.js → index-ffba0z8q.js} +35 -21
  139. package/dist/{index-s8re7mvq.js → index-gkpfgpg7.js} +1 -1
  140. package/dist/{index-4k7m5dgj.js → index-k8ajc0g0.js} +143 -103
  141. package/dist/index-np0582ac.js +40 -0
  142. package/dist/{index-52tgbhrw.js → index-pb03vans.js} +28 -28
  143. package/dist/index-vgkrj1jt.js +39 -0
  144. package/dist/{index-pe3d8jfy.js → index-whysn1wf.js} +1 -1
  145. package/dist/{index-0h6qd4p1.js → index-y4vd4mhn.js} +3 -4
  146. package/dist/{k8s-fy8hbhkg.js → k8s-8326q0rq.js} +2 -2
  147. package/dist/{keepalive-d6z12s04.js → keepalive-2v06q2e8.js} +5 -4
  148. package/dist/lead-55z813ng.js +79 -0
  149. package/dist/{maintenance-7kac6g2g.js → maintenance-vx7vjhhy.js} +1 -1
  150. package/dist/{oauth-refresh-sweep-t1xjetbh.js → oauth-refresh-sweep-g06k4bza.js} +4 -3
  151. package/dist/{object-webhooks-6rdagg0r.js → object-webhooks-3dzdq4fm.js} +7 -7
  152. package/dist/{onboard-32y1cfxy.js → onboard-232pazny.js} +4 -4
  153. package/dist/{opencode-adapter-enp3v31n.js → opencode-adapter-t0paqbh8.js} +8 -8
  154. package/dist/{otel-impl-k0tm5ptj.js → otel-impl-kmpkyp4y.js} +2 -2
  155. package/dist/{pending-24zebgvs.js → pending-x0z3vx1x.js} +26 -26
  156. package/dist/{pi-mono-adapter-yj72xxxe.js → pi-mono-adapter-7pmypn6d.js} +17 -15
  157. package/dist/{pricing-refresh-cf25x38j.js → pricing-refresh-ytjmtyd7.js} +2 -2
  158. package/dist/{rbac-roles-0wydd22m.js → rbac-roles-fgm5mxr2.js} +3 -3
  159. package/dist/{rbac-roles-at6crb3r.js → rbac-roles-xyaxekh3.js} +2 -2
  160. package/dist/{render-v2-nvcw0jd7.js → render-v2-ws972g4r.js} +10 -10
  161. package/dist/{resume-y4w0k5v3.js → resume-m6mjzhkp.js} +13 -13
  162. package/dist/{runtime-vpe43hx0.js → runtime-zzpc0c8a.js} +1 -1
  163. package/dist/{session-access-gkyvnfye.js → session-access-vp35xs91.js} +5 -5
  164. package/dist/{session-source-backfill-3w2st4m2.js → session-source-backfill-p73e8zbe.js} +2 -2
  165. package/dist/{setup-axxvqtys.js → setup-r4kd7rxg.js} +1 -1
  166. package/dist/thread-buffer-cm2nzq6t.js +42 -0
  167. package/dist/{tree-visibility-y4fqvab5.js → tree-visibility-07h2tbs2.js} +2 -2
  168. package/dist/{user-merge-jobs-kcmwvrc6.js → user-merge-jobs-96vg9rpe.js} +3 -3
  169. package/dist/{virtual-modules-7d92dct1.js → virtual-modules-vgn3f2x4.js} +3 -3
  170. package/dist/{work-objects-f708e069.js → work-objects-74hbcx3e.js} +28 -28
  171. package/dist/worker-5pn2vzx6.js +79 -0
  172. package/dist/{worker-follow-up-0by8wztc.js → worker-follow-up-ezavwn5d.js} +25 -25
  173. package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
  174. package/openapi.json +1793 -1622
  175. package/package.json +10 -10
  176. package/src/apps/catalog.generated.json +726 -0
  177. package/src/apps/definition.ts +24 -7
  178. package/src/apps/page-validator.ts +225 -3
  179. package/src/be/db.ts +38 -10
  180. package/src/be/mcp-proxy.ts +5 -4
  181. package/src/be/migrations/340_api_key_spend_cap.sql +5 -0
  182. package/src/be/schedules/validate.ts +26 -0
  183. package/src/be/swarm-config-guard.ts +4 -0
  184. package/src/commands/credential-outcome-report.ts +5 -2
  185. package/src/commands/onboard/agent-fs-version.ts +1 -1
  186. package/src/commands/provider-credentials.ts +19 -0
  187. package/src/commands/provider-error-class.ts +4 -1
  188. package/src/commands/rate-limit-outcome.ts +48 -3
  189. package/src/commands/runner.ts +113 -55
  190. package/src/commands/worktree-reaper.ts +600 -0
  191. package/src/extensions/contract-types.generated.ts +1 -1
  192. package/src/http/agents.ts +4 -0
  193. package/src/http/api-keys.ts +27 -3
  194. package/src/http/pages-public.ts +40 -4
  195. package/src/http/pool-keys.ts +21 -2
  196. package/src/http/schedules.ts +28 -3
  197. package/src/http/script-connections.ts +12 -4
  198. package/src/http/script-runs.ts +12 -3
  199. package/src/http/tasks.ts +6 -10
  200. package/src/mcp-client/http-client.ts +3 -1
  201. package/src/oauth/identity-capture.ts +6 -1
  202. package/src/oauth/mcp-wrapper.ts +10 -3
  203. package/src/oauth/wrapper.ts +15 -3
  204. package/src/prompts/session-templates.ts +1 -0
  205. package/src/providers/acp-targets.ts +2 -2
  206. package/src/providers/amp-adapter.ts +1 -1
  207. package/src/providers/dsh-adapter.ts +1 -1
  208. package/src/providers/pi-mono-adapter.ts +4 -2
  209. package/src/providers/runtime-dependencies.ts +1 -1
  210. package/src/rbac/legacy-policy.ts +2 -0
  211. package/src/rbac/permissions.ts +5 -0
  212. package/src/scripts-runtime/types/swarm-extension.d.ts +7 -7
  213. package/src/slack/enrich.ts +14 -11
  214. package/src/tests/agents-list-model-display.test.ts +23 -0
  215. package/src/tests/apps-spike2.test.ts +35 -0
  216. package/src/tests/base-prompt.test.ts +1 -0
  217. package/src/tests/deploy-guard.test.ts +24 -0
  218. package/src/tests/dsh-adapter.test.ts +1 -1
  219. package/src/tests/ensure-token.test.ts +2 -2
  220. package/src/tests/entrypoint-repo-autoclone-args.test.ts +202 -0
  221. package/src/tests/fake-dns.ts +47 -0
  222. package/src/tests/fixtures/base-prompt-baseline.json +12 -12
  223. package/src/tests/latest-model-report.test.ts +138 -0
  224. package/src/tests/mcp-oauth-dcr-reuse.test.ts +5 -2
  225. package/src/tests/mcp-oauth-ensure-token.test.ts +3 -2
  226. package/src/tests/mcp-oauth-manual-client.test.ts +6 -1
  227. package/src/tests/mcp-oauth-wrapper.test.ts +20 -4
  228. package/src/tests/mcp-outbound-fetch-guard.test.ts +169 -0
  229. package/src/tests/mcp-server-ssrf.test.ts +2 -0
  230. package/src/tests/memory-search-stall.test.ts +5 -0
  231. package/src/tests/oauth-connection-fetch-guard.test.ts +162 -0
  232. package/src/tests/oauth-token-endpoint-fetch-guard.test.ts +121 -0
  233. package/src/tests/oauth-wrapper.test.ts +1 -2
  234. package/src/tests/pages-head-v2.test.ts +2 -1
  235. package/src/tests/script-connections-http.test.ts +8 -3
  236. package/src/tests/script-connections.test.ts +2 -0
  237. package/src/tests/slack-thread-participants.test.ts +14 -3
  238. package/src/tests/spend-cap-credentials.test.ts +34 -0
  239. package/src/tests/spend-cap-outcome.test.ts +67 -0
  240. package/src/tests/subscription-first.test.ts +119 -0
  241. package/src/tests/worktree-reaper.test.ts +424 -0
  242. package/src/tools/get-task-details.ts +247 -5
  243. package/src/tools/schedules/patch-schedule.ts +26 -1
  244. package/src/tools/schedules/update-schedule.ts +28 -2
  245. package/src/utils/credentials.ts +36 -1
  246. package/src/utils/egress-guard.ts +40 -10
  247. package/src/utils/error-tracker.ts +17 -0
  248. package/templates/skills/apps/SKILL.md +191 -2
  249. package/templates/skills/apps/content.md +191 -2
  250. package/templates/skills/boards-and-sheets/content.md +11 -0
  251. package/templates/skills/pages/content.md +11 -0
  252. package/templates/skills/swarm-docs/content.md +2 -0
  253. package/templates/skills/swarm-scripts/SKILL.md +1 -0
  254. package/templates/skills/swarm-scripts/content.md +1 -0
  255. package/templates/workflows/ralph-loop/content.md +6 -6
  256. package/dist/acp-adapter-cn53011z.js +0 -17
  257. package/dist/cli-pr0eze3x.js +0 -149
  258. package/dist/core-0fqtbrxa.js +0 -42
  259. package/dist/fx-adapter-k6w3jvz9.js +0 -20
  260. package/dist/grok-adapter-4q5tssw0.js +0 -20
  261. package/dist/handlers-qxgfvvsf.js +0 -41
  262. package/dist/heartbeat-6tr2w2da.js +0 -50
  263. package/dist/index-0mcxjdsa.js +0 -44
  264. package/dist/index-dz4q23ag.js +0 -40
  265. package/dist/index-s175jckx.js +0 -39
  266. package/dist/lead-p3hx7h35.js +0 -79
  267. package/dist/thread-buffer-rwa7d4dx.js +0 -42
  268. package/dist/worker-8rg9gz74.js +0 -79
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "2.13.0",
5
+ "version": "2.13.1",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -19936,112 +19936,92 @@
19936
19936
  }
19937
19937
  }
19938
19938
  },
19939
- "/api/config/pool-keys": {
19940
- "get": {
19941
- "summary": "List credential pool suffixes and status",
19939
+ "/api/keys/report-usage": {
19940
+ "post": {
19941
+ "summary": "Record which API key was used for a task",
19942
19942
  "tags": [
19943
- "Config"
19943
+ "API Keys"
19944
19944
  ],
19945
19945
  "security": [
19946
19946
  {
19947
19947
  "bearerAuth": []
19948
19948
  }
19949
19949
  ],
19950
- "parameters": [
19951
- {
19952
- "schema": {
19953
- "type": "string"
19954
- },
19955
- "required": true,
19956
- "name": "key",
19957
- "in": "query"
19950
+ "requestBody": {
19951
+ "content": {
19952
+ "application/json": {
19953
+ "schema": {
19954
+ "type": "object",
19955
+ "properties": {
19956
+ "keyType": {
19957
+ "type": "string"
19958
+ },
19959
+ "keySuffix": {
19960
+ "type": "string",
19961
+ "minLength": 1,
19962
+ "maxLength": 10
19963
+ },
19964
+ "keyIndex": {
19965
+ "type": "integer",
19966
+ "minimum": 0
19967
+ },
19968
+ "taskId": {
19969
+ "type": "string",
19970
+ "format": "uuid"
19971
+ },
19972
+ "scope": {
19973
+ "type": "string"
19974
+ },
19975
+ "scopeId": {
19976
+ "type": "string"
19977
+ },
19978
+ "plan": {
19979
+ "type": "string",
19980
+ "maxLength": 40
19981
+ },
19982
+ "planRaw": {
19983
+ "type": "string",
19984
+ "minLength": 1,
19985
+ "maxLength": 80
19986
+ }
19987
+ },
19988
+ "required": [
19989
+ "keyType",
19990
+ "keySuffix",
19991
+ "keyIndex"
19992
+ ]
19993
+ }
19994
+ }
19958
19995
  }
19959
- ],
19996
+ },
19960
19997
  "responses": {
19961
19998
  "200": {
19962
- "description": "Credential pool",
19999
+ "description": "Usage recorded",
19963
20000
  "content": {
19964
20001
  "application/json": {
19965
20002
  "schema": {
19966
20003
  "type": "object",
19967
20004
  "properties": {
19968
- "key": {
19969
- "type": "string"
19970
- },
19971
- "source": {
19972
- "type": "string",
20005
+ "success": {
20006
+ "type": "boolean",
19973
20007
  "enum": [
19974
- "stored",
19975
- "env",
19976
- "none"
20008
+ true
19977
20009
  ]
19978
20010
  },
19979
- "readOnly": {
19980
- "type": "boolean"
19981
- },
19982
- "keys": {
19983
- "type": "array",
19984
- "items": {
19985
- "type": "object",
19986
- "properties": {
19987
- "index": {
19988
- "type": "integer",
19989
- "minimum": 0
19990
- },
19991
- "suffix": {
19992
- "type": "string"
19993
- },
19994
- "status": {
19995
- "type": "string",
19996
- "enum": [
19997
- "ok",
19998
- "rejected",
19999
- "rate_limited",
20000
- "unchecked"
20001
- ]
20002
- },
20003
- "error": {
20004
- "type": [
20005
- "string",
20006
- "null"
20007
- ]
20008
- },
20009
- "checkedAt": {
20010
- "type": [
20011
- "string",
20012
- "null"
20013
- ]
20014
- },
20015
- "rateLimitedUntil": {
20016
- "type": [
20017
- "string",
20018
- "null"
20019
- ]
20020
- }
20021
- },
20022
- "required": [
20023
- "index",
20024
- "suffix",
20025
- "status",
20026
- "error",
20027
- "checkedAt",
20028
- "rateLimitedUntil"
20029
- ]
20030
- }
20011
+ "message": {
20012
+ "type": "string"
20031
20013
  }
20032
20014
  },
20033
20015
  "required": [
20034
- "key",
20035
- "source",
20036
- "readOnly",
20037
- "keys"
20016
+ "success",
20017
+ "message"
20038
20018
  ]
20039
20019
  }
20040
20020
  }
20041
20021
  }
20042
20022
  },
20043
20023
  "400": {
20044
- "description": "Invalid pool variable",
20024
+ "description": "Validation error",
20045
20025
  "content": {
20046
20026
  "application/json": {
20047
20027
  "schema": {
@@ -20050,8 +20030,8 @@
20050
20030
  }
20051
20031
  }
20052
20032
  },
20053
- "403": {
20054
- "description": "Secret read permission required",
20033
+ "401": {
20034
+ "description": "Unauthorized",
20055
20035
  "content": {
20056
20036
  "application/json": {
20057
20037
  "schema": {
@@ -20061,11 +20041,13 @@
20061
20041
  }
20062
20042
  }
20063
20043
  }
20064
- },
20044
+ }
20045
+ },
20046
+ "/api/keys/report-rate-limit": {
20065
20047
  "post": {
20066
- "summary": "Test and append keys to a credential pool",
20048
+ "summary": "Mark an API key as rate-limited",
20067
20049
  "tags": [
20068
- "Config"
20050
+ "API Keys"
20069
20051
  ],
20070
20052
  "security": [
20071
20053
  {
@@ -20078,23 +20060,63 @@
20078
20060
  "schema": {
20079
20061
  "type": "object",
20080
20062
  "properties": {
20081
- "key": {
20063
+ "keyType": {
20082
20064
  "type": "string"
20083
20065
  },
20084
- "value": {
20066
+ "keySuffix": {
20067
+ "type": "string",
20068
+ "minLength": 1,
20069
+ "maxLength": 10
20070
+ },
20071
+ "keyIndex": {
20072
+ "type": "integer",
20073
+ "minimum": 0
20074
+ },
20075
+ "rateLimitedUntil": {
20076
+ "type": "string",
20077
+ "format": "date-time"
20078
+ },
20079
+ "scope": {
20085
20080
  "type": "string"
20086
20081
  },
20087
- "baseUrl": {
20088
- "type": [
20089
- "string",
20090
- "null"
20091
- ],
20092
- "description": "Base URL for the check only. Null tests the provider default. Omit to use the stored URL."
20082
+ "scopeId": {
20083
+ "type": "string"
20084
+ },
20085
+ "spendCap": {
20086
+ "type": "object",
20087
+ "properties": {
20088
+ "limitUsd": {
20089
+ "type": [
20090
+ "number",
20091
+ "null"
20092
+ ]
20093
+ },
20094
+ "spendUsd": {
20095
+ "type": [
20096
+ "number",
20097
+ "null"
20098
+ ]
20099
+ },
20100
+ "resetsAt": {
20101
+ "type": [
20102
+ "string",
20103
+ "null"
20104
+ ],
20105
+ "format": "date-time"
20106
+ }
20107
+ },
20108
+ "required": [
20109
+ "limitUsd",
20110
+ "spendUsd",
20111
+ "resetsAt"
20112
+ ]
20093
20113
  }
20094
20114
  },
20095
20115
  "required": [
20096
- "key",
20097
- "value"
20116
+ "keyType",
20117
+ "keySuffix",
20118
+ "keyIndex",
20119
+ "rateLimitedUntil"
20098
20120
  ]
20099
20121
  }
20100
20122
  }
@@ -20102,127 +20124,32 @@
20102
20124
  },
20103
20125
  "responses": {
20104
20126
  "200": {
20105
- "description": "Updated credential pool and checks",
20127
+ "description": "Key marked as rate-limited",
20106
20128
  "content": {
20107
20129
  "application/json": {
20108
20130
  "schema": {
20109
20131
  "type": "object",
20110
20132
  "properties": {
20111
- "key": {
20112
- "type": "string"
20113
- },
20114
- "source": {
20115
- "type": "string",
20133
+ "success": {
20134
+ "type": "boolean",
20116
20135
  "enum": [
20117
- "stored",
20118
- "env",
20119
- "none"
20136
+ true
20120
20137
  ]
20121
20138
  },
20122
- "readOnly": {
20123
- "type": "boolean"
20124
- },
20125
- "keys": {
20126
- "type": "array",
20127
- "items": {
20128
- "type": "object",
20129
- "properties": {
20130
- "index": {
20131
- "type": "integer",
20132
- "minimum": 0
20133
- },
20134
- "suffix": {
20135
- "type": "string"
20136
- },
20137
- "status": {
20138
- "type": "string",
20139
- "enum": [
20140
- "ok",
20141
- "rejected",
20142
- "rate_limited",
20143
- "unchecked"
20144
- ]
20145
- },
20146
- "error": {
20147
- "type": [
20148
- "string",
20149
- "null"
20150
- ]
20151
- },
20152
- "checkedAt": {
20153
- "type": [
20154
- "string",
20155
- "null"
20156
- ]
20157
- },
20158
- "rateLimitedUntil": {
20159
- "type": [
20160
- "string",
20161
- "null"
20162
- ]
20163
- }
20164
- },
20165
- "required": [
20166
- "index",
20167
- "suffix",
20168
- "status",
20169
- "error",
20170
- "checkedAt",
20171
- "rateLimitedUntil"
20172
- ]
20173
- }
20174
- },
20175
- "checks": {
20176
- "type": "array",
20177
- "items": {
20178
- "type": "object",
20179
- "properties": {
20180
- "suffix": {
20181
- "type": "string"
20182
- },
20183
- "result": {
20184
- "type": "string",
20185
- "enum": [
20186
- "verified",
20187
- "rejected",
20188
- "not_tested"
20189
- ]
20190
- },
20191
- "httpStatus": {
20192
- "type": [
20193
- "number",
20194
- "null"
20195
- ]
20196
- },
20197
- "error": {
20198
- "type": [
20199
- "string",
20200
- "null"
20201
- ]
20202
- }
20203
- },
20204
- "required": [
20205
- "suffix",
20206
- "result",
20207
- "httpStatus",
20208
- "error"
20209
- ]
20210
- }
20139
+ "message": {
20140
+ "type": "string"
20211
20141
  }
20212
20142
  },
20213
20143
  "required": [
20214
- "key",
20215
- "source",
20216
- "readOnly",
20217
- "keys",
20218
- "checks"
20144
+ "success",
20145
+ "message"
20219
20146
  ]
20220
20147
  }
20221
20148
  }
20222
20149
  }
20223
20150
  },
20224
20151
  "400": {
20225
- "description": "Invalid key",
20152
+ "description": "Validation error",
20226
20153
  "content": {
20227
20154
  "application/json": {
20228
20155
  "schema": {
@@ -20231,8 +20158,8 @@
20231
20158
  }
20232
20159
  }
20233
20160
  },
20234
- "403": {
20235
- "description": "Config administration and permission to read all secrets required",
20161
+ "401": {
20162
+ "description": "Unauthorized",
20236
20163
  "content": {
20237
20164
  "application/json": {
20238
20165
  "schema": {
@@ -20240,488 +20167,129 @@
20240
20167
  }
20241
20168
  }
20242
20169
  }
20243
- },
20244
- "409": {
20245
- "description": "Duplicate key or deployment env pool",
20246
- "content": {
20247
- "application/json": {
20248
- "schema": {
20249
- "$ref": "#/components/schemas/ErrorResponse"
20250
- }
20170
+ }
20171
+ }
20172
+ }
20173
+ },
20174
+ "/api/keys/report-validation": {
20175
+ "post": {
20176
+ "summary": "Record live validation results for a credential pool",
20177
+ "tags": [
20178
+ "API Keys"
20179
+ ],
20180
+ "security": [
20181
+ {
20182
+ "bearerAuth": []
20183
+ }
20184
+ ],
20185
+ "requestBody": {
20186
+ "content": {
20187
+ "application/json": {
20188
+ "schema": {
20189
+ "type": "object",
20190
+ "properties": {
20191
+ "keyType": {
20192
+ "type": "string"
20193
+ },
20194
+ "keys": {
20195
+ "type": "array",
20196
+ "items": {
20197
+ "type": "object",
20198
+ "properties": {
20199
+ "keyIndex": {
20200
+ "type": "integer",
20201
+ "minimum": 0
20202
+ },
20203
+ "keySuffix": {
20204
+ "type": "string",
20205
+ "minLength": 1,
20206
+ "maxLength": 10
20207
+ },
20208
+ "ok": {
20209
+ "type": "boolean"
20210
+ },
20211
+ "httpStatus": {
20212
+ "type": "integer"
20213
+ }
20214
+ },
20215
+ "required": [
20216
+ "keyIndex",
20217
+ "keySuffix",
20218
+ "ok"
20219
+ ]
20220
+ },
20221
+ "minItems": 1,
20222
+ "maxItems": 100
20223
+ },
20224
+ "scope": {
20225
+ "type": "string"
20226
+ },
20227
+ "scopeId": {
20228
+ "type": "string"
20229
+ }
20230
+ },
20231
+ "required": [
20232
+ "keyType",
20233
+ "keys"
20234
+ ]
20251
20235
  }
20252
20236
  }
20253
- },
20254
- "422": {
20255
- "description": "Provider rejected a key. Nothing was saved.",
20237
+ }
20238
+ },
20239
+ "responses": {
20240
+ "200": {
20241
+ "description": "Validation recorded",
20256
20242
  "content": {
20257
20243
  "application/json": {
20258
20244
  "schema": {
20259
20245
  "type": "object",
20260
20246
  "properties": {
20261
- "error": {
20262
- "type": "string"
20247
+ "success": {
20248
+ "type": "boolean",
20249
+ "enum": [
20250
+ true
20251
+ ]
20263
20252
  },
20264
- "checks": {
20265
- "type": "array",
20266
- "items": {
20267
- "type": "object",
20268
- "properties": {
20269
- "suffix": {
20270
- "type": "string"
20271
- },
20272
- "result": {
20273
- "type": "string",
20274
- "enum": [
20275
- "verified",
20276
- "rejected",
20277
- "not_tested"
20278
- ]
20279
- },
20280
- "httpStatus": {
20281
- "type": [
20282
- "number",
20283
- "null"
20284
- ]
20285
- },
20286
- "error": {
20287
- "type": [
20288
- "string",
20289
- "null"
20290
- ]
20291
- }
20292
- },
20293
- "required": [
20294
- "suffix",
20295
- "result",
20296
- "httpStatus",
20297
- "error"
20298
- ]
20299
- }
20253
+ "message": {
20254
+ "type": "string"
20300
20255
  }
20301
20256
  },
20302
20257
  "required": [
20303
- "error",
20304
- "checks"
20258
+ "success",
20259
+ "message"
20305
20260
  ]
20306
20261
  }
20307
20262
  }
20308
20263
  }
20264
+ },
20265
+ "400": {
20266
+ "description": "Validation error",
20267
+ "content": {
20268
+ "application/json": {
20269
+ "schema": {
20270
+ "$ref": "#/components/schemas/ErrorResponse"
20271
+ }
20272
+ }
20273
+ }
20274
+ },
20275
+ "401": {
20276
+ "description": "Unauthorized",
20277
+ "content": {
20278
+ "application/json": {
20279
+ "schema": {
20280
+ "$ref": "#/components/schemas/ErrorResponse"
20281
+ }
20282
+ }
20283
+ }
20309
20284
  }
20310
20285
  }
20311
- },
20312
- "delete": {
20313
- "summary": "Remove one credential pool member",
20286
+ }
20287
+ },
20288
+ "/api/keys/report-auth-failure": {
20289
+ "post": {
20290
+ "summary": "Record an auth failure for a pooled key; bench it after 2 in a row",
20314
20291
  "tags": [
20315
- "Config"
20316
- ],
20317
- "security": [
20318
- {
20319
- "bearerAuth": []
20320
- }
20321
- ],
20322
- "parameters": [
20323
- {
20324
- "schema": {
20325
- "type": "string"
20326
- },
20327
- "required": true,
20328
- "name": "key",
20329
- "in": "query"
20330
- },
20331
- {
20332
- "schema": {
20333
- "type": [
20334
- "integer",
20335
- "null"
20336
- ],
20337
- "minimum": 0
20338
- },
20339
- "required": false,
20340
- "name": "index",
20341
- "in": "query"
20342
- },
20343
- {
20344
- "schema": {
20345
- "type": "string",
20346
- "minLength": 1,
20347
- "maxLength": 5
20348
- },
20349
- "required": true,
20350
- "name": "suffix",
20351
- "in": "query"
20352
- }
20353
- ],
20354
- "responses": {
20355
- "200": {
20356
- "description": "Updated credential pool",
20357
- "content": {
20358
- "application/json": {
20359
- "schema": {
20360
- "type": "object",
20361
- "properties": {
20362
- "key": {
20363
- "type": "string"
20364
- },
20365
- "source": {
20366
- "type": "string",
20367
- "enum": [
20368
- "stored",
20369
- "env",
20370
- "none"
20371
- ]
20372
- },
20373
- "readOnly": {
20374
- "type": "boolean"
20375
- },
20376
- "keys": {
20377
- "type": "array",
20378
- "items": {
20379
- "type": "object",
20380
- "properties": {
20381
- "index": {
20382
- "type": "integer",
20383
- "minimum": 0
20384
- },
20385
- "suffix": {
20386
- "type": "string"
20387
- },
20388
- "status": {
20389
- "type": "string",
20390
- "enum": [
20391
- "ok",
20392
- "rejected",
20393
- "rate_limited",
20394
- "unchecked"
20395
- ]
20396
- },
20397
- "error": {
20398
- "type": [
20399
- "string",
20400
- "null"
20401
- ]
20402
- },
20403
- "checkedAt": {
20404
- "type": [
20405
- "string",
20406
- "null"
20407
- ]
20408
- },
20409
- "rateLimitedUntil": {
20410
- "type": [
20411
- "string",
20412
- "null"
20413
- ]
20414
- }
20415
- },
20416
- "required": [
20417
- "index",
20418
- "suffix",
20419
- "status",
20420
- "error",
20421
- "checkedAt",
20422
- "rateLimitedUntil"
20423
- ]
20424
- }
20425
- }
20426
- },
20427
- "required": [
20428
- "key",
20429
- "source",
20430
- "readOnly",
20431
- "keys"
20432
- ]
20433
- }
20434
- }
20435
- }
20436
- },
20437
- "400": {
20438
- "description": "Invalid pool member",
20439
- "content": {
20440
- "application/json": {
20441
- "schema": {
20442
- "$ref": "#/components/schemas/ErrorResponse"
20443
- }
20444
- }
20445
- }
20446
- },
20447
- "403": {
20448
- "description": "Config administration and permission to read all secrets required",
20449
- "content": {
20450
- "application/json": {
20451
- "schema": {
20452
- "$ref": "#/components/schemas/ErrorResponse"
20453
- }
20454
- }
20455
- }
20456
- },
20457
- "409": {
20458
- "description": "The pool changed or comes from the deployment env",
20459
- "content": {
20460
- "application/json": {
20461
- "schema": {
20462
- "$ref": "#/components/schemas/ErrorResponse"
20463
- }
20464
- }
20465
- }
20466
- }
20467
- }
20468
- }
20469
- },
20470
- "/api/tasks/{id}/context": {
20471
- "post": {
20472
- "summary": "Record a context usage snapshot for a task",
20473
- "tags": [
20474
- "Tasks"
20475
- ],
20476
- "security": [
20477
- {
20478
- "bearerAuth": []
20479
- }
20480
- ],
20481
- "parameters": [
20482
- {
20483
- "schema": {
20484
- "type": "string"
20485
- },
20486
- "required": true,
20487
- "name": "id",
20488
- "in": "path"
20489
- }
20490
- ],
20491
- "requestBody": {
20492
- "content": {
20493
- "application/json": {
20494
- "schema": {
20495
- "type": "object",
20496
- "properties": {
20497
- "eventType": {
20498
- "type": "string",
20499
- "enum": [
20500
- "progress",
20501
- "compaction",
20502
- "completion"
20503
- ]
20504
- },
20505
- "sessionId": {
20506
- "type": "string"
20507
- },
20508
- "contextUsedTokens": {
20509
- "type": "integer",
20510
- "minimum": 0
20511
- },
20512
- "contextTotalTokens": {
20513
- "type": "integer",
20514
- "minimum": 0
20515
- },
20516
- "contextPercent": {
20517
- "type": "number",
20518
- "minimum": 0,
20519
- "maximum": 100
20520
- },
20521
- "compactTrigger": {
20522
- "type": "string",
20523
- "enum": [
20524
- "auto",
20525
- "manual",
20526
- "auto-inferred"
20527
- ]
20528
- },
20529
- "preCompactTokens": {
20530
- "type": "integer",
20531
- "minimum": 0
20532
- },
20533
- "cumulativeInputTokens": {
20534
- "type": "integer",
20535
- "minimum": 0
20536
- },
20537
- "cumulativeOutputTokens": {
20538
- "type": "integer",
20539
- "minimum": 0
20540
- },
20541
- "contextFormula": {
20542
- "type": "string",
20543
- "enum": [
20544
- "input-cache-output",
20545
- "input-cache-no-output",
20546
- "input-output-no-cache",
20547
- "peak-proxy",
20548
- "pi-delegated",
20549
- "harness-reported",
20550
- "unknown"
20551
- ]
20552
- }
20553
- },
20554
- "required": [
20555
- "eventType",
20556
- "sessionId"
20557
- ]
20558
- }
20559
- }
20560
- }
20561
- },
20562
- "responses": {
20563
- "200": {
20564
- "description": "Snapshot recorded",
20565
- "content": {
20566
- "application/json": {
20567
- "schema": {
20568
- "type": "object",
20569
- "properties": {
20570
- "ok": {
20571
- "type": "boolean",
20572
- "enum": [
20573
- true
20574
- ]
20575
- },
20576
- "snapshotId": {
20577
- "type": "string",
20578
- "format": "uuid"
20579
- }
20580
- },
20581
- "required": [
20582
- "ok",
20583
- "snapshotId"
20584
- ]
20585
- }
20586
- }
20587
- }
20588
- },
20589
- "400": {
20590
- "description": "Validation error",
20591
- "content": {
20592
- "application/json": {
20593
- "schema": {
20594
- "$ref": "#/components/schemas/ErrorResponse"
20595
- }
20596
- }
20597
- }
20598
- },
20599
- "404": {
20600
- "description": "Task not found",
20601
- "content": {
20602
- "application/json": {
20603
- "schema": {
20604
- "$ref": "#/components/schemas/ErrorResponse"
20605
- }
20606
- }
20607
- }
20608
- }
20609
- }
20610
- },
20611
- "get": {
20612
- "summary": "Get context usage history for a task",
20613
- "tags": [
20614
- "Tasks"
20615
- ],
20616
- "security": [
20617
- {
20618
- "bearerAuth": []
20619
- }
20620
- ],
20621
- "parameters": [
20622
- {
20623
- "schema": {
20624
- "type": "string"
20625
- },
20626
- "required": true,
20627
- "name": "id",
20628
- "in": "path"
20629
- },
20630
- {
20631
- "schema": {
20632
- "type": "integer",
20633
- "minimum": 1,
20634
- "maximum": 500,
20635
- "default": 100
20636
- },
20637
- "required": false,
20638
- "name": "limit",
20639
- "in": "query"
20640
- }
20641
- ],
20642
- "responses": {
20643
- "200": {
20644
- "description": "Context snapshot history",
20645
- "content": {
20646
- "application/json": {
20647
- "schema": {
20648
- "type": "object",
20649
- "properties": {
20650
- "snapshots": {
20651
- "type": "array",
20652
- "items": {
20653
- "$ref": "#/components/schemas/ContextSnapshot"
20654
- }
20655
- },
20656
- "summary": {
20657
- "type": "object",
20658
- "properties": {
20659
- "compactionCount": {
20660
- "type": "integer",
20661
- "minimum": 0
20662
- },
20663
- "peakContextPercent": {
20664
- "type": [
20665
- "number",
20666
- "null"
20667
- ],
20668
- "minimum": 0,
20669
- "maximum": 100
20670
- },
20671
- "peakContextTokens": {
20672
- "type": [
20673
- "integer",
20674
- "null"
20675
- ],
20676
- "minimum": 0
20677
- },
20678
- "contextWindowSize": {
20679
- "type": [
20680
- "integer",
20681
- "null"
20682
- ],
20683
- "minimum": 0
20684
- },
20685
- "snapshotCount": {
20686
- "type": "integer",
20687
- "minimum": 0
20688
- }
20689
- },
20690
- "required": [
20691
- "compactionCount",
20692
- "peakContextPercent",
20693
- "peakContextTokens",
20694
- "contextWindowSize",
20695
- "snapshotCount"
20696
- ]
20697
- }
20698
- },
20699
- "required": [
20700
- "snapshots",
20701
- "summary"
20702
- ]
20703
- }
20704
- }
20705
- }
20706
- },
20707
- "404": {
20708
- "description": "Task not found",
20709
- "content": {
20710
- "application/json": {
20711
- "schema": {
20712
- "$ref": "#/components/schemas/ErrorResponse"
20713
- }
20714
- }
20715
- }
20716
- }
20717
- }
20718
- }
20719
- },
20720
- "/api/keys/report-usage": {
20721
- "post": {
20722
- "summary": "Record which API key was used for a task",
20723
- "tags": [
20724
- "API Keys"
20292
+ "API Keys"
20725
20293
  ],
20726
20294
  "security": [
20727
20295
  {
@@ -20755,15 +20323,6 @@
20755
20323
  },
20756
20324
  "scopeId": {
20757
20325
  "type": "string"
20758
- },
20759
- "plan": {
20760
- "type": "string",
20761
- "maxLength": 40
20762
- },
20763
- "planRaw": {
20764
- "type": "string",
20765
- "minLength": 1,
20766
- "maxLength": 80
20767
20326
  }
20768
20327
  },
20769
20328
  "required": [
@@ -20777,7 +20336,7 @@
20777
20336
  },
20778
20337
  "responses": {
20779
20338
  "200": {
20780
- "description": "Usage recorded",
20339
+ "description": "Failure recorded",
20781
20340
  "content": {
20782
20341
  "application/json": {
20783
20342
  "schema": {
@@ -20789,13 +20348,24 @@
20789
20348
  true
20790
20349
  ]
20791
20350
  },
20792
- "message": {
20793
- "type": "string"
20351
+ "consecutiveAuthFailures": {
20352
+ "type": "integer"
20353
+ },
20354
+ "benched": {
20355
+ "type": "boolean"
20356
+ },
20357
+ "rateLimitedUntil": {
20358
+ "type": [
20359
+ "string",
20360
+ "null"
20361
+ ]
20794
20362
  }
20795
20363
  },
20796
20364
  "required": [
20797
20365
  "success",
20798
- "message"
20366
+ "consecutiveAuthFailures",
20367
+ "benched",
20368
+ "rateLimitedUntil"
20799
20369
  ]
20800
20370
  }
20801
20371
  }
@@ -20824,9 +20394,10 @@
20824
20394
  }
20825
20395
  }
20826
20396
  },
20827
- "/api/keys/report-rate-limit": {
20397
+ "/api/keys/report-rate-limit-windows": {
20828
20398
  "post": {
20829
- "summary": "Mark an API key as rate-limited",
20399
+ "summary": "Record provider-emitted rate-limit window telemetry for an API key",
20400
+ "description": "Reports accept up to 64 windows and 64 account limits within 256 KiB. Stored records have the same count limits.",
20830
20401
  "tags": [
20831
20402
  "API Keys"
20832
20403
  ],
@@ -20853,337 +20424,14 @@
20853
20424
  "type": "integer",
20854
20425
  "minimum": 0
20855
20426
  },
20856
- "rateLimitedUntil": {
20857
- "type": "string",
20858
- "format": "date-time"
20859
- },
20860
- "scope": {
20861
- "type": "string"
20862
- },
20863
- "scopeId": {
20864
- "type": "string"
20865
- }
20866
- },
20867
- "required": [
20868
- "keyType",
20869
- "keySuffix",
20870
- "keyIndex",
20871
- "rateLimitedUntil"
20872
- ]
20873
- }
20874
- }
20875
- }
20876
- },
20877
- "responses": {
20878
- "200": {
20879
- "description": "Key marked as rate-limited",
20880
- "content": {
20881
- "application/json": {
20882
- "schema": {
20883
- "type": "object",
20884
- "properties": {
20885
- "success": {
20886
- "type": "boolean",
20887
- "enum": [
20888
- true
20889
- ]
20890
- },
20891
- "message": {
20892
- "type": "string"
20893
- }
20894
- },
20895
- "required": [
20896
- "success",
20897
- "message"
20898
- ]
20899
- }
20900
- }
20901
- }
20902
- },
20903
- "400": {
20904
- "description": "Validation error",
20905
- "content": {
20906
- "application/json": {
20907
- "schema": {
20908
- "$ref": "#/components/schemas/ErrorResponse"
20909
- }
20910
- }
20911
- }
20912
- },
20913
- "401": {
20914
- "description": "Unauthorized",
20915
- "content": {
20916
- "application/json": {
20917
- "schema": {
20918
- "$ref": "#/components/schemas/ErrorResponse"
20919
- }
20920
- }
20921
- }
20922
- }
20923
- }
20924
- }
20925
- },
20926
- "/api/keys/report-validation": {
20927
- "post": {
20928
- "summary": "Record live validation results for a credential pool",
20929
- "tags": [
20930
- "API Keys"
20931
- ],
20932
- "security": [
20933
- {
20934
- "bearerAuth": []
20935
- }
20936
- ],
20937
- "requestBody": {
20938
- "content": {
20939
- "application/json": {
20940
- "schema": {
20941
- "type": "object",
20942
- "properties": {
20943
- "keyType": {
20944
- "type": "string"
20945
- },
20946
- "keys": {
20947
- "type": "array",
20948
- "items": {
20427
+ "windows": {
20428
+ "type": "object",
20429
+ "additionalProperties": {
20949
20430
  "type": "object",
20950
20431
  "properties": {
20951
- "keyIndex": {
20952
- "type": "integer",
20953
- "minimum": 0
20954
- },
20955
- "keySuffix": {
20432
+ "status": {
20956
20433
  "type": "string",
20957
- "minLength": 1,
20958
- "maxLength": 10
20959
- },
20960
- "ok": {
20961
- "type": "boolean"
20962
- },
20963
- "httpStatus": {
20964
- "type": "integer"
20965
- }
20966
- },
20967
- "required": [
20968
- "keyIndex",
20969
- "keySuffix",
20970
- "ok"
20971
- ]
20972
- },
20973
- "minItems": 1,
20974
- "maxItems": 100
20975
- },
20976
- "scope": {
20977
- "type": "string"
20978
- },
20979
- "scopeId": {
20980
- "type": "string"
20981
- }
20982
- },
20983
- "required": [
20984
- "keyType",
20985
- "keys"
20986
- ]
20987
- }
20988
- }
20989
- }
20990
- },
20991
- "responses": {
20992
- "200": {
20993
- "description": "Validation recorded",
20994
- "content": {
20995
- "application/json": {
20996
- "schema": {
20997
- "type": "object",
20998
- "properties": {
20999
- "success": {
21000
- "type": "boolean",
21001
- "enum": [
21002
- true
21003
- ]
21004
- },
21005
- "message": {
21006
- "type": "string"
21007
- }
21008
- },
21009
- "required": [
21010
- "success",
21011
- "message"
21012
- ]
21013
- }
21014
- }
21015
- }
21016
- },
21017
- "400": {
21018
- "description": "Validation error",
21019
- "content": {
21020
- "application/json": {
21021
- "schema": {
21022
- "$ref": "#/components/schemas/ErrorResponse"
21023
- }
21024
- }
21025
- }
21026
- },
21027
- "401": {
21028
- "description": "Unauthorized",
21029
- "content": {
21030
- "application/json": {
21031
- "schema": {
21032
- "$ref": "#/components/schemas/ErrorResponse"
21033
- }
21034
- }
21035
- }
21036
- }
21037
- }
21038
- }
21039
- },
21040
- "/api/keys/report-auth-failure": {
21041
- "post": {
21042
- "summary": "Record an auth failure for a pooled key; bench it after 2 in a row",
21043
- "tags": [
21044
- "API Keys"
21045
- ],
21046
- "security": [
21047
- {
21048
- "bearerAuth": []
21049
- }
21050
- ],
21051
- "requestBody": {
21052
- "content": {
21053
- "application/json": {
21054
- "schema": {
21055
- "type": "object",
21056
- "properties": {
21057
- "keyType": {
21058
- "type": "string"
21059
- },
21060
- "keySuffix": {
21061
- "type": "string",
21062
- "minLength": 1,
21063
- "maxLength": 10
21064
- },
21065
- "keyIndex": {
21066
- "type": "integer",
21067
- "minimum": 0
21068
- },
21069
- "taskId": {
21070
- "type": "string",
21071
- "format": "uuid"
21072
- },
21073
- "scope": {
21074
- "type": "string"
21075
- },
21076
- "scopeId": {
21077
- "type": "string"
21078
- }
21079
- },
21080
- "required": [
21081
- "keyType",
21082
- "keySuffix",
21083
- "keyIndex"
21084
- ]
21085
- }
21086
- }
21087
- }
21088
- },
21089
- "responses": {
21090
- "200": {
21091
- "description": "Failure recorded",
21092
- "content": {
21093
- "application/json": {
21094
- "schema": {
21095
- "type": "object",
21096
- "properties": {
21097
- "success": {
21098
- "type": "boolean",
21099
- "enum": [
21100
- true
21101
- ]
21102
- },
21103
- "consecutiveAuthFailures": {
21104
- "type": "integer"
21105
- },
21106
- "benched": {
21107
- "type": "boolean"
21108
- },
21109
- "rateLimitedUntil": {
21110
- "type": [
21111
- "string",
21112
- "null"
21113
- ]
21114
- }
21115
- },
21116
- "required": [
21117
- "success",
21118
- "consecutiveAuthFailures",
21119
- "benched",
21120
- "rateLimitedUntil"
21121
- ]
21122
- }
21123
- }
21124
- }
21125
- },
21126
- "400": {
21127
- "description": "Validation error",
21128
- "content": {
21129
- "application/json": {
21130
- "schema": {
21131
- "$ref": "#/components/schemas/ErrorResponse"
21132
- }
21133
- }
21134
- }
21135
- },
21136
- "401": {
21137
- "description": "Unauthorized",
21138
- "content": {
21139
- "application/json": {
21140
- "schema": {
21141
- "$ref": "#/components/schemas/ErrorResponse"
21142
- }
21143
- }
21144
- }
21145
- }
21146
- }
21147
- }
21148
- },
21149
- "/api/keys/report-rate-limit-windows": {
21150
- "post": {
21151
- "summary": "Record provider-emitted rate-limit window telemetry for an API key",
21152
- "description": "Reports accept up to 64 windows and 64 account limits within 256 KiB. Stored records have the same count limits.",
21153
- "tags": [
21154
- "API Keys"
21155
- ],
21156
- "security": [
21157
- {
21158
- "bearerAuth": []
21159
- }
21160
- ],
21161
- "requestBody": {
21162
- "content": {
21163
- "application/json": {
21164
- "schema": {
21165
- "type": "object",
21166
- "properties": {
21167
- "keyType": {
21168
- "type": "string"
21169
- },
21170
- "keySuffix": {
21171
- "type": "string",
21172
- "minLength": 1,
21173
- "maxLength": 10
21174
- },
21175
- "keyIndex": {
21176
- "type": "integer",
21177
- "minimum": 0
21178
- },
21179
- "windows": {
21180
- "type": "object",
21181
- "additionalProperties": {
21182
- "type": "object",
21183
- "properties": {
21184
- "status": {
21185
- "type": "string",
21186
- "maxLength": 256
20434
+ "maxLength": 256
21187
20435
  },
21188
20436
  "utilization": {
21189
20437
  "type": "number"
@@ -21803,6 +21051,12 @@
21803
21051
  "type": "integer"
21804
21052
  }
21805
21053
  },
21054
+ "spendCappedIndices": {
21055
+ "type": "array",
21056
+ "items": {
21057
+ "type": "integer"
21058
+ }
21059
+ },
21806
21060
  "authFailureFence": {
21807
21061
  "type": "integer"
21808
21062
  }
@@ -21811,6 +21065,7 @@
21811
21065
  "success",
21812
21066
  "availableIndices",
21813
21067
  "totalKeys",
21068
+ "spendCappedIndices",
21814
21069
  "authFailureFence"
21815
21070
  ]
21816
21071
  }
@@ -21926,6 +21181,38 @@
21926
21181
  "null"
21927
21182
  ]
21928
21183
  },
21184
+ "spendCap": {
21185
+ "type": [
21186
+ "object",
21187
+ "null"
21188
+ ],
21189
+ "properties": {
21190
+ "limitUsd": {
21191
+ "type": [
21192
+ "number",
21193
+ "null"
21194
+ ]
21195
+ },
21196
+ "spendUsd": {
21197
+ "type": [
21198
+ "number",
21199
+ "null"
21200
+ ]
21201
+ },
21202
+ "resetsAt": {
21203
+ "type": [
21204
+ "string",
21205
+ "null"
21206
+ ],
21207
+ "format": "date-time"
21208
+ }
21209
+ },
21210
+ "required": [
21211
+ "limitUsd",
21212
+ "spendUsd",
21213
+ "resetsAt"
21214
+ ]
21215
+ },
21929
21216
  "lastUsedAt": {
21930
21217
  "type": [
21931
21218
  "string",
@@ -22348,6 +21635,7 @@
22348
21635
  "scopeId",
22349
21636
  "status",
22350
21637
  "rateLimitedUntil",
21638
+ "spendCap",
22351
21639
  "lastUsedAt",
22352
21640
  "lastRateLimitAt",
22353
21641
  "totalUsageCount",
@@ -22380,8 +21668,1073 @@
22380
21668
  }
22381
21669
  }
22382
21670
  },
22383
- "401": {
22384
- "description": "Unauthorized",
21671
+ "401": {
21672
+ "description": "Unauthorized",
21673
+ "content": {
21674
+ "application/json": {
21675
+ "schema": {
21676
+ "$ref": "#/components/schemas/ErrorResponse"
21677
+ }
21678
+ }
21679
+ }
21680
+ }
21681
+ }
21682
+ }
21683
+ },
21684
+ "/api/keys/window-usage": {
21685
+ "get": {
21686
+ "summary": "Get Swarm-observed usage within current provider windows",
21687
+ "description": "Usage calculations support 256 windows, 16 distinct windows per credential, 90 days, and 100,000 session rows. Oversized requests fail without partial totals.",
21688
+ "tags": [
21689
+ "API Keys"
21690
+ ],
21691
+ "security": [
21692
+ {
21693
+ "bearerAuth": []
21694
+ }
21695
+ ],
21696
+ "parameters": [
21697
+ {
21698
+ "schema": {
21699
+ "type": "string",
21700
+ "maxLength": 128
21701
+ },
21702
+ "required": false,
21703
+ "name": "keyType",
21704
+ "in": "query"
21705
+ },
21706
+ {
21707
+ "schema": {
21708
+ "type": "string",
21709
+ "minLength": 1,
21710
+ "maxLength": 10
21711
+ },
21712
+ "required": false,
21713
+ "name": "keySuffix",
21714
+ "in": "query"
21715
+ },
21716
+ {
21717
+ "schema": {
21718
+ "type": "string",
21719
+ "maxLength": 64
21720
+ },
21721
+ "required": false,
21722
+ "name": "scope",
21723
+ "in": "query"
21724
+ },
21725
+ {
21726
+ "schema": {
21727
+ "type": "string",
21728
+ "maxLength": 128
21729
+ },
21730
+ "required": false,
21731
+ "name": "scopeId",
21732
+ "in": "query"
21733
+ }
21734
+ ],
21735
+ "responses": {
21736
+ "200": {
21737
+ "description": "Independent windows with receipt-time tokens and explicit measurement coverage",
21738
+ "content": {
21739
+ "application/json": {
21740
+ "schema": {
21741
+ "type": "object",
21742
+ "properties": {
21743
+ "success": {
21744
+ "type": "boolean",
21745
+ "enum": [
21746
+ true
21747
+ ]
21748
+ },
21749
+ "asOf": {
21750
+ "type": "string"
21751
+ },
21752
+ "accounting": {
21753
+ "type": "string",
21754
+ "enum": [
21755
+ "session_cost_receipt_time"
21756
+ ]
21757
+ },
21758
+ "windows": {
21759
+ "type": "array",
21760
+ "items": {
21761
+ "type": "object",
21762
+ "properties": {
21763
+ "statusId": {
21764
+ "type": "string"
21765
+ },
21766
+ "keyType": {
21767
+ "type": "string"
21768
+ },
21769
+ "keySuffix": {
21770
+ "type": "string"
21771
+ },
21772
+ "scope": {
21773
+ "type": "string"
21774
+ },
21775
+ "scopeId": {
21776
+ "type": [
21777
+ "string",
21778
+ "null"
21779
+ ]
21780
+ },
21781
+ "windowKey": {
21782
+ "type": "string"
21783
+ },
21784
+ "durationMins": {
21785
+ "type": [
21786
+ "number",
21787
+ "null"
21788
+ ]
21789
+ },
21790
+ "startsAt": {
21791
+ "type": [
21792
+ "string",
21793
+ "null"
21794
+ ]
21795
+ },
21796
+ "endsAt": {
21797
+ "type": [
21798
+ "string",
21799
+ "null"
21800
+ ]
21801
+ },
21802
+ "dataThrough": {
21803
+ "type": "string"
21804
+ },
21805
+ "observedAt": {
21806
+ "type": "string"
21807
+ },
21808
+ "observationAgeMs": {
21809
+ "type": "number"
21810
+ },
21811
+ "modelScope": {
21812
+ "type": "object",
21813
+ "properties": {
21814
+ "kind": {
21815
+ "type": "string",
21816
+ "enum": [
21817
+ "account",
21818
+ "family",
21819
+ "unknown"
21820
+ ]
21821
+ },
21822
+ "model": {
21823
+ "type": [
21824
+ "string",
21825
+ "null"
21826
+ ]
21827
+ }
21828
+ },
21829
+ "required": [
21830
+ "kind",
21831
+ "model"
21832
+ ]
21833
+ },
21834
+ "unavailableReason": {
21835
+ "type": [
21836
+ "string",
21837
+ "null"
21838
+ ],
21839
+ "enum": [
21840
+ "missing_reset",
21841
+ "unknown_duration",
21842
+ "unknown_model_scope",
21843
+ "window_not_started",
21844
+ null
21845
+ ]
21846
+ },
21847
+ "usage": {
21848
+ "type": [
21849
+ "object",
21850
+ "null"
21851
+ ],
21852
+ "properties": {
21853
+ "sessions": {
21854
+ "type": "integer"
21855
+ },
21856
+ "errorSessions": {
21857
+ "type": "integer"
21858
+ },
21859
+ "completedTasks": {
21860
+ "type": "integer"
21861
+ },
21862
+ "tokens": {
21863
+ "type": "object",
21864
+ "properties": {
21865
+ "uncachedInput": {
21866
+ "type": "object",
21867
+ "properties": {
21868
+ "value": {
21869
+ "type": [
21870
+ "number",
21871
+ "null"
21872
+ ]
21873
+ },
21874
+ "measuredSessions": {
21875
+ "type": "integer"
21876
+ },
21877
+ "missingSessions": {
21878
+ "type": "integer"
21879
+ }
21880
+ },
21881
+ "required": [
21882
+ "value",
21883
+ "measuredSessions",
21884
+ "missingSessions"
21885
+ ]
21886
+ },
21887
+ "output": {
21888
+ "type": "object",
21889
+ "properties": {
21890
+ "value": {
21891
+ "type": [
21892
+ "number",
21893
+ "null"
21894
+ ]
21895
+ },
21896
+ "measuredSessions": {
21897
+ "type": "integer"
21898
+ },
21899
+ "missingSessions": {
21900
+ "type": "integer"
21901
+ }
21902
+ },
21903
+ "required": [
21904
+ "value",
21905
+ "measuredSessions",
21906
+ "missingSessions"
21907
+ ]
21908
+ },
21909
+ "cacheRead": {
21910
+ "type": "object",
21911
+ "properties": {
21912
+ "value": {
21913
+ "type": [
21914
+ "number",
21915
+ "null"
21916
+ ]
21917
+ },
21918
+ "measuredSessions": {
21919
+ "type": "integer"
21920
+ },
21921
+ "missingSessions": {
21922
+ "type": "integer"
21923
+ }
21924
+ },
21925
+ "required": [
21926
+ "value",
21927
+ "measuredSessions",
21928
+ "missingSessions"
21929
+ ]
21930
+ },
21931
+ "cacheWrite": {
21932
+ "type": "object",
21933
+ "properties": {
21934
+ "value": {
21935
+ "type": [
21936
+ "number",
21937
+ "null"
21938
+ ]
21939
+ },
21940
+ "measuredSessions": {
21941
+ "type": "integer"
21942
+ },
21943
+ "missingSessions": {
21944
+ "type": "integer"
21945
+ }
21946
+ },
21947
+ "required": [
21948
+ "value",
21949
+ "measuredSessions",
21950
+ "missingSessions"
21951
+ ]
21952
+ },
21953
+ "reasoning": {
21954
+ "type": "object",
21955
+ "properties": {
21956
+ "value": {
21957
+ "type": [
21958
+ "number",
21959
+ "null"
21960
+ ]
21961
+ },
21962
+ "measuredSessions": {
21963
+ "type": "integer"
21964
+ },
21965
+ "missingSessions": {
21966
+ "type": "integer"
21967
+ }
21968
+ },
21969
+ "required": [
21970
+ "value",
21971
+ "measuredSessions",
21972
+ "missingSessions"
21973
+ ]
21974
+ },
21975
+ "thinking": {
21976
+ "type": "object",
21977
+ "properties": {
21978
+ "value": {
21979
+ "type": [
21980
+ "number",
21981
+ "null"
21982
+ ]
21983
+ },
21984
+ "measuredSessions": {
21985
+ "type": "integer"
21986
+ },
21987
+ "missingSessions": {
21988
+ "type": "integer"
21989
+ }
21990
+ },
21991
+ "required": [
21992
+ "value",
21993
+ "measuredSessions",
21994
+ "missingSessions"
21995
+ ]
21996
+ }
21997
+ },
21998
+ "required": [
21999
+ "uncachedInput",
22000
+ "output",
22001
+ "cacheRead",
22002
+ "cacheWrite",
22003
+ "reasoning",
22004
+ "thinking"
22005
+ ]
22006
+ },
22007
+ "modelUnattributedSessions": {
22008
+ "type": "integer"
22009
+ },
22010
+ "swarmUnattributedSessions": {
22011
+ "type": "integer"
22012
+ }
22013
+ },
22014
+ "required": [
22015
+ "sessions",
22016
+ "errorSessions",
22017
+ "completedTasks",
22018
+ "tokens",
22019
+ "modelUnattributedSessions",
22020
+ "swarmUnattributedSessions"
22021
+ ]
22022
+ }
22023
+ },
22024
+ "required": [
22025
+ "statusId",
22026
+ "keyType",
22027
+ "keySuffix",
22028
+ "scope",
22029
+ "scopeId",
22030
+ "windowKey",
22031
+ "durationMins",
22032
+ "startsAt",
22033
+ "endsAt",
22034
+ "dataThrough",
22035
+ "observedAt",
22036
+ "observationAgeMs",
22037
+ "modelScope",
22038
+ "unavailableReason",
22039
+ "usage"
22040
+ ]
22041
+ }
22042
+ }
22043
+ },
22044
+ "required": [
22045
+ "success",
22046
+ "asOf",
22047
+ "accounting",
22048
+ "windows"
22049
+ ]
22050
+ }
22051
+ }
22052
+ }
22053
+ },
22054
+ "400": {
22055
+ "description": "Invalid filters",
22056
+ "content": {
22057
+ "application/json": {
22058
+ "schema": {
22059
+ "$ref": "#/components/schemas/ErrorResponse"
22060
+ }
22061
+ }
22062
+ }
22063
+ },
22064
+ "401": {
22065
+ "description": "Unauthorized",
22066
+ "content": {
22067
+ "application/json": {
22068
+ "schema": {
22069
+ "$ref": "#/components/schemas/ErrorResponse"
22070
+ }
22071
+ }
22072
+ }
22073
+ },
22074
+ "422": {
22075
+ "description": "Requested usage exceeds the aggregation bounds",
22076
+ "content": {
22077
+ "application/json": {
22078
+ "schema": {
22079
+ "$ref": "#/components/schemas/ErrorResponse"
22080
+ }
22081
+ }
22082
+ }
22083
+ },
22084
+ "429": {
22085
+ "description": "Usage query budget exhausted. Retry after one second",
22086
+ "content": {
22087
+ "application/json": {
22088
+ "schema": {
22089
+ "$ref": "#/components/schemas/ErrorResponse"
22090
+ }
22091
+ }
22092
+ }
22093
+ }
22094
+ }
22095
+ }
22096
+ },
22097
+ "/api/keys/costs": {
22098
+ "get": {
22099
+ "summary": "Get aggregated cost data per API key",
22100
+ "tags": [
22101
+ "API Keys"
22102
+ ],
22103
+ "security": [
22104
+ {
22105
+ "bearerAuth": []
22106
+ }
22107
+ ],
22108
+ "parameters": [
22109
+ {
22110
+ "schema": {
22111
+ "type": "string"
22112
+ },
22113
+ "required": false,
22114
+ "name": "keyType",
22115
+ "in": "query"
22116
+ }
22117
+ ],
22118
+ "responses": {
22119
+ "200": {
22120
+ "description": "Per-key cost aggregation",
22121
+ "content": {
22122
+ "application/json": {
22123
+ "schema": {
22124
+ "type": "object",
22125
+ "properties": {
22126
+ "success": {
22127
+ "type": "boolean",
22128
+ "enum": [
22129
+ true
22130
+ ]
22131
+ },
22132
+ "costs": {
22133
+ "type": "array",
22134
+ "items": {
22135
+ "type": "object",
22136
+ "properties": {
22137
+ "keyType": {
22138
+ "type": "string"
22139
+ },
22140
+ "keySuffix": {
22141
+ "type": "string"
22142
+ },
22143
+ "totalCost": {
22144
+ "type": "number",
22145
+ "minimum": 0
22146
+ },
22147
+ "totalInputTokens": {
22148
+ "type": "integer",
22149
+ "minimum": 0
22150
+ },
22151
+ "totalOutputTokens": {
22152
+ "type": "integer",
22153
+ "minimum": 0
22154
+ },
22155
+ "taskCount": {
22156
+ "type": "integer",
22157
+ "minimum": 0
22158
+ }
22159
+ },
22160
+ "required": [
22161
+ "keyType",
22162
+ "keySuffix",
22163
+ "totalCost",
22164
+ "totalInputTokens",
22165
+ "totalOutputTokens",
22166
+ "taskCount"
22167
+ ]
22168
+ }
22169
+ }
22170
+ },
22171
+ "required": [
22172
+ "success",
22173
+ "costs"
22174
+ ]
22175
+ }
22176
+ }
22177
+ }
22178
+ },
22179
+ "401": {
22180
+ "description": "Unauthorized",
22181
+ "content": {
22182
+ "application/json": {
22183
+ "schema": {
22184
+ "$ref": "#/components/schemas/ErrorResponse"
22185
+ }
22186
+ }
22187
+ }
22188
+ }
22189
+ }
22190
+ }
22191
+ },
22192
+ "/api/keys/name": {
22193
+ "patch": {
22194
+ "summary": "Set or clear the human-friendly label on a pooled credential",
22195
+ "tags": [
22196
+ "API Keys"
22197
+ ],
22198
+ "security": [
22199
+ {
22200
+ "bearerAuth": []
22201
+ }
22202
+ ],
22203
+ "requestBody": {
22204
+ "content": {
22205
+ "application/json": {
22206
+ "schema": {
22207
+ "type": "object",
22208
+ "properties": {
22209
+ "keyType": {
22210
+ "type": "string",
22211
+ "minLength": 1
22212
+ },
22213
+ "keySuffix": {
22214
+ "type": "string",
22215
+ "minLength": 1,
22216
+ "maxLength": 10
22217
+ },
22218
+ "name": {
22219
+ "type": [
22220
+ "string",
22221
+ "null"
22222
+ ],
22223
+ "maxLength": 60
22224
+ },
22225
+ "scope": {
22226
+ "type": "string"
22227
+ },
22228
+ "scopeId": {
22229
+ "type": "string"
22230
+ }
22231
+ },
22232
+ "required": [
22233
+ "keyType",
22234
+ "keySuffix",
22235
+ "name"
22236
+ ]
22237
+ }
22238
+ }
22239
+ }
22240
+ },
22241
+ "responses": {
22242
+ "200": {
22243
+ "description": "Name updated",
22244
+ "content": {
22245
+ "application/json": {
22246
+ "schema": {
22247
+ "type": "object",
22248
+ "properties": {
22249
+ "success": {
22250
+ "type": "boolean",
22251
+ "enum": [
22252
+ true
22253
+ ]
22254
+ },
22255
+ "keyType": {
22256
+ "type": "string"
22257
+ },
22258
+ "keySuffix": {
22259
+ "type": "string"
22260
+ },
22261
+ "name": {
22262
+ "type": [
22263
+ "string",
22264
+ "null"
22265
+ ]
22266
+ }
22267
+ },
22268
+ "required": [
22269
+ "success",
22270
+ "keyType",
22271
+ "keySuffix",
22272
+ "name"
22273
+ ]
22274
+ }
22275
+ }
22276
+ }
22277
+ },
22278
+ "400": {
22279
+ "description": "Validation error",
22280
+ "content": {
22281
+ "application/json": {
22282
+ "schema": {
22283
+ "$ref": "#/components/schemas/ErrorResponse"
22284
+ }
22285
+ }
22286
+ }
22287
+ },
22288
+ "401": {
22289
+ "description": "Unauthorized",
22290
+ "content": {
22291
+ "application/json": {
22292
+ "schema": {
22293
+ "$ref": "#/components/schemas/ErrorResponse"
22294
+ }
22295
+ }
22296
+ }
22297
+ },
22298
+ "404": {
22299
+ "description": "Key not found",
22300
+ "content": {
22301
+ "application/json": {
22302
+ "schema": {
22303
+ "$ref": "#/components/schemas/ErrorResponse"
22304
+ }
22305
+ }
22306
+ }
22307
+ }
22308
+ }
22309
+ }
22310
+ },
22311
+ "/api/keys/clear-rate-limit": {
22312
+ "post": {
22313
+ "summary": "Clear rate-limited status for a key after a successful use proves it is healthy",
22314
+ "tags": [
22315
+ "API Keys"
22316
+ ],
22317
+ "security": [
22318
+ {
22319
+ "bearerAuth": []
22320
+ }
22321
+ ],
22322
+ "requestBody": {
22323
+ "content": {
22324
+ "application/json": {
22325
+ "schema": {
22326
+ "type": "object",
22327
+ "properties": {
22328
+ "keyType": {
22329
+ "type": "string"
22330
+ },
22331
+ "keySuffix": {
22332
+ "type": "string",
22333
+ "minLength": 1,
22334
+ "maxLength": 10
22335
+ },
22336
+ "scope": {
22337
+ "type": "string"
22338
+ },
22339
+ "scopeId": {
22340
+ "type": "string"
22341
+ },
22342
+ "clearAuthBench": {
22343
+ "type": "boolean"
22344
+ },
22345
+ "keyIndex": {
22346
+ "type": "integer",
22347
+ "minimum": 0
22348
+ },
22349
+ "authFence": {
22350
+ "type": "integer",
22351
+ "minimum": 0
22352
+ }
22353
+ },
22354
+ "required": [
22355
+ "keyType",
22356
+ "keySuffix"
22357
+ ]
22358
+ }
22359
+ }
22360
+ }
22361
+ },
22362
+ "responses": {
22363
+ "200": {
22364
+ "description": "Rate limit cleared (or key was not rate-limited)",
22365
+ "content": {
22366
+ "application/json": {
22367
+ "schema": {
22368
+ "type": "object",
22369
+ "properties": {
22370
+ "success": {
22371
+ "type": "boolean",
22372
+ "enum": [
22373
+ true
22374
+ ]
22375
+ },
22376
+ "cleared": {
22377
+ "type": "boolean"
22378
+ },
22379
+ "message": {
22380
+ "type": "string"
22381
+ }
22382
+ },
22383
+ "required": [
22384
+ "success",
22385
+ "cleared",
22386
+ "message"
22387
+ ]
22388
+ }
22389
+ }
22390
+ }
22391
+ },
22392
+ "400": {
22393
+ "description": "Validation error",
22394
+ "content": {
22395
+ "application/json": {
22396
+ "schema": {
22397
+ "$ref": "#/components/schemas/ErrorResponse"
22398
+ }
22399
+ }
22400
+ }
22401
+ },
22402
+ "401": {
22403
+ "description": "Unauthorized",
22404
+ "content": {
22405
+ "application/json": {
22406
+ "schema": {
22407
+ "$ref": "#/components/schemas/ErrorResponse"
22408
+ }
22409
+ }
22410
+ }
22411
+ }
22412
+ }
22413
+ }
22414
+ },
22415
+ "/api/keys/plans": {
22416
+ "get": {
22417
+ "summary": "List subscription plans and their monthly list prices",
22418
+ "tags": [
22419
+ "API Keys"
22420
+ ],
22421
+ "security": [
22422
+ {
22423
+ "bearerAuth": []
22424
+ }
22425
+ ],
22426
+ "responses": {
22427
+ "200": {
22428
+ "description": "Plan catalog",
22429
+ "content": {
22430
+ "application/json": {
22431
+ "schema": {
22432
+ "type": "object",
22433
+ "properties": {
22434
+ "checkedAt": {
22435
+ "type": "string"
22436
+ },
22437
+ "plans": {
22438
+ "type": "array",
22439
+ "items": {
22440
+ "type": "object",
22441
+ "properties": {
22442
+ "id": {
22443
+ "type": "string"
22444
+ },
22445
+ "label": {
22446
+ "type": "string"
22447
+ },
22448
+ "keyType": {
22449
+ "type": "string"
22450
+ },
22451
+ "monthlyUsd": {
22452
+ "type": "number"
22453
+ }
22454
+ },
22455
+ "required": [
22456
+ "id",
22457
+ "label",
22458
+ "keyType",
22459
+ "monthlyUsd"
22460
+ ]
22461
+ }
22462
+ }
22463
+ },
22464
+ "required": [
22465
+ "checkedAt",
22466
+ "plans"
22467
+ ]
22468
+ }
22469
+ }
22470
+ }
22471
+ }
22472
+ }
22473
+ }
22474
+ },
22475
+ "/api/keys/plan": {
22476
+ "patch": {
22477
+ "summary": "Set or clear the subscription plan of a pooled credential",
22478
+ "tags": [
22479
+ "API Keys"
22480
+ ],
22481
+ "security": [
22482
+ {
22483
+ "bearerAuth": []
22484
+ }
22485
+ ],
22486
+ "requestBody": {
22487
+ "content": {
22488
+ "application/json": {
22489
+ "schema": {
22490
+ "type": "object",
22491
+ "properties": {
22492
+ "keyType": {
22493
+ "type": "string",
22494
+ "minLength": 1
22495
+ },
22496
+ "keySuffix": {
22497
+ "type": "string",
22498
+ "minLength": 1,
22499
+ "maxLength": 10
22500
+ },
22501
+ "plan": {
22502
+ "type": [
22503
+ "string",
22504
+ "null"
22505
+ ],
22506
+ "maxLength": 40
22507
+ }
22508
+ },
22509
+ "required": [
22510
+ "keyType",
22511
+ "keySuffix",
22512
+ "plan"
22513
+ ]
22514
+ }
22515
+ }
22516
+ }
22517
+ },
22518
+ "responses": {
22519
+ "200": {
22520
+ "description": "Plan updated",
22521
+ "content": {
22522
+ "application/json": {
22523
+ "schema": {
22524
+ "type": "object",
22525
+ "properties": {
22526
+ "success": {
22527
+ "type": "boolean",
22528
+ "enum": [
22529
+ true
22530
+ ]
22531
+ },
22532
+ "keyType": {
22533
+ "type": "string"
22534
+ },
22535
+ "keySuffix": {
22536
+ "type": "string"
22537
+ },
22538
+ "plan": {
22539
+ "type": [
22540
+ "string",
22541
+ "null"
22542
+ ]
22543
+ }
22544
+ },
22545
+ "required": [
22546
+ "success",
22547
+ "keyType",
22548
+ "keySuffix",
22549
+ "plan"
22550
+ ]
22551
+ }
22552
+ }
22553
+ }
22554
+ },
22555
+ "400": {
22556
+ "description": "Unknown plan, or a plan for another credential type",
22557
+ "content": {
22558
+ "application/json": {
22559
+ "schema": {
22560
+ "$ref": "#/components/schemas/ErrorResponse"
22561
+ }
22562
+ }
22563
+ }
22564
+ },
22565
+ "401": {
22566
+ "description": "Unauthorized",
22567
+ "content": {
22568
+ "application/json": {
22569
+ "schema": {
22570
+ "$ref": "#/components/schemas/ErrorResponse"
22571
+ }
22572
+ }
22573
+ }
22574
+ },
22575
+ "404": {
22576
+ "description": "Key not found",
22577
+ "content": {
22578
+ "application/json": {
22579
+ "schema": {
22580
+ "$ref": "#/components/schemas/ErrorResponse"
22581
+ }
22582
+ }
22583
+ }
22584
+ }
22585
+ }
22586
+ }
22587
+ },
22588
+ "/api/config/pool-keys": {
22589
+ "get": {
22590
+ "summary": "List credential pool suffixes and status",
22591
+ "tags": [
22592
+ "Config"
22593
+ ],
22594
+ "security": [
22595
+ {
22596
+ "bearerAuth": []
22597
+ }
22598
+ ],
22599
+ "parameters": [
22600
+ {
22601
+ "schema": {
22602
+ "type": "string"
22603
+ },
22604
+ "required": true,
22605
+ "name": "key",
22606
+ "in": "query"
22607
+ }
22608
+ ],
22609
+ "responses": {
22610
+ "200": {
22611
+ "description": "Credential pool",
22612
+ "content": {
22613
+ "application/json": {
22614
+ "schema": {
22615
+ "type": "object",
22616
+ "properties": {
22617
+ "key": {
22618
+ "type": "string"
22619
+ },
22620
+ "source": {
22621
+ "type": "string",
22622
+ "enum": [
22623
+ "stored",
22624
+ "env",
22625
+ "none"
22626
+ ]
22627
+ },
22628
+ "readOnly": {
22629
+ "type": "boolean"
22630
+ },
22631
+ "keys": {
22632
+ "type": "array",
22633
+ "items": {
22634
+ "type": "object",
22635
+ "properties": {
22636
+ "index": {
22637
+ "type": "integer",
22638
+ "minimum": 0
22639
+ },
22640
+ "suffix": {
22641
+ "type": "string"
22642
+ },
22643
+ "status": {
22644
+ "type": "string",
22645
+ "enum": [
22646
+ "ok",
22647
+ "rejected",
22648
+ "rate_limited",
22649
+ "spend_capped",
22650
+ "unchecked"
22651
+ ]
22652
+ },
22653
+ "error": {
22654
+ "type": [
22655
+ "string",
22656
+ "null"
22657
+ ]
22658
+ },
22659
+ "checkedAt": {
22660
+ "type": [
22661
+ "string",
22662
+ "null"
22663
+ ]
22664
+ },
22665
+ "rateLimitedUntil": {
22666
+ "type": [
22667
+ "string",
22668
+ "null"
22669
+ ]
22670
+ },
22671
+ "spendCap": {
22672
+ "type": [
22673
+ "object",
22674
+ "null"
22675
+ ],
22676
+ "properties": {
22677
+ "limitUsd": {
22678
+ "type": [
22679
+ "number",
22680
+ "null"
22681
+ ]
22682
+ },
22683
+ "spendUsd": {
22684
+ "type": [
22685
+ "number",
22686
+ "null"
22687
+ ]
22688
+ },
22689
+ "resetsAt": {
22690
+ "type": [
22691
+ "string",
22692
+ "null"
22693
+ ],
22694
+ "format": "date-time"
22695
+ }
22696
+ },
22697
+ "required": [
22698
+ "limitUsd",
22699
+ "spendUsd",
22700
+ "resetsAt"
22701
+ ]
22702
+ }
22703
+ },
22704
+ "required": [
22705
+ "index",
22706
+ "suffix",
22707
+ "status",
22708
+ "error",
22709
+ "checkedAt",
22710
+ "rateLimitedUntil",
22711
+ "spendCap"
22712
+ ]
22713
+ }
22714
+ }
22715
+ },
22716
+ "required": [
22717
+ "key",
22718
+ "source",
22719
+ "readOnly",
22720
+ "keys"
22721
+ ]
22722
+ }
22723
+ }
22724
+ }
22725
+ },
22726
+ "400": {
22727
+ "description": "Invalid pool variable",
22728
+ "content": {
22729
+ "application/json": {
22730
+ "schema": {
22731
+ "$ref": "#/components/schemas/ErrorResponse"
22732
+ }
22733
+ }
22734
+ }
22735
+ },
22736
+ "403": {
22737
+ "description": "Secret read permission required",
22385
22738
  "content": {
22386
22739
  "application/json": {
22387
22740
  "schema": {
@@ -22391,380 +22744,202 @@
22391
22744
  }
22392
22745
  }
22393
22746
  }
22394
- }
22395
- },
22396
- "/api/keys/window-usage": {
22397
- "get": {
22398
- "summary": "Get Swarm-observed usage within current provider windows",
22399
- "description": "Usage calculations support 256 windows, 16 distinct windows per credential, 90 days, and 100,000 session rows. Oversized requests fail without partial totals.",
22747
+ },
22748
+ "post": {
22749
+ "summary": "Test and append keys to a credential pool",
22400
22750
  "tags": [
22401
- "API Keys"
22751
+ "Config"
22402
22752
  ],
22403
22753
  "security": [
22404
22754
  {
22405
22755
  "bearerAuth": []
22406
22756
  }
22407
22757
  ],
22408
- "parameters": [
22409
- {
22410
- "schema": {
22411
- "type": "string",
22412
- "maxLength": 128
22413
- },
22414
- "required": false,
22415
- "name": "keyType",
22416
- "in": "query"
22417
- },
22418
- {
22419
- "schema": {
22420
- "type": "string",
22421
- "minLength": 1,
22422
- "maxLength": 10
22423
- },
22424
- "required": false,
22425
- "name": "keySuffix",
22426
- "in": "query"
22427
- },
22428
- {
22429
- "schema": {
22430
- "type": "string",
22431
- "maxLength": 64
22432
- },
22433
- "required": false,
22434
- "name": "scope",
22435
- "in": "query"
22436
- },
22437
- {
22438
- "schema": {
22439
- "type": "string",
22440
- "maxLength": 128
22441
- },
22442
- "required": false,
22443
- "name": "scopeId",
22444
- "in": "query"
22758
+ "requestBody": {
22759
+ "content": {
22760
+ "application/json": {
22761
+ "schema": {
22762
+ "type": "object",
22763
+ "properties": {
22764
+ "key": {
22765
+ "type": "string"
22766
+ },
22767
+ "value": {
22768
+ "type": "string"
22769
+ },
22770
+ "baseUrl": {
22771
+ "type": [
22772
+ "string",
22773
+ "null"
22774
+ ],
22775
+ "description": "Base URL for the check only. Null tests the provider default. Omit to use the stored URL."
22776
+ }
22777
+ },
22778
+ "required": [
22779
+ "key",
22780
+ "value"
22781
+ ]
22782
+ }
22783
+ }
22445
22784
  }
22446
- ],
22785
+ },
22447
22786
  "responses": {
22448
22787
  "200": {
22449
- "description": "Independent windows with receipt-time tokens and explicit measurement coverage",
22788
+ "description": "Updated credential pool and checks",
22450
22789
  "content": {
22451
22790
  "application/json": {
22452
22791
  "schema": {
22453
22792
  "type": "object",
22454
22793
  "properties": {
22455
- "success": {
22456
- "type": "boolean",
22457
- "enum": [
22458
- true
22459
- ]
22460
- },
22461
- "asOf": {
22794
+ "key": {
22462
22795
  "type": "string"
22463
22796
  },
22464
- "accounting": {
22797
+ "source": {
22465
22798
  "type": "string",
22466
22799
  "enum": [
22467
- "session_cost_receipt_time"
22800
+ "stored",
22801
+ "env",
22802
+ "none"
22468
22803
  ]
22469
22804
  },
22470
- "windows": {
22805
+ "readOnly": {
22806
+ "type": "boolean"
22807
+ },
22808
+ "keys": {
22471
22809
  "type": "array",
22472
22810
  "items": {
22473
22811
  "type": "object",
22474
22812
  "properties": {
22475
- "statusId": {
22476
- "type": "string"
22477
- },
22478
- "keyType": {
22479
- "type": "string"
22813
+ "index": {
22814
+ "type": "integer",
22815
+ "minimum": 0
22480
22816
  },
22481
- "keySuffix": {
22817
+ "suffix": {
22482
22818
  "type": "string"
22483
22819
  },
22484
- "scope": {
22485
- "type": "string"
22820
+ "status": {
22821
+ "type": "string",
22822
+ "enum": [
22823
+ "ok",
22824
+ "rejected",
22825
+ "rate_limited",
22826
+ "spend_capped",
22827
+ "unchecked"
22828
+ ]
22486
22829
  },
22487
- "scopeId": {
22830
+ "error": {
22488
22831
  "type": [
22489
22832
  "string",
22490
22833
  "null"
22491
22834
  ]
22492
22835
  },
22493
- "windowKey": {
22494
- "type": "string"
22495
- },
22496
- "durationMins": {
22836
+ "checkedAt": {
22497
22837
  "type": [
22498
- "number",
22838
+ "string",
22499
22839
  "null"
22500
22840
  ]
22501
22841
  },
22502
- "startsAt": {
22842
+ "rateLimitedUntil": {
22503
22843
  "type": [
22504
22844
  "string",
22505
22845
  "null"
22506
22846
  ]
22507
22847
  },
22508
- "endsAt": {
22848
+ "spendCap": {
22509
22849
  "type": [
22510
- "string",
22850
+ "object",
22511
22851
  "null"
22512
- ]
22513
- },
22514
- "dataThrough": {
22515
- "type": "string"
22516
- },
22517
- "observedAt": {
22518
- "type": "string"
22519
- },
22520
- "observationAgeMs": {
22521
- "type": "number"
22522
- },
22523
- "modelScope": {
22524
- "type": "object",
22852
+ ],
22525
22853
  "properties": {
22526
- "kind": {
22527
- "type": "string",
22528
- "enum": [
22529
- "account",
22530
- "family",
22531
- "unknown"
22854
+ "limitUsd": {
22855
+ "type": [
22856
+ "number",
22857
+ "null"
22532
22858
  ]
22533
22859
  },
22534
- "model": {
22860
+ "spendUsd": {
22535
22861
  "type": [
22536
- "string",
22862
+ "number",
22537
22863
  "null"
22538
22864
  ]
22865
+ },
22866
+ "resetsAt": {
22867
+ "type": [
22868
+ "string",
22869
+ "null"
22870
+ ],
22871
+ "format": "date-time"
22539
22872
  }
22540
22873
  },
22541
22874
  "required": [
22542
- "kind",
22543
- "model"
22875
+ "limitUsd",
22876
+ "spendUsd",
22877
+ "resetsAt"
22544
22878
  ]
22879
+ }
22880
+ },
22881
+ "required": [
22882
+ "index",
22883
+ "suffix",
22884
+ "status",
22885
+ "error",
22886
+ "checkedAt",
22887
+ "rateLimitedUntil",
22888
+ "spendCap"
22889
+ ]
22890
+ }
22891
+ },
22892
+ "checks": {
22893
+ "type": "array",
22894
+ "items": {
22895
+ "type": "object",
22896
+ "properties": {
22897
+ "suffix": {
22898
+ "type": "string"
22545
22899
  },
22546
- "unavailableReason": {
22900
+ "result": {
22901
+ "type": "string",
22902
+ "enum": [
22903
+ "verified",
22904
+ "rejected",
22905
+ "not_tested"
22906
+ ]
22907
+ },
22908
+ "httpStatus": {
22547
22909
  "type": [
22548
- "string",
22910
+ "number",
22549
22911
  "null"
22550
- ],
22551
- "enum": [
22552
- "missing_reset",
22553
- "unknown_duration",
22554
- "unknown_model_scope",
22555
- "window_not_started",
22556
- null
22557
22912
  ]
22558
22913
  },
22559
- "usage": {
22914
+ "error": {
22560
22915
  "type": [
22561
- "object",
22916
+ "string",
22562
22917
  "null"
22563
- ],
22564
- "properties": {
22565
- "sessions": {
22566
- "type": "integer"
22567
- },
22568
- "errorSessions": {
22569
- "type": "integer"
22570
- },
22571
- "completedTasks": {
22572
- "type": "integer"
22573
- },
22574
- "tokens": {
22575
- "type": "object",
22576
- "properties": {
22577
- "uncachedInput": {
22578
- "type": "object",
22579
- "properties": {
22580
- "value": {
22581
- "type": [
22582
- "number",
22583
- "null"
22584
- ]
22585
- },
22586
- "measuredSessions": {
22587
- "type": "integer"
22588
- },
22589
- "missingSessions": {
22590
- "type": "integer"
22591
- }
22592
- },
22593
- "required": [
22594
- "value",
22595
- "measuredSessions",
22596
- "missingSessions"
22597
- ]
22598
- },
22599
- "output": {
22600
- "type": "object",
22601
- "properties": {
22602
- "value": {
22603
- "type": [
22604
- "number",
22605
- "null"
22606
- ]
22607
- },
22608
- "measuredSessions": {
22609
- "type": "integer"
22610
- },
22611
- "missingSessions": {
22612
- "type": "integer"
22613
- }
22614
- },
22615
- "required": [
22616
- "value",
22617
- "measuredSessions",
22618
- "missingSessions"
22619
- ]
22620
- },
22621
- "cacheRead": {
22622
- "type": "object",
22623
- "properties": {
22624
- "value": {
22625
- "type": [
22626
- "number",
22627
- "null"
22628
- ]
22629
- },
22630
- "measuredSessions": {
22631
- "type": "integer"
22632
- },
22633
- "missingSessions": {
22634
- "type": "integer"
22635
- }
22636
- },
22637
- "required": [
22638
- "value",
22639
- "measuredSessions",
22640
- "missingSessions"
22641
- ]
22642
- },
22643
- "cacheWrite": {
22644
- "type": "object",
22645
- "properties": {
22646
- "value": {
22647
- "type": [
22648
- "number",
22649
- "null"
22650
- ]
22651
- },
22652
- "measuredSessions": {
22653
- "type": "integer"
22654
- },
22655
- "missingSessions": {
22656
- "type": "integer"
22657
- }
22658
- },
22659
- "required": [
22660
- "value",
22661
- "measuredSessions",
22662
- "missingSessions"
22663
- ]
22664
- },
22665
- "reasoning": {
22666
- "type": "object",
22667
- "properties": {
22668
- "value": {
22669
- "type": [
22670
- "number",
22671
- "null"
22672
- ]
22673
- },
22674
- "measuredSessions": {
22675
- "type": "integer"
22676
- },
22677
- "missingSessions": {
22678
- "type": "integer"
22679
- }
22680
- },
22681
- "required": [
22682
- "value",
22683
- "measuredSessions",
22684
- "missingSessions"
22685
- ]
22686
- },
22687
- "thinking": {
22688
- "type": "object",
22689
- "properties": {
22690
- "value": {
22691
- "type": [
22692
- "number",
22693
- "null"
22694
- ]
22695
- },
22696
- "measuredSessions": {
22697
- "type": "integer"
22698
- },
22699
- "missingSessions": {
22700
- "type": "integer"
22701
- }
22702
- },
22703
- "required": [
22704
- "value",
22705
- "measuredSessions",
22706
- "missingSessions"
22707
- ]
22708
- }
22709
- },
22710
- "required": [
22711
- "uncachedInput",
22712
- "output",
22713
- "cacheRead",
22714
- "cacheWrite",
22715
- "reasoning",
22716
- "thinking"
22717
- ]
22718
- },
22719
- "modelUnattributedSessions": {
22720
- "type": "integer"
22721
- },
22722
- "swarmUnattributedSessions": {
22723
- "type": "integer"
22724
- }
22725
- },
22726
- "required": [
22727
- "sessions",
22728
- "errorSessions",
22729
- "completedTasks",
22730
- "tokens",
22731
- "modelUnattributedSessions",
22732
- "swarmUnattributedSessions"
22733
22918
  ]
22734
22919
  }
22735
22920
  },
22736
22921
  "required": [
22737
- "statusId",
22738
- "keyType",
22739
- "keySuffix",
22740
- "scope",
22741
- "scopeId",
22742
- "windowKey",
22743
- "durationMins",
22744
- "startsAt",
22745
- "endsAt",
22746
- "dataThrough",
22747
- "observedAt",
22748
- "observationAgeMs",
22749
- "modelScope",
22750
- "unavailableReason",
22751
- "usage"
22922
+ "suffix",
22923
+ "result",
22924
+ "httpStatus",
22925
+ "error"
22752
22926
  ]
22753
22927
  }
22754
22928
  }
22755
22929
  },
22756
22930
  "required": [
22757
- "success",
22758
- "asOf",
22759
- "accounting",
22760
- "windows"
22931
+ "key",
22932
+ "source",
22933
+ "readOnly",
22934
+ "keys",
22935
+ "checks"
22761
22936
  ]
22762
22937
  }
22763
22938
  }
22764
22939
  }
22765
22940
  },
22766
22941
  "400": {
22767
- "description": "Invalid filters",
22942
+ "description": "Invalid key",
22768
22943
  "content": {
22769
22944
  "application/json": {
22770
22945
  "schema": {
@@ -22773,8 +22948,8 @@
22773
22948
  }
22774
22949
  }
22775
22950
  },
22776
- "401": {
22777
- "description": "Unauthorized",
22951
+ "403": {
22952
+ "description": "Config administration and permission to read all secrets required",
22778
22953
  "content": {
22779
22954
  "application/json": {
22780
22955
  "schema": {
@@ -22783,8 +22958,8 @@
22783
22958
  }
22784
22959
  }
22785
22960
  },
22786
- "422": {
22787
- "description": "Requested usage exceeds the aggregation bounds",
22961
+ "409": {
22962
+ "description": "Duplicate key or deployment env pool",
22788
22963
  "content": {
22789
22964
  "application/json": {
22790
22965
  "schema": {
@@ -22793,202 +22968,225 @@
22793
22968
  }
22794
22969
  }
22795
22970
  },
22796
- "429": {
22797
- "description": "Usage query budget exhausted. Retry after one second",
22798
- "content": {
22799
- "application/json": {
22800
- "schema": {
22801
- "$ref": "#/components/schemas/ErrorResponse"
22802
- }
22803
- }
22804
- }
22805
- }
22806
- }
22807
- }
22808
- },
22809
- "/api/keys/costs": {
22810
- "get": {
22811
- "summary": "Get aggregated cost data per API key",
22812
- "tags": [
22813
- "API Keys"
22814
- ],
22815
- "security": [
22816
- {
22817
- "bearerAuth": []
22818
- }
22819
- ],
22820
- "parameters": [
22821
- {
22822
- "schema": {
22823
- "type": "string"
22824
- },
22825
- "required": false,
22826
- "name": "keyType",
22827
- "in": "query"
22828
- }
22829
- ],
22830
- "responses": {
22831
- "200": {
22832
- "description": "Per-key cost aggregation",
22971
+ "422": {
22972
+ "description": "Provider rejected a key. Nothing was saved.",
22833
22973
  "content": {
22834
22974
  "application/json": {
22835
22975
  "schema": {
22836
22976
  "type": "object",
22837
22977
  "properties": {
22838
- "success": {
22839
- "type": "boolean",
22840
- "enum": [
22841
- true
22842
- ]
22978
+ "error": {
22979
+ "type": "string"
22843
22980
  },
22844
- "costs": {
22981
+ "checks": {
22845
22982
  "type": "array",
22846
22983
  "items": {
22847
22984
  "type": "object",
22848
22985
  "properties": {
22849
- "keyType": {
22850
- "type": "string"
22851
- },
22852
- "keySuffix": {
22986
+ "suffix": {
22853
22987
  "type": "string"
22854
22988
  },
22855
- "totalCost": {
22856
- "type": "number",
22857
- "minimum": 0
22858
- },
22859
- "totalInputTokens": {
22860
- "type": "integer",
22861
- "minimum": 0
22989
+ "result": {
22990
+ "type": "string",
22991
+ "enum": [
22992
+ "verified",
22993
+ "rejected",
22994
+ "not_tested"
22995
+ ]
22862
22996
  },
22863
- "totalOutputTokens": {
22864
- "type": "integer",
22865
- "minimum": 0
22997
+ "httpStatus": {
22998
+ "type": [
22999
+ "number",
23000
+ "null"
23001
+ ]
22866
23002
  },
22867
- "taskCount": {
22868
- "type": "integer",
22869
- "minimum": 0
23003
+ "error": {
23004
+ "type": [
23005
+ "string",
23006
+ "null"
23007
+ ]
22870
23008
  }
22871
23009
  },
22872
23010
  "required": [
22873
- "keyType",
22874
- "keySuffix",
22875
- "totalCost",
22876
- "totalInputTokens",
22877
- "totalOutputTokens",
22878
- "taskCount"
23011
+ "suffix",
23012
+ "result",
23013
+ "httpStatus",
23014
+ "error"
22879
23015
  ]
22880
23016
  }
22881
23017
  }
22882
23018
  },
22883
23019
  "required": [
22884
- "success",
22885
- "costs"
23020
+ "error",
23021
+ "checks"
22886
23022
  ]
22887
23023
  }
22888
23024
  }
22889
23025
  }
22890
- },
22891
- "401": {
22892
- "description": "Unauthorized",
22893
- "content": {
22894
- "application/json": {
22895
- "schema": {
22896
- "$ref": "#/components/schemas/ErrorResponse"
22897
- }
22898
- }
22899
- }
22900
23026
  }
22901
23027
  }
22902
- }
22903
- },
22904
- "/api/keys/name": {
22905
- "patch": {
22906
- "summary": "Set or clear the human-friendly label on a pooled credential",
23028
+ },
23029
+ "delete": {
23030
+ "summary": "Remove one credential pool member",
22907
23031
  "tags": [
22908
- "API Keys"
23032
+ "Config"
22909
23033
  ],
22910
23034
  "security": [
22911
23035
  {
22912
23036
  "bearerAuth": []
22913
23037
  }
22914
23038
  ],
22915
- "requestBody": {
22916
- "content": {
22917
- "application/json": {
22918
- "schema": {
22919
- "type": "object",
22920
- "properties": {
22921
- "keyType": {
22922
- "type": "string",
22923
- "minLength": 1
22924
- },
22925
- "keySuffix": {
22926
- "type": "string",
22927
- "minLength": 1,
22928
- "maxLength": 10
22929
- },
22930
- "name": {
22931
- "type": [
22932
- "string",
22933
- "null"
22934
- ],
22935
- "maxLength": 60
22936
- },
22937
- "scope": {
22938
- "type": "string"
22939
- },
22940
- "scopeId": {
22941
- "type": "string"
22942
- }
22943
- },
22944
- "required": [
22945
- "keyType",
22946
- "keySuffix",
22947
- "name"
22948
- ]
22949
- }
22950
- }
23039
+ "parameters": [
23040
+ {
23041
+ "schema": {
23042
+ "type": "string"
23043
+ },
23044
+ "required": true,
23045
+ "name": "key",
23046
+ "in": "query"
23047
+ },
23048
+ {
23049
+ "schema": {
23050
+ "type": [
23051
+ "integer",
23052
+ "null"
23053
+ ],
23054
+ "minimum": 0
23055
+ },
23056
+ "required": false,
23057
+ "name": "index",
23058
+ "in": "query"
23059
+ },
23060
+ {
23061
+ "schema": {
23062
+ "type": "string",
23063
+ "minLength": 1,
23064
+ "maxLength": 5
23065
+ },
23066
+ "required": true,
23067
+ "name": "suffix",
23068
+ "in": "query"
22951
23069
  }
22952
- },
23070
+ ],
22953
23071
  "responses": {
22954
23072
  "200": {
22955
- "description": "Name updated",
23073
+ "description": "Updated credential pool",
22956
23074
  "content": {
22957
23075
  "application/json": {
22958
23076
  "schema": {
22959
23077
  "type": "object",
22960
23078
  "properties": {
22961
- "success": {
22962
- "type": "boolean",
23079
+ "key": {
23080
+ "type": "string"
23081
+ },
23082
+ "source": {
23083
+ "type": "string",
22963
23084
  "enum": [
22964
- true
23085
+ "stored",
23086
+ "env",
23087
+ "none"
22965
23088
  ]
22966
23089
  },
22967
- "keyType": {
22968
- "type": "string"
22969
- },
22970
- "keySuffix": {
22971
- "type": "string"
23090
+ "readOnly": {
23091
+ "type": "boolean"
22972
23092
  },
22973
- "name": {
22974
- "type": [
22975
- "string",
22976
- "null"
22977
- ]
23093
+ "keys": {
23094
+ "type": "array",
23095
+ "items": {
23096
+ "type": "object",
23097
+ "properties": {
23098
+ "index": {
23099
+ "type": "integer",
23100
+ "minimum": 0
23101
+ },
23102
+ "suffix": {
23103
+ "type": "string"
23104
+ },
23105
+ "status": {
23106
+ "type": "string",
23107
+ "enum": [
23108
+ "ok",
23109
+ "rejected",
23110
+ "rate_limited",
23111
+ "spend_capped",
23112
+ "unchecked"
23113
+ ]
23114
+ },
23115
+ "error": {
23116
+ "type": [
23117
+ "string",
23118
+ "null"
23119
+ ]
23120
+ },
23121
+ "checkedAt": {
23122
+ "type": [
23123
+ "string",
23124
+ "null"
23125
+ ]
23126
+ },
23127
+ "rateLimitedUntil": {
23128
+ "type": [
23129
+ "string",
23130
+ "null"
23131
+ ]
23132
+ },
23133
+ "spendCap": {
23134
+ "type": [
23135
+ "object",
23136
+ "null"
23137
+ ],
23138
+ "properties": {
23139
+ "limitUsd": {
23140
+ "type": [
23141
+ "number",
23142
+ "null"
23143
+ ]
23144
+ },
23145
+ "spendUsd": {
23146
+ "type": [
23147
+ "number",
23148
+ "null"
23149
+ ]
23150
+ },
23151
+ "resetsAt": {
23152
+ "type": [
23153
+ "string",
23154
+ "null"
23155
+ ],
23156
+ "format": "date-time"
23157
+ }
23158
+ },
23159
+ "required": [
23160
+ "limitUsd",
23161
+ "spendUsd",
23162
+ "resetsAt"
23163
+ ]
23164
+ }
23165
+ },
23166
+ "required": [
23167
+ "index",
23168
+ "suffix",
23169
+ "status",
23170
+ "error",
23171
+ "checkedAt",
23172
+ "rateLimitedUntil",
23173
+ "spendCap"
23174
+ ]
23175
+ }
22978
23176
  }
22979
23177
  },
22980
23178
  "required": [
22981
- "success",
22982
- "keyType",
22983
- "keySuffix",
22984
- "name"
23179
+ "key",
23180
+ "source",
23181
+ "readOnly",
23182
+ "keys"
22985
23183
  ]
22986
23184
  }
22987
23185
  }
22988
23186
  }
22989
23187
  },
22990
23188
  "400": {
22991
- "description": "Validation error",
23189
+ "description": "Invalid pool member",
22992
23190
  "content": {
22993
23191
  "application/json": {
22994
23192
  "schema": {
@@ -22997,8 +23195,8 @@
22997
23195
  }
22998
23196
  }
22999
23197
  },
23000
- "401": {
23001
- "description": "Unauthorized",
23198
+ "403": {
23199
+ "description": "Config administration and permission to read all secrets required",
23002
23200
  "content": {
23003
23201
  "application/json": {
23004
23202
  "schema": {
@@ -23007,8 +23205,8 @@
23007
23205
  }
23008
23206
  }
23009
23207
  },
23010
- "404": {
23011
- "description": "Key not found",
23208
+ "409": {
23209
+ "description": "The pool changed or comes from the deployment env",
23012
23210
  "content": {
23013
23211
  "application/json": {
23014
23212
  "schema": {
@@ -23020,52 +23218,93 @@
23020
23218
  }
23021
23219
  }
23022
23220
  },
23023
- "/api/keys/clear-rate-limit": {
23221
+ "/api/tasks/{id}/context": {
23024
23222
  "post": {
23025
- "summary": "Clear rate-limited status for a key after a successful use proves it is healthy",
23223
+ "summary": "Record a context usage snapshot for a task",
23026
23224
  "tags": [
23027
- "API Keys"
23225
+ "Tasks"
23028
23226
  ],
23029
23227
  "security": [
23030
23228
  {
23031
23229
  "bearerAuth": []
23032
23230
  }
23033
23231
  ],
23232
+ "parameters": [
23233
+ {
23234
+ "schema": {
23235
+ "type": "string"
23236
+ },
23237
+ "required": true,
23238
+ "name": "id",
23239
+ "in": "path"
23240
+ }
23241
+ ],
23034
23242
  "requestBody": {
23035
23243
  "content": {
23036
23244
  "application/json": {
23037
23245
  "schema": {
23038
23246
  "type": "object",
23039
23247
  "properties": {
23040
- "keyType": {
23041
- "type": "string"
23042
- },
23043
- "keySuffix": {
23248
+ "eventType": {
23044
23249
  "type": "string",
23045
- "minLength": 1,
23046
- "maxLength": 10
23250
+ "enum": [
23251
+ "progress",
23252
+ "compaction",
23253
+ "completion"
23254
+ ]
23047
23255
  },
23048
- "scope": {
23256
+ "sessionId": {
23049
23257
  "type": "string"
23050
23258
  },
23051
- "scopeId": {
23052
- "type": "string"
23259
+ "contextUsedTokens": {
23260
+ "type": "integer",
23261
+ "minimum": 0
23053
23262
  },
23054
- "clearAuthBench": {
23055
- "type": "boolean"
23263
+ "contextTotalTokens": {
23264
+ "type": "integer",
23265
+ "minimum": 0
23056
23266
  },
23057
- "keyIndex": {
23267
+ "contextPercent": {
23268
+ "type": "number",
23269
+ "minimum": 0,
23270
+ "maximum": 100
23271
+ },
23272
+ "compactTrigger": {
23273
+ "type": "string",
23274
+ "enum": [
23275
+ "auto",
23276
+ "manual",
23277
+ "auto-inferred"
23278
+ ]
23279
+ },
23280
+ "preCompactTokens": {
23058
23281
  "type": "integer",
23059
23282
  "minimum": 0
23060
23283
  },
23061
- "authFence": {
23284
+ "cumulativeInputTokens": {
23285
+ "type": "integer",
23286
+ "minimum": 0
23287
+ },
23288
+ "cumulativeOutputTokens": {
23062
23289
  "type": "integer",
23063
23290
  "minimum": 0
23291
+ },
23292
+ "contextFormula": {
23293
+ "type": "string",
23294
+ "enum": [
23295
+ "input-cache-output",
23296
+ "input-cache-no-output",
23297
+ "input-output-no-cache",
23298
+ "peak-proxy",
23299
+ "pi-delegated",
23300
+ "harness-reported",
23301
+ "unknown"
23302
+ ]
23064
23303
  }
23065
23304
  },
23066
23305
  "required": [
23067
- "keyType",
23068
- "keySuffix"
23306
+ "eventType",
23307
+ "sessionId"
23069
23308
  ]
23070
23309
  }
23071
23310
  }
@@ -23073,29 +23312,26 @@
23073
23312
  },
23074
23313
  "responses": {
23075
23314
  "200": {
23076
- "description": "Rate limit cleared (or key was not rate-limited)",
23315
+ "description": "Snapshot recorded",
23077
23316
  "content": {
23078
23317
  "application/json": {
23079
23318
  "schema": {
23080
23319
  "type": "object",
23081
23320
  "properties": {
23082
- "success": {
23321
+ "ok": {
23083
23322
  "type": "boolean",
23084
23323
  "enum": [
23085
23324
  true
23086
23325
  ]
23087
23326
  },
23088
- "cleared": {
23089
- "type": "boolean"
23090
- },
23091
- "message": {
23092
- "type": "string"
23327
+ "snapshotId": {
23328
+ "type": "string",
23329
+ "format": "uuid"
23093
23330
  }
23094
23331
  },
23095
23332
  "required": [
23096
- "success",
23097
- "cleared",
23098
- "message"
23333
+ "ok",
23334
+ "snapshotId"
23099
23335
  ]
23100
23336
  }
23101
23337
  }
@@ -23111,8 +23347,8 @@
23111
23347
  }
23112
23348
  }
23113
23349
  },
23114
- "401": {
23115
- "description": "Unauthorized",
23350
+ "404": {
23351
+ "description": "Task not found",
23116
23352
  "content": {
23117
23353
  "application/json": {
23118
23354
  "schema": {
@@ -23122,170 +23358,105 @@
23122
23358
  }
23123
23359
  }
23124
23360
  }
23125
- }
23126
- },
23127
- "/api/keys/plans": {
23361
+ },
23128
23362
  "get": {
23129
- "summary": "List subscription plans and their monthly list prices",
23363
+ "summary": "Get context usage history for a task",
23130
23364
  "tags": [
23131
- "API Keys"
23365
+ "Tasks"
23132
23366
  ],
23133
23367
  "security": [
23134
23368
  {
23135
23369
  "bearerAuth": []
23136
23370
  }
23137
23371
  ],
23138
- "responses": {
23139
- "200": {
23140
- "description": "Plan catalog",
23141
- "content": {
23142
- "application/json": {
23143
- "schema": {
23144
- "type": "object",
23145
- "properties": {
23146
- "checkedAt": {
23147
- "type": "string"
23148
- },
23149
- "plans": {
23150
- "type": "array",
23151
- "items": {
23152
- "type": "object",
23153
- "properties": {
23154
- "id": {
23155
- "type": "string"
23156
- },
23157
- "label": {
23158
- "type": "string"
23159
- },
23160
- "keyType": {
23161
- "type": "string"
23162
- },
23163
- "monthlyUsd": {
23164
- "type": "number"
23165
- }
23166
- },
23167
- "required": [
23168
- "id",
23169
- "label",
23170
- "keyType",
23171
- "monthlyUsd"
23172
- ]
23173
- }
23174
- }
23175
- },
23176
- "required": [
23177
- "checkedAt",
23178
- "plans"
23179
- ]
23180
- }
23181
- }
23182
- }
23183
- }
23184
- }
23185
- }
23186
- },
23187
- "/api/keys/plan": {
23188
- "patch": {
23189
- "summary": "Set or clear the subscription plan of a pooled credential",
23190
- "tags": [
23191
- "API Keys"
23192
- ],
23193
- "security": [
23372
+ "parameters": [
23194
23373
  {
23195
- "bearerAuth": []
23374
+ "schema": {
23375
+ "type": "string"
23376
+ },
23377
+ "required": true,
23378
+ "name": "id",
23379
+ "in": "path"
23380
+ },
23381
+ {
23382
+ "schema": {
23383
+ "type": "integer",
23384
+ "minimum": 1,
23385
+ "maximum": 500,
23386
+ "default": 100
23387
+ },
23388
+ "required": false,
23389
+ "name": "limit",
23390
+ "in": "query"
23196
23391
  }
23197
23392
  ],
23198
- "requestBody": {
23199
- "content": {
23200
- "application/json": {
23201
- "schema": {
23202
- "type": "object",
23203
- "properties": {
23204
- "keyType": {
23205
- "type": "string",
23206
- "minLength": 1
23207
- },
23208
- "keySuffix": {
23209
- "type": "string",
23210
- "minLength": 1,
23211
- "maxLength": 10
23212
- },
23213
- "plan": {
23214
- "type": [
23215
- "string",
23216
- "null"
23217
- ],
23218
- "maxLength": 40
23219
- }
23220
- },
23221
- "required": [
23222
- "keyType",
23223
- "keySuffix",
23224
- "plan"
23225
- ]
23226
- }
23227
- }
23228
- }
23229
- },
23230
23393
  "responses": {
23231
23394
  "200": {
23232
- "description": "Plan updated",
23395
+ "description": "Context snapshot history",
23233
23396
  "content": {
23234
23397
  "application/json": {
23235
23398
  "schema": {
23236
23399
  "type": "object",
23237
23400
  "properties": {
23238
- "success": {
23239
- "type": "boolean",
23240
- "enum": [
23241
- true
23242
- ]
23243
- },
23244
- "keyType": {
23245
- "type": "string"
23246
- },
23247
- "keySuffix": {
23248
- "type": "string"
23401
+ "snapshots": {
23402
+ "type": "array",
23403
+ "items": {
23404
+ "$ref": "#/components/schemas/ContextSnapshot"
23405
+ }
23249
23406
  },
23250
- "plan": {
23251
- "type": [
23252
- "string",
23253
- "null"
23407
+ "summary": {
23408
+ "type": "object",
23409
+ "properties": {
23410
+ "compactionCount": {
23411
+ "type": "integer",
23412
+ "minimum": 0
23413
+ },
23414
+ "peakContextPercent": {
23415
+ "type": [
23416
+ "number",
23417
+ "null"
23418
+ ],
23419
+ "minimum": 0,
23420
+ "maximum": 100
23421
+ },
23422
+ "peakContextTokens": {
23423
+ "type": [
23424
+ "integer",
23425
+ "null"
23426
+ ],
23427
+ "minimum": 0
23428
+ },
23429
+ "contextWindowSize": {
23430
+ "type": [
23431
+ "integer",
23432
+ "null"
23433
+ ],
23434
+ "minimum": 0
23435
+ },
23436
+ "snapshotCount": {
23437
+ "type": "integer",
23438
+ "minimum": 0
23439
+ }
23440
+ },
23441
+ "required": [
23442
+ "compactionCount",
23443
+ "peakContextPercent",
23444
+ "peakContextTokens",
23445
+ "contextWindowSize",
23446
+ "snapshotCount"
23254
23447
  ]
23255
23448
  }
23256
23449
  },
23257
23450
  "required": [
23258
- "success",
23259
- "keyType",
23260
- "keySuffix",
23261
- "plan"
23451
+ "snapshots",
23452
+ "summary"
23262
23453
  ]
23263
23454
  }
23264
23455
  }
23265
23456
  }
23266
23457
  },
23267
- "400": {
23268
- "description": "Unknown plan, or a plan for another credential type",
23269
- "content": {
23270
- "application/json": {
23271
- "schema": {
23272
- "$ref": "#/components/schemas/ErrorResponse"
23273
- }
23274
- }
23275
- }
23276
- },
23277
- "401": {
23278
- "description": "Unauthorized",
23279
- "content": {
23280
- "application/json": {
23281
- "schema": {
23282
- "$ref": "#/components/schemas/ErrorResponse"
23283
- }
23284
- }
23285
- }
23286
- },
23287
23458
  "404": {
23288
- "description": "Key not found",
23459
+ "description": "Task not found",
23289
23460
  "content": {
23290
23461
  "application/json": {
23291
23462
  "schema": {
@@ -48772,7 +48943,7 @@
48772
48943
  }
48773
48944
  },
48774
48945
  "403": {
48775
- "description": "Deferral owned by another agent",
48946
+ "description": "Deferral or target owned by another agent",
48776
48947
  "content": {
48777
48948
  "application/json": {
48778
48949
  "schema": {
@@ -49188,7 +49359,7 @@
49188
49359
  }
49189
49360
  },
49190
49361
  "403": {
49191
- "description": "Deferral owned by another agent",
49362
+ "description": "Deferral or target owned by another agent",
49192
49363
  "content": {
49193
49364
  "application/json": {
49194
49365
  "schema": {