@copilotkit/aimock 1.42.1 → 1.44.0

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 (442) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +65 -0
  4. package/README.md +108 -16
  5. package/dist/agui-handler.d.ts.map +1 -1
  6. package/dist/agui-mock.cjs +1 -1
  7. package/dist/agui-mock.cjs.map +1 -1
  8. package/dist/agui-mock.d.cts.map +1 -1
  9. package/dist/agui-mock.d.ts.map +1 -1
  10. package/dist/agui-mock.js +1 -1
  11. package/dist/agui-mock.js.map +1 -1
  12. package/dist/agui-recorder.cjs +33 -11
  13. package/dist/agui-recorder.cjs.map +1 -1
  14. package/dist/agui-recorder.d.cts +10 -1
  15. package/dist/agui-recorder.d.cts.map +1 -1
  16. package/dist/agui-recorder.d.ts +10 -1
  17. package/dist/agui-recorder.d.ts.map +1 -1
  18. package/dist/agui-recorder.js +33 -11
  19. package/dist/agui-recorder.js.map +1 -1
  20. package/dist/agui-types.d.cts +1 -0
  21. package/dist/agui-types.d.cts.map +1 -1
  22. package/dist/agui-types.d.ts +1 -0
  23. package/dist/agui-types.d.ts.map +1 -1
  24. package/dist/aimock-cli.cjs +38 -10
  25. package/dist/aimock-cli.cjs.map +1 -1
  26. package/dist/aimock-cli.d.cts +5 -0
  27. package/dist/aimock-cli.d.cts.map +1 -1
  28. package/dist/aimock-cli.d.ts +5 -0
  29. package/dist/aimock-cli.d.ts.map +1 -1
  30. package/dist/aimock-cli.js +38 -10
  31. package/dist/aimock-cli.js.map +1 -1
  32. package/dist/batches.cjs +458 -0
  33. package/dist/batches.cjs.map +1 -0
  34. package/dist/batches.d.cts +57 -0
  35. package/dist/batches.d.cts.map +1 -0
  36. package/dist/batches.d.ts +57 -0
  37. package/dist/batches.d.ts.map +1 -0
  38. package/dist/batches.js +453 -0
  39. package/dist/batches.js.map +1 -0
  40. package/dist/bedrock-converse.cjs +44 -12
  41. package/dist/bedrock-converse.cjs.map +1 -1
  42. package/dist/bedrock-converse.d.cts.map +1 -1
  43. package/dist/bedrock-converse.d.ts.map +1 -1
  44. package/dist/bedrock-converse.js +46 -14
  45. package/dist/bedrock-converse.js.map +1 -1
  46. package/dist/bedrock.cjs +10 -8
  47. package/dist/bedrock.cjs.map +1 -1
  48. package/dist/bedrock.d.cts.map +1 -1
  49. package/dist/bedrock.d.ts.map +1 -1
  50. package/dist/bedrock.js +12 -10
  51. package/dist/bedrock.js.map +1 -1
  52. package/dist/byteplus-video.cjs +3 -3
  53. package/dist/byteplus-video.cjs.map +1 -1
  54. package/dist/byteplus-video.js +4 -4
  55. package/dist/byteplus-video.js.map +1 -1
  56. package/dist/chaos.cjs +625 -72
  57. package/dist/chaos.cjs.map +1 -1
  58. package/dist/chaos.d.cts +164 -7
  59. package/dist/chaos.d.cts.map +1 -1
  60. package/dist/chaos.d.ts +164 -7
  61. package/dist/chaos.d.ts.map +1 -1
  62. package/dist/chaos.js +616 -74
  63. package/dist/chaos.js.map +1 -1
  64. package/dist/cli.cjs +131 -30
  65. package/dist/cli.cjs.map +1 -1
  66. package/dist/cli.js +132 -31
  67. package/dist/cli.js.map +1 -1
  68. package/dist/cohere.cjs +37 -9
  69. package/dist/cohere.cjs.map +1 -1
  70. package/dist/cohere.d.cts.map +1 -1
  71. package/dist/cohere.d.ts.map +1 -1
  72. package/dist/cohere.js +39 -11
  73. package/dist/cohere.js.map +1 -1
  74. package/dist/config-loader.cjs +1 -1
  75. package/dist/config-loader.js +1 -1
  76. package/dist/constants.cjs +8 -0
  77. package/dist/constants.cjs.map +1 -1
  78. package/dist/constants.d.cts +6 -2
  79. package/dist/constants.d.ts +6 -2
  80. package/dist/constants.js +8 -1
  81. package/dist/constants.js.map +1 -1
  82. package/dist/convert.cjs +1 -1
  83. package/dist/convert.cjs.map +1 -1
  84. package/dist/convert.js +1 -1
  85. package/dist/convert.js.map +1 -1
  86. package/dist/echo-text.cjs +65 -0
  87. package/dist/echo-text.cjs.map +1 -0
  88. package/dist/echo-text.d.cts +22 -0
  89. package/dist/echo-text.d.cts.map +1 -0
  90. package/dist/echo-text.d.ts +22 -0
  91. package/dist/echo-text.d.ts.map +1 -0
  92. package/dist/echo-text.js +65 -0
  93. package/dist/echo-text.js.map +1 -0
  94. package/dist/elevenlabs-audio.cjs +3 -3
  95. package/dist/elevenlabs-audio.cjs.map +1 -1
  96. package/dist/elevenlabs-audio.js +4 -4
  97. package/dist/elevenlabs-audio.js.map +1 -1
  98. package/dist/elevenlabs-voice.cjs +1053 -0
  99. package/dist/elevenlabs-voice.cjs.map +1 -0
  100. package/dist/elevenlabs-voice.d.cts +72 -0
  101. package/dist/elevenlabs-voice.d.cts.map +1 -0
  102. package/dist/elevenlabs-voice.d.ts +72 -0
  103. package/dist/elevenlabs-voice.d.ts.map +1 -0
  104. package/dist/elevenlabs-voice.js +1048 -0
  105. package/dist/elevenlabs-voice.js.map +1 -0
  106. package/dist/embeddings.cjs +26 -5
  107. package/dist/embeddings.cjs.map +1 -1
  108. package/dist/embeddings.d.cts +1 -1
  109. package/dist/embeddings.d.cts.map +1 -1
  110. package/dist/embeddings.d.ts +1 -1
  111. package/dist/embeddings.d.ts.map +1 -1
  112. package/dist/embeddings.js +27 -6
  113. package/dist/embeddings.js.map +1 -1
  114. package/dist/fal-audio.cjs +3 -3
  115. package/dist/fal-audio.cjs.map +1 -1
  116. package/dist/fal-audio.js +4 -4
  117. package/dist/fal-audio.js.map +1 -1
  118. package/dist/fal.cjs +28 -4
  119. package/dist/fal.cjs.map +1 -1
  120. package/dist/fal.d.cts +16 -1
  121. package/dist/fal.d.cts.map +1 -1
  122. package/dist/fal.d.ts +16 -1
  123. package/dist/fal.d.ts.map +1 -1
  124. package/dist/fal.js +28 -5
  125. package/dist/fal.js.map +1 -1
  126. package/dist/files.cjs +1069 -0
  127. package/dist/files.cjs.map +1 -0
  128. package/dist/files.d.cts +68 -0
  129. package/dist/files.d.cts.map +1 -0
  130. package/dist/files.d.ts +68 -0
  131. package/dist/files.d.ts.map +1 -0
  132. package/dist/files.js +1056 -0
  133. package/dist/files.js.map +1 -0
  134. package/dist/fine-tuning.cjs +1033 -0
  135. package/dist/fine-tuning.cjs.map +1 -0
  136. package/dist/fine-tuning.d.cts +96 -0
  137. package/dist/fine-tuning.d.cts.map +1 -0
  138. package/dist/fine-tuning.d.ts +96 -0
  139. package/dist/fine-tuning.d.ts.map +1 -0
  140. package/dist/fine-tuning.js +1026 -0
  141. package/dist/fine-tuning.js.map +1 -0
  142. package/dist/fixture-loader-services.cjs +116 -0
  143. package/dist/fixture-loader-services.cjs.map +1 -0
  144. package/dist/fixture-loader-services.d.cts +48 -0
  145. package/dist/fixture-loader-services.d.cts.map +1 -0
  146. package/dist/fixture-loader-services.d.ts +48 -0
  147. package/dist/fixture-loader-services.d.ts.map +1 -0
  148. package/dist/fixture-loader-services.js +114 -0
  149. package/dist/fixture-loader-services.js.map +1 -0
  150. package/dist/fixture-loader.cjs +0 -0
  151. package/dist/fixture-loader.cjs.map +1 -1
  152. package/dist/fixture-loader.d.cts +131 -5
  153. package/dist/fixture-loader.d.cts.map +1 -1
  154. package/dist/fixture-loader.d.ts +131 -5
  155. package/dist/fixture-loader.d.ts.map +1 -1
  156. package/dist/fixture-loader.js +0 -0
  157. package/dist/fixture-loader.js.map +1 -1
  158. package/dist/gemini-embeddings.cjs +44 -4
  159. package/dist/gemini-embeddings.cjs.map +1 -1
  160. package/dist/gemini-embeddings.js +46 -6
  161. package/dist/gemini-embeddings.js.map +1 -1
  162. package/dist/gemini-interactions.cjs +51 -7
  163. package/dist/gemini-interactions.cjs.map +1 -1
  164. package/dist/gemini-interactions.d.cts.map +1 -1
  165. package/dist/gemini-interactions.d.ts.map +1 -1
  166. package/dist/gemini-interactions.js +53 -9
  167. package/dist/gemini-interactions.js.map +1 -1
  168. package/dist/gemini.cjs +19 -8
  169. package/dist/gemini.cjs.map +1 -1
  170. package/dist/gemini.d.cts.map +1 -1
  171. package/dist/gemini.d.ts.map +1 -1
  172. package/dist/gemini.js +21 -10
  173. package/dist/gemini.js.map +1 -1
  174. package/dist/grok-video.cjs +14 -14
  175. package/dist/grok-video.cjs.map +1 -1
  176. package/dist/grok-video.js +15 -15
  177. package/dist/grok-video.js.map +1 -1
  178. package/dist/helpers.cjs +497 -10
  179. package/dist/helpers.cjs.map +1 -1
  180. package/dist/helpers.d.cts +38 -2
  181. package/dist/helpers.d.cts.map +1 -1
  182. package/dist/helpers.d.ts +38 -2
  183. package/dist/helpers.d.ts.map +1 -1
  184. package/dist/helpers.js +487 -12
  185. package/dist/helpers.js.map +1 -1
  186. package/dist/images.cjs +57 -125
  187. package/dist/images.cjs.map +1 -1
  188. package/dist/images.d.cts.map +1 -1
  189. package/dist/images.d.ts.map +1 -1
  190. package/dist/images.js +58 -126
  191. package/dist/images.js.map +1 -1
  192. package/dist/index.cjs +71 -9
  193. package/dist/index.d.cts +17 -7
  194. package/dist/index.d.ts +17 -7
  195. package/dist/index.js +21 -11
  196. package/dist/jest.cjs +24 -12
  197. package/dist/jest.cjs.map +1 -1
  198. package/dist/jest.d.cts +6 -3
  199. package/dist/jest.d.cts.map +1 -1
  200. package/dist/jest.d.ts +6 -3
  201. package/dist/jest.d.ts.map +1 -1
  202. package/dist/jest.js +25 -13
  203. package/dist/jest.js.map +1 -1
  204. package/dist/journal.cjs +61 -4
  205. package/dist/journal.cjs.map +1 -1
  206. package/dist/journal.d.cts +60 -3
  207. package/dist/journal.d.cts.map +1 -1
  208. package/dist/journal.d.ts +60 -3
  209. package/dist/journal.d.ts.map +1 -1
  210. package/dist/journal.js +61 -5
  211. package/dist/journal.js.map +1 -1
  212. package/dist/live-fixture.cjs +1192 -0
  213. package/dist/live-fixture.cjs.map +1 -0
  214. package/dist/live-fixture.js +1187 -0
  215. package/dist/live-fixture.js.map +1 -0
  216. package/dist/live-recorder.cjs +256 -0
  217. package/dist/live-recorder.cjs.map +1 -0
  218. package/dist/live-recorder.js +254 -0
  219. package/dist/live-recorder.js.map +1 -0
  220. package/dist/live-replay.cjs +286 -0
  221. package/dist/live-replay.cjs.map +1 -0
  222. package/dist/live-replay.js +285 -0
  223. package/dist/live-replay.js.map +1 -0
  224. package/dist/live-sanitize.cjs +196 -0
  225. package/dist/live-sanitize.cjs.map +1 -0
  226. package/dist/live-sanitize.js +196 -0
  227. package/dist/live-sanitize.js.map +1 -0
  228. package/dist/live-types.d.cts +71 -0
  229. package/dist/live-types.d.cts.map +1 -0
  230. package/dist/live-types.d.ts +71 -0
  231. package/dist/live-types.d.ts.map +1 -0
  232. package/dist/llmock.cjs +132 -49
  233. package/dist/llmock.cjs.map +1 -1
  234. package/dist/llmock.d.cts +51 -5
  235. package/dist/llmock.d.cts.map +1 -1
  236. package/dist/llmock.d.ts +51 -5
  237. package/dist/llmock.d.ts.map +1 -1
  238. package/dist/llmock.js +133 -50
  239. package/dist/llmock.js.map +1 -1
  240. package/dist/mcp-fakes-mount.cjs +216 -0
  241. package/dist/mcp-fakes-mount.cjs.map +1 -0
  242. package/dist/mcp-fakes-mount.js +210 -0
  243. package/dist/mcp-fakes-mount.js.map +1 -0
  244. package/dist/mcp-fakes.cjs +1619 -0
  245. package/dist/mcp-fakes.cjs.map +1 -0
  246. package/dist/mcp-fakes.d.cts +101 -0
  247. package/dist/mcp-fakes.d.cts.map +1 -0
  248. package/dist/mcp-fakes.d.ts +101 -0
  249. package/dist/mcp-fakes.d.ts.map +1 -0
  250. package/dist/mcp-fakes.js +1614 -0
  251. package/dist/mcp-fakes.js.map +1 -0
  252. package/dist/mcp-handler.cjs +331 -17
  253. package/dist/mcp-handler.cjs.map +1 -1
  254. package/dist/mcp-handler.js +330 -18
  255. package/dist/mcp-handler.js.map +1 -1
  256. package/dist/mcp-mock.cjs +217 -49
  257. package/dist/mcp-mock.cjs.map +1 -1
  258. package/dist/mcp-mock.d.cts +66 -1
  259. package/dist/mcp-mock.d.cts.map +1 -1
  260. package/dist/mcp-mock.d.ts +66 -1
  261. package/dist/mcp-mock.d.ts.map +1 -1
  262. package/dist/mcp-mock.js +218 -50
  263. package/dist/mcp-mock.js.map +1 -1
  264. package/dist/mcp-stub.cjs +5 -1
  265. package/dist/mcp-stub.d.cts +3 -1
  266. package/dist/mcp-stub.d.ts +3 -1
  267. package/dist/mcp-stub.js +3 -1
  268. package/dist/mcp-types.d.cts +6 -0
  269. package/dist/mcp-types.d.ts +6 -0
  270. package/dist/message-text.cjs +192 -0
  271. package/dist/message-text.cjs.map +1 -0
  272. package/dist/message-text.d.cts +31 -0
  273. package/dist/message-text.d.cts.map +1 -0
  274. package/dist/message-text.d.ts +31 -0
  275. package/dist/message-text.d.ts.map +1 -0
  276. package/dist/message-text.js +184 -0
  277. package/dist/message-text.js.map +1 -0
  278. package/dist/messages.cjs +49 -7
  279. package/dist/messages.cjs.map +1 -1
  280. package/dist/messages.d.cts.map +1 -1
  281. package/dist/messages.d.ts.map +1 -1
  282. package/dist/messages.js +51 -9
  283. package/dist/messages.js.map +1 -1
  284. package/dist/metrics.cjs +278 -45
  285. package/dist/metrics.cjs.map +1 -1
  286. package/dist/metrics.d.cts +17 -7
  287. package/dist/metrics.d.cts.map +1 -1
  288. package/dist/metrics.d.ts +17 -7
  289. package/dist/metrics.d.ts.map +1 -1
  290. package/dist/metrics.js +270 -29
  291. package/dist/metrics.js.map +1 -1
  292. package/dist/moderation.cjs +10 -1
  293. package/dist/moderation.cjs.map +1 -1
  294. package/dist/moderation.d.cts.map +1 -1
  295. package/dist/moderation.d.ts.map +1 -1
  296. package/dist/moderation.js +10 -1
  297. package/dist/moderation.js.map +1 -1
  298. package/dist/ollama.cjs +10 -6
  299. package/dist/ollama.cjs.map +1 -1
  300. package/dist/ollama.d.cts.map +1 -1
  301. package/dist/ollama.d.ts.map +1 -1
  302. package/dist/ollama.js +11 -7
  303. package/dist/ollama.js.map +1 -1
  304. package/dist/openapi.cjs +3405 -0
  305. package/dist/openapi.cjs.map +1 -0
  306. package/dist/openapi.d.cts +30 -0
  307. package/dist/openapi.d.cts.map +1 -0
  308. package/dist/openapi.d.ts +30 -0
  309. package/dist/openapi.d.ts.map +1 -0
  310. package/dist/openapi.js +3404 -0
  311. package/dist/openapi.js.map +1 -0
  312. package/dist/openrouter-video.cjs +9 -9
  313. package/dist/openrouter-video.cjs.map +1 -1
  314. package/dist/openrouter-video.d.cts.map +1 -1
  315. package/dist/openrouter-video.d.ts.map +1 -1
  316. package/dist/openrouter-video.js +10 -10
  317. package/dist/openrouter-video.js.map +1 -1
  318. package/dist/recorder.cjs +54 -10
  319. package/dist/recorder.cjs.map +1 -1
  320. package/dist/recorder.d.cts.map +1 -1
  321. package/dist/recorder.d.ts.map +1 -1
  322. package/dist/recorder.js +52 -12
  323. package/dist/recorder.js.map +1 -1
  324. package/dist/responses.cjs +47 -7
  325. package/dist/responses.cjs.map +1 -1
  326. package/dist/responses.d.cts.map +1 -1
  327. package/dist/responses.d.ts.map +1 -1
  328. package/dist/responses.js +48 -9
  329. package/dist/responses.js.map +1 -1
  330. package/dist/route-registry.cjs +951 -0
  331. package/dist/route-registry.cjs.map +1 -0
  332. package/dist/route-registry.d.cts +33 -0
  333. package/dist/route-registry.d.cts.map +1 -0
  334. package/dist/route-registry.d.ts +33 -0
  335. package/dist/route-registry.d.ts.map +1 -0
  336. package/dist/route-registry.js +866 -0
  337. package/dist/route-registry.js.map +1 -0
  338. package/dist/router.cjs +21 -34
  339. package/dist/router.cjs.map +1 -1
  340. package/dist/router.d.cts +4 -1
  341. package/dist/router.d.cts.map +1 -1
  342. package/dist/router.d.ts +4 -1
  343. package/dist/router.d.ts.map +1 -1
  344. package/dist/router.js +21 -35
  345. package/dist/router.js.map +1 -1
  346. package/dist/server.cjs +1252 -777
  347. package/dist/server.cjs.map +1 -1
  348. package/dist/server.d.cts +5 -1
  349. package/dist/server.d.cts.map +1 -1
  350. package/dist/server.d.ts +5 -1
  351. package/dist/server.d.ts.map +1 -1
  352. package/dist/server.js +1185 -710
  353. package/dist/server.js.map +1 -1
  354. package/dist/speech.cjs +6 -4
  355. package/dist/speech.cjs.map +1 -1
  356. package/dist/speech.js +7 -5
  357. package/dist/speech.js.map +1 -1
  358. package/dist/suite.cjs +1 -1
  359. package/dist/suite.js +1 -1
  360. package/dist/transcription.cjs +6 -6
  361. package/dist/transcription.cjs.map +1 -1
  362. package/dist/transcription.d.cts.map +1 -1
  363. package/dist/transcription.d.ts.map +1 -1
  364. package/dist/transcription.js +7 -7
  365. package/dist/transcription.js.map +1 -1
  366. package/dist/types.cjs +18 -0
  367. package/dist/types.cjs.map +1 -0
  368. package/dist/types.d.cts +320 -17
  369. package/dist/types.d.cts.map +1 -1
  370. package/dist/types.d.ts +320 -17
  371. package/dist/types.d.ts.map +1 -1
  372. package/dist/types.js +17 -0
  373. package/dist/types.js.map +1 -0
  374. package/dist/validate-cli.cjs +983 -0
  375. package/dist/validate-cli.cjs.map +1 -0
  376. package/dist/validate-cli.js +982 -0
  377. package/dist/validate-cli.js.map +1 -0
  378. package/dist/vector-stores.cjs +1180 -0
  379. package/dist/vector-stores.cjs.map +1 -0
  380. package/dist/vector-stores.d.cts +106 -0
  381. package/dist/vector-stores.d.cts.map +1 -0
  382. package/dist/vector-stores.d.ts +106 -0
  383. package/dist/vector-stores.d.ts.map +1 -0
  384. package/dist/vector-stores.js +1164 -0
  385. package/dist/vector-stores.js.map +1 -0
  386. package/dist/vector-types.d.cts.map +1 -1
  387. package/dist/vector-types.d.ts.map +1 -1
  388. package/dist/veo-video.cjs +13 -13
  389. package/dist/veo-video.cjs.map +1 -1
  390. package/dist/veo-video.js +14 -14
  391. package/dist/veo-video.js.map +1 -1
  392. package/dist/video.cjs +23 -4
  393. package/dist/video.cjs.map +1 -1
  394. package/dist/video.d.cts +1 -1
  395. package/dist/video.d.cts.map +1 -1
  396. package/dist/video.d.ts +1 -1
  397. package/dist/video.d.ts.map +1 -1
  398. package/dist/video.js +24 -5
  399. package/dist/video.js.map +1 -1
  400. package/dist/vitest.cjs +23 -11
  401. package/dist/vitest.cjs.map +1 -1
  402. package/dist/vitest.d.cts +5 -2
  403. package/dist/vitest.d.cts.map +1 -1
  404. package/dist/vitest.d.ts +5 -2
  405. package/dist/vitest.d.ts.map +1 -1
  406. package/dist/vitest.js +25 -13
  407. package/dist/vitest.js.map +1 -1
  408. package/dist/watcher.cjs +2 -1
  409. package/dist/watcher.cjs.map +1 -1
  410. package/dist/watcher.js +2 -1
  411. package/dist/watcher.js.map +1 -1
  412. package/dist/ws-framing.cjs +150 -35
  413. package/dist/ws-framing.cjs.map +1 -1
  414. package/dist/ws-framing.d.cts +18 -3
  415. package/dist/ws-framing.d.cts.map +1 -1
  416. package/dist/ws-framing.d.ts +18 -3
  417. package/dist/ws-framing.d.ts.map +1 -1
  418. package/dist/ws-framing.js +151 -36
  419. package/dist/ws-framing.js.map +1 -1
  420. package/dist/ws-gemini-live.cjs +2 -2
  421. package/dist/ws-gemini-live.js +2 -2
  422. package/dist/ws-live.cjs +401 -0
  423. package/dist/ws-live.cjs.map +1 -0
  424. package/dist/ws-live.js +400 -0
  425. package/dist/ws-live.js.map +1 -0
  426. package/dist/ws-realtime.cjs +46 -2
  427. package/dist/ws-realtime.cjs.map +1 -1
  428. package/dist/ws-realtime.d.cts.map +1 -1
  429. package/dist/ws-realtime.d.ts.map +1 -1
  430. package/dist/ws-realtime.js +46 -2
  431. package/dist/ws-realtime.js.map +1 -1
  432. package/dist/ws-responses.cjs +16 -4
  433. package/dist/ws-responses.cjs.map +1 -1
  434. package/dist/ws-responses.js +16 -4
  435. package/dist/ws-responses.js.map +1 -1
  436. package/dist/ws-upstream.cjs +118 -0
  437. package/dist/ws-upstream.cjs.map +1 -0
  438. package/dist/ws-upstream.js +115 -0
  439. package/dist/ws-upstream.js.map +1 -0
  440. package/fixtures/openai-live-client.json +390 -0
  441. package/fixtures/openai-live-managed.json +709 -0
  442. package/package.json +4 -1
@@ -0,0 +1,3404 @@
1
+ import { COHERE_CHAT_PATH, COHERE_EMBED_PATH, COMPLETIONS_PATH, EMBEDDINGS_PATH, IMAGES_PATH, MESSAGES_PATH, MODELS_PATH, MODERATIONS_PATH, RERANK_PATH, RESPONSES_PATH, ROUTE_DEFINITIONS, SEARCH_PATH, SPEECH_PATH } from "./route-registry.js";
2
+
3
+ //#region src/openapi.ts
4
+ /**
5
+ * Machine-readable route catalog for aimock.
6
+ *
7
+ * `GET /__aimock/openapi.json` returns an OpenAPI 3.1 document and
8
+ * `GET /__aimock/routes` returns the same list in a `{ count, routes }` object for
9
+ * shells that just need `method + path`. SDK codegen, docs checks, and
10
+ * harness smoke tests can assert against this instead of hard-coding a
11
+ * route list that drifts.
12
+ *
13
+ * The catalog is DERIVED from the router's single source of truth
14
+ * (`route-registry.ts`, which `server.ts` also imports for dispatch and
15
+ * `metrics.ts` imports for path labels), so it cannot drift from the mounted
16
+ * routes. Every operation carries a real `requestBody` / `responses` schema
17
+ * (or an explicit non-JSON media type for audio/binary bodies) — a client can
18
+ * build requests from this document, not just read paths off it.
19
+ */
20
+ /** Flat `method + path` list, derived from the router registry. */
21
+ const CATALOG_ROUTES = ROUTE_DEFINITIONS.map((r) => ({
22
+ method: r.method,
23
+ path: r.path,
24
+ service: r.service,
25
+ description: r.description
26
+ }));
27
+ function pathParams(openApiPath) {
28
+ const params = [];
29
+ for (const match of openApiPath.matchAll(/\{([^}]+)\}/g)) params.push({
30
+ name: match[1],
31
+ in: "path",
32
+ required: true,
33
+ schema: { type: "string" }
34
+ });
35
+ return params;
36
+ }
37
+ const COMPONENTS = {
38
+ ChatCompletionRequest: {
39
+ type: "object",
40
+ required: ["model", "messages"],
41
+ properties: {
42
+ model: {
43
+ type: "string",
44
+ description: "Model ID"
45
+ },
46
+ messages: {
47
+ type: "array",
48
+ items: {
49
+ type: "object",
50
+ required: ["role", "content"],
51
+ properties: {
52
+ role: {
53
+ type: "string",
54
+ enum: [
55
+ "system",
56
+ "user",
57
+ "assistant",
58
+ "tool"
59
+ ]
60
+ },
61
+ content: { oneOf: [
62
+ { type: "null" },
63
+ { type: "string" },
64
+ {
65
+ type: "array",
66
+ items: {
67
+ type: "object",
68
+ required: ["type"],
69
+ properties: {
70
+ type: {
71
+ type: "string",
72
+ enum: [
73
+ "text",
74
+ "image_url",
75
+ "input_audio",
76
+ "file"
77
+ ]
78
+ },
79
+ text: { type: "string" },
80
+ image_url: {
81
+ type: "object",
82
+ properties: {
83
+ url: { type: "string" },
84
+ detail: { type: "string" }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ] },
91
+ name: { type: "string" },
92
+ tool_calls: {
93
+ type: "array",
94
+ items: {
95
+ type: "object",
96
+ required: [
97
+ "id",
98
+ "type",
99
+ "function"
100
+ ],
101
+ properties: {
102
+ id: { type: "string" },
103
+ type: {
104
+ type: "string",
105
+ enum: ["function"]
106
+ },
107
+ function: {
108
+ type: "object",
109
+ required: ["name", "arguments"],
110
+ properties: {
111
+ name: { type: "string" },
112
+ arguments: { type: "string" }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ },
118
+ tool_call_id: { type: "string" }
119
+ }
120
+ }
121
+ },
122
+ stream: { type: "boolean" },
123
+ temperature: { type: "number" },
124
+ top_p: { type: "number" },
125
+ max_tokens: { type: "integer" },
126
+ max_completion_tokens: { type: "integer" },
127
+ tools: {
128
+ type: "array",
129
+ items: {
130
+ type: "object",
131
+ required: ["type", "function"],
132
+ properties: {
133
+ type: {
134
+ type: "string",
135
+ enum: ["function"]
136
+ },
137
+ function: {
138
+ type: "object",
139
+ required: ["name"],
140
+ properties: {
141
+ name: { type: "string" },
142
+ description: { type: "string" },
143
+ parameters: { type: "object" }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ tool_choice: { oneOf: [{
150
+ type: "string",
151
+ enum: [
152
+ "none",
153
+ "auto",
154
+ "required"
155
+ ]
156
+ }, {
157
+ type: "object",
158
+ required: ["type", "function"],
159
+ properties: {
160
+ type: {
161
+ type: "string",
162
+ enum: ["function"]
163
+ },
164
+ function: {
165
+ type: "object",
166
+ properties: { name: { type: "string" } }
167
+ }
168
+ }
169
+ }] },
170
+ response_format: {
171
+ type: "object",
172
+ properties: {
173
+ type: {
174
+ type: "string",
175
+ enum: [
176
+ "text",
177
+ "json_object",
178
+ "json_schema"
179
+ ]
180
+ },
181
+ json_schema: { type: "object" }
182
+ }
183
+ },
184
+ seed: { type: "integer" },
185
+ stop: { oneOf: [{ type: "string" }, {
186
+ type: "array",
187
+ items: { type: "string" }
188
+ }] }
189
+ }
190
+ },
191
+ ChatCompletionEventStream: {
192
+ type: "string",
193
+ description: "When stream:true, SSE frames contain data: followed by a JSON ChatCompletionChunk and a blank line. The final frame is data: [DONE] followed by a blank line. x-sse-data-schema describes each JSON data payload, not the complete stream.",
194
+ "x-sse-data-schema": { $ref: "#/components/schemas/ChatCompletionChunk" }
195
+ },
196
+ ChatCompletionChunk: {
197
+ type: "object",
198
+ required: [
199
+ "id",
200
+ "object",
201
+ "created",
202
+ "model",
203
+ "choices"
204
+ ],
205
+ properties: {
206
+ id: { type: "string" },
207
+ object: {
208
+ type: "string",
209
+ enum: ["chat.completion.chunk"]
210
+ },
211
+ created: { type: "integer" },
212
+ model: { type: "string" },
213
+ choices: {
214
+ type: "array",
215
+ items: {
216
+ type: "object",
217
+ required: [
218
+ "index",
219
+ "delta",
220
+ "finish_reason"
221
+ ],
222
+ properties: {
223
+ index: { type: "integer" },
224
+ delta: {
225
+ type: "object",
226
+ properties: {
227
+ role: { type: "string" },
228
+ content: { type: ["string", "null"] },
229
+ reasoning_content: { type: "string" },
230
+ tool_calls: {
231
+ type: "array",
232
+ items: {
233
+ type: "object",
234
+ required: ["index"],
235
+ properties: {
236
+ index: { type: "integer" },
237
+ id: { type: "string" },
238
+ type: {
239
+ type: "string",
240
+ enum: ["function"]
241
+ },
242
+ function: {
243
+ type: "object",
244
+ properties: {
245
+ name: { type: "string" },
246
+ arguments: { type: "string" }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+ }
253
+ },
254
+ finish_reason: { type: ["string", "null"] }
255
+ }
256
+ }
257
+ }
258
+ }
259
+ },
260
+ ChatCompletionResponse: {
261
+ type: "object",
262
+ required: [
263
+ "id",
264
+ "object",
265
+ "created",
266
+ "model",
267
+ "choices"
268
+ ],
269
+ properties: {
270
+ id: { type: "string" },
271
+ object: {
272
+ type: "string",
273
+ enum: ["chat.completion"]
274
+ },
275
+ created: { type: "integer" },
276
+ model: { type: "string" },
277
+ choices: {
278
+ type: "array",
279
+ items: {
280
+ type: "object",
281
+ required: [
282
+ "index",
283
+ "message",
284
+ "finish_reason"
285
+ ],
286
+ properties: {
287
+ index: { type: "integer" },
288
+ message: {
289
+ type: "object",
290
+ required: ["role", "content"],
291
+ properties: {
292
+ role: { type: "string" },
293
+ content: { type: ["string", "null"] },
294
+ tool_calls: {
295
+ type: "array",
296
+ items: {
297
+ type: "object",
298
+ properties: {
299
+ id: { type: "string" },
300
+ type: { type: "string" },
301
+ function: {
302
+ type: "object",
303
+ properties: {
304
+ name: { type: "string" },
305
+ arguments: { type: "string" }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ },
313
+ finish_reason: {
314
+ type: ["string", "null"],
315
+ enum: [
316
+ "stop",
317
+ "length",
318
+ "tool_calls",
319
+ "content_filter",
320
+ null
321
+ ]
322
+ }
323
+ }
324
+ }
325
+ },
326
+ usage: {
327
+ type: "object",
328
+ properties: {
329
+ prompt_tokens: { type: "integer" },
330
+ completion_tokens: { type: "integer" },
331
+ total_tokens: { type: "integer" }
332
+ }
333
+ }
334
+ }
335
+ },
336
+ ResponsesRequest: {
337
+ type: "object",
338
+ required: ["model", "input"],
339
+ properties: {
340
+ model: {
341
+ type: "string",
342
+ description: "Model ID"
343
+ },
344
+ input: { oneOf: [{ type: "string" }, {
345
+ type: "array",
346
+ items: {
347
+ type: "object",
348
+ required: ["role", "content"],
349
+ properties: {
350
+ role: { type: "string" },
351
+ content: { type: "string" }
352
+ }
353
+ }
354
+ }] },
355
+ stream: { type: "boolean" },
356
+ instructions: { type: "string" },
357
+ max_output_tokens: { type: "integer" },
358
+ temperature: { type: "number" },
359
+ tools: {
360
+ type: "array",
361
+ items: {
362
+ type: "object",
363
+ required: ["type"],
364
+ properties: {
365
+ type: { type: "string" },
366
+ name: { type: "string" }
367
+ }
368
+ }
369
+ },
370
+ tool_choice: { type: "string" }
371
+ }
372
+ },
373
+ ResponsesResponse: {
374
+ type: "object",
375
+ properties: {
376
+ id: { type: "string" },
377
+ object: {
378
+ type: "string",
379
+ enum: ["response"]
380
+ },
381
+ created_at: { type: "integer" },
382
+ model: { type: "string" },
383
+ status: { type: "string" },
384
+ output: {
385
+ type: "array",
386
+ items: {
387
+ type: "object",
388
+ required: ["type"],
389
+ properties: {
390
+ type: { type: "string" },
391
+ id: { type: "string" },
392
+ status: { type: "string" },
393
+ role: { type: "string" },
394
+ content: {
395
+ type: "array",
396
+ items: {
397
+ type: "object",
398
+ properties: {
399
+ type: { type: "string" },
400
+ text: { type: "string" }
401
+ }
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ usage: {
408
+ type: "object",
409
+ properties: {
410
+ input_tokens: { type: "integer" },
411
+ output_tokens: { type: "integer" },
412
+ total_tokens: { type: "integer" }
413
+ }
414
+ }
415
+ }
416
+ },
417
+ MessagesRequest: {
418
+ type: "object",
419
+ required: [
420
+ "model",
421
+ "messages",
422
+ "max_tokens"
423
+ ],
424
+ properties: {
425
+ model: {
426
+ type: "string",
427
+ description: "Model ID"
428
+ },
429
+ messages: {
430
+ type: "array",
431
+ items: {
432
+ type: "object",
433
+ required: ["role", "content"],
434
+ properties: {
435
+ role: {
436
+ type: "string",
437
+ enum: ["user", "assistant"]
438
+ },
439
+ content: { oneOf: [{ type: "string" }, {
440
+ type: "array",
441
+ items: {
442
+ type: "object",
443
+ required: ["type"],
444
+ properties: {
445
+ type: {
446
+ type: "string",
447
+ enum: [
448
+ "text",
449
+ "image",
450
+ "tool_use",
451
+ "tool_result",
452
+ "thinking"
453
+ ]
454
+ },
455
+ text: { type: "string" },
456
+ id: { type: "string" },
457
+ name: { type: "string" },
458
+ input: { type: "object" }
459
+ }
460
+ }
461
+ }] }
462
+ }
463
+ }
464
+ },
465
+ max_tokens: { type: "integer" },
466
+ system: { type: "string" },
467
+ temperature: { type: "number" },
468
+ top_p: { type: "number" },
469
+ stream: { type: "boolean" },
470
+ stop_sequences: {
471
+ type: "array",
472
+ items: { type: "string" }
473
+ },
474
+ tools: {
475
+ type: "array",
476
+ items: {
477
+ type: "object",
478
+ required: ["name", "input_schema"],
479
+ properties: {
480
+ name: { type: "string" },
481
+ description: { type: "string" },
482
+ input_schema: { type: "object" }
483
+ }
484
+ }
485
+ },
486
+ tool_choice: { type: "object" }
487
+ }
488
+ },
489
+ MessagesResponse: {
490
+ type: "object",
491
+ required: [
492
+ "id",
493
+ "type",
494
+ "role",
495
+ "content",
496
+ "model",
497
+ "stop_reason",
498
+ "usage"
499
+ ],
500
+ properties: {
501
+ id: { type: "string" },
502
+ type: {
503
+ type: "string",
504
+ enum: ["message"]
505
+ },
506
+ role: {
507
+ type: "string",
508
+ enum: ["assistant"]
509
+ },
510
+ content: {
511
+ type: "array",
512
+ items: {
513
+ type: "object",
514
+ required: ["type"],
515
+ properties: {
516
+ type: {
517
+ type: "string",
518
+ enum: ["text", "tool_use"]
519
+ },
520
+ text: { type: "string" },
521
+ id: { type: "string" },
522
+ name: { type: "string" },
523
+ input: { type: "object" }
524
+ }
525
+ }
526
+ },
527
+ model: { type: "string" },
528
+ stop_reason: {
529
+ type: ["string", "null"],
530
+ enum: [
531
+ "end_turn",
532
+ "max_tokens",
533
+ "stop_sequence",
534
+ "tool_use",
535
+ null
536
+ ]
537
+ },
538
+ usage: {
539
+ type: "object",
540
+ required: ["input_tokens", "output_tokens"],
541
+ properties: {
542
+ input_tokens: { type: "integer" },
543
+ output_tokens: { type: "integer" }
544
+ }
545
+ }
546
+ }
547
+ },
548
+ EmbeddingRequest: {
549
+ type: "object",
550
+ required: ["model", "input"],
551
+ properties: {
552
+ model: {
553
+ type: "string",
554
+ description: "Model ID"
555
+ },
556
+ input: { oneOf: [
557
+ { type: "string" },
558
+ {
559
+ type: "array",
560
+ items: { type: "string" }
561
+ },
562
+ {
563
+ type: "array",
564
+ items: { type: "integer" }
565
+ },
566
+ {
567
+ type: "array",
568
+ items: {
569
+ type: "array",
570
+ items: { type: "integer" }
571
+ }
572
+ }
573
+ ] },
574
+ encoding_format: {
575
+ type: "string",
576
+ enum: ["float", "base64"]
577
+ },
578
+ dimensions: { type: "integer" }
579
+ }
580
+ },
581
+ EmbeddingResponse: {
582
+ type: "object",
583
+ properties: {
584
+ object: {
585
+ type: "string",
586
+ enum: ["list"]
587
+ },
588
+ data: {
589
+ type: "array",
590
+ items: {
591
+ type: "object",
592
+ required: [
593
+ "object",
594
+ "index",
595
+ "embedding"
596
+ ],
597
+ properties: {
598
+ object: {
599
+ type: "string",
600
+ enum: ["embedding"]
601
+ },
602
+ index: { type: "integer" },
603
+ embedding: {
604
+ type: "array",
605
+ items: { type: "number" }
606
+ }
607
+ }
608
+ }
609
+ },
610
+ model: { type: "string" },
611
+ usage: {
612
+ type: "object",
613
+ properties: {
614
+ prompt_tokens: { type: "integer" },
615
+ total_tokens: { type: "integer" }
616
+ }
617
+ }
618
+ }
619
+ },
620
+ CohereChatRequest: {
621
+ type: "object",
622
+ required: ["model", "messages"],
623
+ properties: {
624
+ model: {
625
+ type: "string",
626
+ description: "Model ID"
627
+ },
628
+ messages: {
629
+ type: "array",
630
+ items: {
631
+ type: "object",
632
+ required: ["role", "content"],
633
+ properties: {
634
+ role: {
635
+ type: "string",
636
+ enum: [
637
+ "system",
638
+ "user",
639
+ "assistant",
640
+ "tool"
641
+ ]
642
+ },
643
+ content: { type: "string" },
644
+ tool_calls: {
645
+ type: "array",
646
+ items: { type: "object" }
647
+ },
648
+ tool_plan: { type: "string" }
649
+ }
650
+ }
651
+ },
652
+ temperature: { type: "number" },
653
+ max_tokens: { type: "integer" },
654
+ stream: { type: "boolean" },
655
+ tools: {
656
+ type: "array",
657
+ items: { type: "object" }
658
+ },
659
+ documents: {
660
+ type: "array",
661
+ items: { type: "object" }
662
+ }
663
+ }
664
+ },
665
+ CohereChatResponse: {
666
+ type: "object",
667
+ properties: {
668
+ id: { type: "string" },
669
+ finish_reason: { type: "string" },
670
+ message: {
671
+ type: "object",
672
+ properties: {
673
+ role: {
674
+ type: "string",
675
+ enum: ["assistant"]
676
+ },
677
+ content: {
678
+ type: "array",
679
+ items: {
680
+ type: "object",
681
+ properties: {
682
+ type: { type: "string" },
683
+ text: { type: "string" }
684
+ }
685
+ }
686
+ },
687
+ tool_calls: {
688
+ type: "array",
689
+ items: { type: "object" }
690
+ }
691
+ }
692
+ },
693
+ usage: {
694
+ type: "object",
695
+ properties: { billed_units: {
696
+ type: "object",
697
+ properties: {
698
+ input_tokens: { type: "integer" },
699
+ output_tokens: { type: "integer" }
700
+ }
701
+ } }
702
+ }
703
+ }
704
+ },
705
+ CohereEmbedRequest: {
706
+ type: "object",
707
+ required: ["model", "texts"],
708
+ properties: {
709
+ model: {
710
+ type: "string",
711
+ description: "Model ID"
712
+ },
713
+ texts: {
714
+ type: "array",
715
+ items: { type: "string" }
716
+ },
717
+ input_type: {
718
+ type: "string",
719
+ enum: [
720
+ "search_document",
721
+ "search_query",
722
+ "classification",
723
+ "clustering"
724
+ ]
725
+ },
726
+ embedding_types: {
727
+ type: "array",
728
+ items: { type: "string" }
729
+ }
730
+ }
731
+ },
732
+ CohereEmbedResponse: {
733
+ type: "object",
734
+ properties: {
735
+ id: { type: "string" },
736
+ embeddings: {
737
+ type: "array",
738
+ items: {
739
+ type: "array",
740
+ items: { type: "number" }
741
+ }
742
+ },
743
+ texts: {
744
+ type: "array",
745
+ items: { type: "string" }
746
+ },
747
+ meta: {
748
+ type: "object",
749
+ properties: { billed_units: {
750
+ type: "object",
751
+ properties: {
752
+ input_tokens: { type: "integer" },
753
+ output_tokens: { type: "integer" }
754
+ }
755
+ } }
756
+ }
757
+ }
758
+ },
759
+ OllamaChatRequest: {
760
+ type: "object",
761
+ required: ["model", "messages"],
762
+ properties: {
763
+ model: { type: "string" },
764
+ messages: {
765
+ type: "array",
766
+ items: {
767
+ type: "object",
768
+ required: ["role", "content"],
769
+ properties: {
770
+ role: { type: "string" },
771
+ content: { type: "string" },
772
+ images: {
773
+ type: "array",
774
+ items: { type: "string" }
775
+ },
776
+ tool_calls: {
777
+ type: "array",
778
+ items: { type: "object" }
779
+ }
780
+ }
781
+ }
782
+ },
783
+ stream: { type: "boolean" },
784
+ format: { type: "string" },
785
+ options: { type: "object" },
786
+ tools: {
787
+ type: "array",
788
+ items: { type: "object" }
789
+ }
790
+ }
791
+ },
792
+ OllamaChatResponse: {
793
+ type: "object",
794
+ properties: {
795
+ model: { type: "string" },
796
+ created_at: { type: "string" },
797
+ message: {
798
+ type: "object",
799
+ properties: {
800
+ role: { type: "string" },
801
+ content: { type: "string" },
802
+ tool_calls: {
803
+ type: "array",
804
+ items: { type: "object" }
805
+ }
806
+ }
807
+ },
808
+ done: { type: "boolean" },
809
+ done_reason: { type: "string" }
810
+ }
811
+ },
812
+ OllamaGenerateRequest: {
813
+ type: "object",
814
+ required: ["model", "prompt"],
815
+ properties: {
816
+ model: { type: "string" },
817
+ prompt: { type: "string" },
818
+ suffix: { type: "string" },
819
+ system: { type: "string" },
820
+ stream: { type: "boolean" },
821
+ format: { type: "string" },
822
+ options: { type: "object" }
823
+ }
824
+ },
825
+ OllamaGenerateResponse: {
826
+ type: "object",
827
+ properties: {
828
+ model: { type: "string" },
829
+ created_at: { type: "string" },
830
+ response: { type: "string" },
831
+ done: { type: "boolean" },
832
+ done_reason: { type: "string" }
833
+ }
834
+ },
835
+ OllamaEmbedRequest: {
836
+ type: "object",
837
+ required: ["model"],
838
+ anyOf: [{
839
+ required: ["prompt"],
840
+ properties: { prompt: { not: { type: "null" } } }
841
+ }, {
842
+ required: ["input"],
843
+ properties: { input: { not: { type: "null" } } }
844
+ }],
845
+ properties: {
846
+ model: { type: "string" },
847
+ prompt: { type: ["string", "null"] },
848
+ input: { anyOf: [
849
+ { type: "null" },
850
+ { type: "string" },
851
+ {
852
+ type: "array",
853
+ items: { type: "string" }
854
+ },
855
+ {
856
+ type: "array",
857
+ items: { type: "number" }
858
+ },
859
+ {
860
+ type: "array",
861
+ items: {
862
+ type: "array",
863
+ items: { type: "number" }
864
+ }
865
+ }
866
+ ] }
867
+ }
868
+ },
869
+ OllamaEmbedResponse: {
870
+ type: "object",
871
+ required: ["model", "embedding"],
872
+ properties: {
873
+ model: { type: "string" },
874
+ embedding: {
875
+ type: "array",
876
+ items: { type: "number" }
877
+ }
878
+ }
879
+ },
880
+ OllamaTagsResponse: {
881
+ type: "object",
882
+ properties: { models: {
883
+ type: "array",
884
+ items: {
885
+ type: "object",
886
+ properties: {
887
+ name: { type: "string" },
888
+ model: { type: "string" },
889
+ modified_at: { type: "string" },
890
+ size: { type: "integer" },
891
+ digest: { type: "string" },
892
+ details: { type: "object" }
893
+ }
894
+ }
895
+ } }
896
+ },
897
+ ImageGenerationRequest: {
898
+ type: "object",
899
+ required: ["prompt"],
900
+ properties: {
901
+ prompt: { type: "string" },
902
+ model: { type: "string" },
903
+ size: { type: "string" },
904
+ quality: { type: "string" },
905
+ style: {
906
+ type: "string",
907
+ enum: ["vivid", "natural"]
908
+ },
909
+ n: { type: "integer" },
910
+ response_format: {
911
+ type: "string",
912
+ enum: ["url", "b64_json"]
913
+ }
914
+ }
915
+ },
916
+ ImageEditRequest: {
917
+ type: "object",
918
+ required: ["image", "prompt"],
919
+ properties: {
920
+ image: {
921
+ type: "string",
922
+ format: "binary",
923
+ description: "Image to edit (multipart file)"
924
+ },
925
+ prompt: { type: "string" },
926
+ mask: {
927
+ type: "string",
928
+ format: "binary",
929
+ description: "Edit mask (multipart file)"
930
+ },
931
+ model: { type: "string" },
932
+ size: { type: "string" },
933
+ n: { type: "integer" },
934
+ response_format: {
935
+ type: "string",
936
+ enum: ["url", "b64_json"]
937
+ }
938
+ }
939
+ },
940
+ ImageResponse: {
941
+ type: "object",
942
+ properties: {
943
+ created: { type: "integer" },
944
+ data: {
945
+ type: "array",
946
+ items: {
947
+ type: "object",
948
+ properties: {
949
+ url: { type: "string" },
950
+ b64_json: { type: "string" },
951
+ revised_prompt: { type: "string" }
952
+ }
953
+ }
954
+ }
955
+ }
956
+ },
957
+ SpeechRequest: {
958
+ type: "object",
959
+ required: ["model", "input"],
960
+ properties: {
961
+ model: {
962
+ type: "string",
963
+ description: "Model ID"
964
+ },
965
+ input: {
966
+ type: "string",
967
+ description: "Text to synthesize"
968
+ },
969
+ voice: { type: "string" },
970
+ speed: { type: "number" },
971
+ response_format: {
972
+ type: "string",
973
+ enum: [
974
+ "mp3",
975
+ "opus",
976
+ "aac",
977
+ "flac",
978
+ "wav",
979
+ "pcm"
980
+ ]
981
+ },
982
+ instructions: { type: "string" }
983
+ }
984
+ },
985
+ TranscriptionRequest: {
986
+ type: "object",
987
+ required: ["file", "model"],
988
+ properties: {
989
+ file: {
990
+ type: "string",
991
+ format: "binary",
992
+ description: "Audio file (multipart)"
993
+ },
994
+ model: { type: "string" },
995
+ language: { type: "string" },
996
+ response_format: {
997
+ type: "string",
998
+ enum: [
999
+ "json",
1000
+ "text",
1001
+ "srt",
1002
+ "vtt"
1003
+ ]
1004
+ },
1005
+ temperature: { type: "number" }
1006
+ }
1007
+ },
1008
+ TranscriptionResponse: {
1009
+ type: "object",
1010
+ required: ["text"],
1011
+ properties: {
1012
+ text: { type: "string" },
1013
+ language: { type: "string" },
1014
+ duration: { type: "number" }
1015
+ }
1016
+ },
1017
+ ModerationRequest: {
1018
+ type: "object",
1019
+ required: ["input"],
1020
+ properties: {
1021
+ input: { oneOf: [{ type: "string" }, {
1022
+ type: "array",
1023
+ items: { type: "string" }
1024
+ }] },
1025
+ model: { type: "string" }
1026
+ }
1027
+ },
1028
+ ModerationResponse: {
1029
+ type: "object",
1030
+ properties: {
1031
+ id: { type: "string" },
1032
+ model: { type: "string" },
1033
+ results: {
1034
+ type: "array",
1035
+ items: {
1036
+ type: "object",
1037
+ required: [
1038
+ "flagged",
1039
+ "categories",
1040
+ "category_scores"
1041
+ ],
1042
+ properties: {
1043
+ flagged: { type: "boolean" },
1044
+ categories: {
1045
+ type: "object",
1046
+ properties: {
1047
+ sexual: { type: "boolean" },
1048
+ hate: { type: "boolean" },
1049
+ harassment: { type: "boolean" },
1050
+ "self-harm": { type: "boolean" },
1051
+ "sexual/minors": { type: "boolean" },
1052
+ "hate/threatening": { type: "boolean" },
1053
+ "violence/graphic": { type: "boolean" },
1054
+ "self-harm/intent": { type: "boolean" },
1055
+ "self-harm/instructions": { type: "boolean" },
1056
+ harassment_threatening: { type: "boolean" },
1057
+ violence: { type: "boolean" }
1058
+ }
1059
+ },
1060
+ category_scores: {
1061
+ type: "object",
1062
+ properties: {
1063
+ sexual: { type: "number" },
1064
+ hate: { type: "number" },
1065
+ harassment: { type: "number" },
1066
+ "self-harm": { type: "number" },
1067
+ "sexual/minors": { type: "number" },
1068
+ "hate/threatening": { type: "number" },
1069
+ "violence/graphic": { type: "number" },
1070
+ "self-harm/intent": { type: "number" },
1071
+ "self-harm/instructions": { type: "number" },
1072
+ harassment_threatening: { type: "number" },
1073
+ violence: { type: "number" }
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+ }
1080
+ },
1081
+ SearchRequest: {
1082
+ type: "object",
1083
+ required: ["query"],
1084
+ properties: {
1085
+ query: { type: "string" },
1086
+ max_results: { type: "integer" },
1087
+ search_depth: { type: "string" },
1088
+ include_answer: { type: "boolean" }
1089
+ }
1090
+ },
1091
+ SearchResponse: {
1092
+ type: "object",
1093
+ properties: {
1094
+ results: {
1095
+ type: "array",
1096
+ items: {
1097
+ type: "object",
1098
+ required: [
1099
+ "title",
1100
+ "url",
1101
+ "content"
1102
+ ],
1103
+ properties: {
1104
+ title: { type: "string" },
1105
+ url: { type: "string" },
1106
+ content: { type: "string" },
1107
+ score: { type: "number" }
1108
+ }
1109
+ }
1110
+ },
1111
+ answer: { type: "string" }
1112
+ }
1113
+ },
1114
+ RerankRequest: {
1115
+ type: "object",
1116
+ required: ["query", "documents"],
1117
+ properties: {
1118
+ model: { type: "string" },
1119
+ query: { type: "string" },
1120
+ documents: {
1121
+ type: "array",
1122
+ items: { oneOf: [{ type: "string" }, { type: "object" }] }
1123
+ },
1124
+ top_n: { type: "integer" },
1125
+ return_documents: { type: "boolean" }
1126
+ }
1127
+ },
1128
+ RerankResponse: {
1129
+ type: "object",
1130
+ properties: {
1131
+ id: { type: "string" },
1132
+ results: {
1133
+ type: "array",
1134
+ items: {
1135
+ type: "object",
1136
+ required: ["index", "relevance_score"],
1137
+ properties: {
1138
+ index: { type: "integer" },
1139
+ relevance_score: { type: "number" },
1140
+ document: { type: "object" }
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+ },
1146
+ GeminiGenerateRequest: {
1147
+ type: "object",
1148
+ required: ["contents"],
1149
+ properties: {
1150
+ contents: {
1151
+ type: "array",
1152
+ items: {
1153
+ type: "object",
1154
+ properties: {
1155
+ role: {
1156
+ type: "string",
1157
+ enum: ["user", "model"]
1158
+ },
1159
+ parts: {
1160
+ type: "array",
1161
+ items: {
1162
+ type: "object",
1163
+ properties: {
1164
+ text: { type: "string" },
1165
+ inlineData: {
1166
+ type: "object",
1167
+ properties: {
1168
+ mimeType: { type: "string" },
1169
+ data: { type: "string" }
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+ }
1176
+ }
1177
+ },
1178
+ generationConfig: {
1179
+ type: "object",
1180
+ properties: {
1181
+ temperature: { type: "number" },
1182
+ topP: { type: "number" },
1183
+ maxOutputTokens: { type: "integer" },
1184
+ stopSequences: {
1185
+ type: "array",
1186
+ items: { type: "string" }
1187
+ }
1188
+ }
1189
+ },
1190
+ safetySettings: {
1191
+ type: "array",
1192
+ items: { type: "object" }
1193
+ },
1194
+ tools: {
1195
+ type: "array",
1196
+ items: { type: "object" }
1197
+ }
1198
+ }
1199
+ },
1200
+ GeminiGenerateEventStream: {
1201
+ type: "string",
1202
+ description: "SSE frames contain data: followed by a JSON GeminiGenerateResponse and a blank line. Each payload carries candidates with content.parts; the final payload carries finishReason and usageMetadata. The stream ends at EOF without a [DONE] frame. x-sse-data-schema describes each JSON data payload, not the complete stream.",
1203
+ "x-sse-data-schema": { $ref: "#/components/schemas/GeminiGenerateResponse" }
1204
+ },
1205
+ GeminiGenerateResponse: {
1206
+ type: "object",
1207
+ properties: {
1208
+ candidates: {
1209
+ type: "array",
1210
+ items: {
1211
+ type: "object",
1212
+ properties: {
1213
+ index: { type: "integer" },
1214
+ content: {
1215
+ type: "object",
1216
+ properties: {
1217
+ role: { type: "string" },
1218
+ parts: {
1219
+ type: "array",
1220
+ items: {
1221
+ type: "object",
1222
+ properties: {
1223
+ text: { type: "string" },
1224
+ functionCall: { type: "object" }
1225
+ }
1226
+ }
1227
+ }
1228
+ }
1229
+ },
1230
+ finishReason: { type: "string" }
1231
+ }
1232
+ }
1233
+ },
1234
+ usageMetadata: {
1235
+ type: "object",
1236
+ properties: {
1237
+ promptTokenCount: { type: "integer" },
1238
+ candidatesTokenCount: { type: "integer" },
1239
+ totalTokenCount: { type: "integer" }
1240
+ }
1241
+ },
1242
+ modelVersion: { type: "string" }
1243
+ }
1244
+ },
1245
+ GeminiEmbedRequest: {
1246
+ type: "object",
1247
+ required: ["content"],
1248
+ properties: { content: {
1249
+ type: "object",
1250
+ properties: { parts: {
1251
+ type: "array",
1252
+ items: {
1253
+ type: "object",
1254
+ properties: { text: { type: "string" } }
1255
+ }
1256
+ } }
1257
+ } }
1258
+ },
1259
+ GeminiEmbedResponse: {
1260
+ type: "object",
1261
+ properties: { embedding: {
1262
+ type: "object",
1263
+ properties: { values: {
1264
+ type: "array",
1265
+ items: { type: "number" }
1266
+ } }
1267
+ } }
1268
+ },
1269
+ GeminiPredictRequest: {
1270
+ type: "object",
1271
+ required: ["instances"],
1272
+ properties: {
1273
+ instances: {
1274
+ type: "array",
1275
+ items: {
1276
+ type: "object",
1277
+ properties: { prompt: { type: "string" } }
1278
+ }
1279
+ },
1280
+ parameters: {
1281
+ type: "object",
1282
+ properties: {
1283
+ sampleCount: { type: "integer" },
1284
+ aspectRatio: { type: "string" },
1285
+ safetyFilterLevel: { type: "string" }
1286
+ }
1287
+ }
1288
+ }
1289
+ },
1290
+ GeminiPredictResponse: {
1291
+ type: "object",
1292
+ properties: { predictions: {
1293
+ type: "array",
1294
+ items: {
1295
+ type: "object",
1296
+ properties: {
1297
+ bytesBase64Encoded: { type: "string" },
1298
+ mimeType: { type: "string" }
1299
+ }
1300
+ }
1301
+ } }
1302
+ },
1303
+ InteractionsRequest: {
1304
+ type: "object",
1305
+ description: "Gemini Interactions input normalized for fixture matching; streams unless stream is false.",
1306
+ properties: {
1307
+ model: { type: "string" },
1308
+ input: {
1309
+ description: "Text, turns, steps, or content blocks normalized for fixture matching.",
1310
+ oneOf: [{ type: "string" }, {
1311
+ type: "array",
1312
+ items: { type: "object" }
1313
+ }]
1314
+ },
1315
+ system_instruction: { type: "string" },
1316
+ tools: {
1317
+ type: "array",
1318
+ items: { type: "object" }
1319
+ },
1320
+ generation_config: {
1321
+ type: "object",
1322
+ properties: {
1323
+ temperature: { type: "number" },
1324
+ max_output_tokens: { type: "integer" }
1325
+ }
1326
+ },
1327
+ stream: {
1328
+ type: "boolean",
1329
+ default: true
1330
+ },
1331
+ previous_interaction_id: { type: "string" }
1332
+ }
1333
+ },
1334
+ InteractionsResponse: {
1335
+ type: "object",
1336
+ description: "Nonstreaming Interactions response. output_text is omitted for tool-only responses.",
1337
+ required: [
1338
+ "id",
1339
+ "status",
1340
+ "model",
1341
+ "role",
1342
+ "steps",
1343
+ "usage"
1344
+ ],
1345
+ properties: {
1346
+ id: { type: "string" },
1347
+ status: {
1348
+ type: "string",
1349
+ enum: ["completed", "requires_action"]
1350
+ },
1351
+ model: { type: "string" },
1352
+ role: {
1353
+ type: "string",
1354
+ enum: ["model"]
1355
+ },
1356
+ output_text: { type: "string" },
1357
+ steps: {
1358
+ type: "array",
1359
+ items: {
1360
+ type: "object",
1361
+ properties: {
1362
+ type: {
1363
+ type: "string",
1364
+ enum: ["model_output", "function_call"]
1365
+ },
1366
+ content: {
1367
+ type: "array",
1368
+ items: { type: "object" }
1369
+ },
1370
+ id: { type: "string" },
1371
+ name: { type: "string" },
1372
+ arguments: {}
1373
+ }
1374
+ }
1375
+ },
1376
+ usage: {
1377
+ type: "object",
1378
+ properties: {
1379
+ total_input_tokens: { type: "number" },
1380
+ total_output_tokens: { type: "number" },
1381
+ total_tokens: { type: "number" }
1382
+ }
1383
+ }
1384
+ }
1385
+ },
1386
+ InteractionsSSEStream: {
1387
+ type: "string",
1388
+ description: "SSE data: JSON frames separated by a blank line, with no event: prefix or [DONE] sentinel. Event identity is in event_type; a complete stream ends with interaction.completed. Interruption may end the stream earlier.",
1389
+ "x-sse-data-schema": { $ref: "#/components/schemas/InteractionsSSEEvent" }
1390
+ },
1391
+ InteractionsSSEEvent: {
1392
+ type: "object",
1393
+ required: ["event_type", "event_id"],
1394
+ properties: {
1395
+ event_type: {
1396
+ type: "string",
1397
+ enum: [
1398
+ "interaction.created",
1399
+ "step.start",
1400
+ "step.delta",
1401
+ "step.stop",
1402
+ "interaction.completed"
1403
+ ]
1404
+ },
1405
+ event_id: { type: "string" },
1406
+ index: { type: "integer" },
1407
+ interaction: {
1408
+ type: "object",
1409
+ properties: {
1410
+ id: { type: "string" },
1411
+ status: {
1412
+ type: "string",
1413
+ enum: [
1414
+ "in_progress",
1415
+ "completed",
1416
+ "requires_action"
1417
+ ]
1418
+ },
1419
+ usage: { type: "object" }
1420
+ }
1421
+ },
1422
+ step: { type: "object" },
1423
+ delta: {
1424
+ type: "object",
1425
+ properties: {
1426
+ type: {
1427
+ type: "string",
1428
+ enum: ["text", "arguments_delta"]
1429
+ },
1430
+ text: { type: "string" },
1431
+ arguments: { type: "string" }
1432
+ }
1433
+ }
1434
+ }
1435
+ },
1436
+ BedrockInvokeRequest: {
1437
+ type: "object",
1438
+ description: "Model-dependent Bedrock invoke body (e.g. Anthropic Claude messages shape or Llama prompt shape); passed through to fixture matching."
1439
+ },
1440
+ BedrockInvokeResponse: {
1441
+ type: "object",
1442
+ description: "Model-dependent Bedrock invoke result, replayed from the matched fixture."
1443
+ },
1444
+ BedrockConverseRequest: {
1445
+ type: "object",
1446
+ required: ["messages"],
1447
+ properties: {
1448
+ messages: {
1449
+ type: "array",
1450
+ items: {
1451
+ type: "object",
1452
+ required: ["role", "content"],
1453
+ properties: {
1454
+ role: {
1455
+ type: "string",
1456
+ enum: ["user", "assistant"]
1457
+ },
1458
+ content: {
1459
+ type: "array",
1460
+ items: { type: "object" }
1461
+ }
1462
+ }
1463
+ }
1464
+ },
1465
+ system: {
1466
+ type: "array",
1467
+ items: { type: "object" }
1468
+ },
1469
+ inferenceConfig: {
1470
+ type: "object",
1471
+ properties: {
1472
+ maxTokens: { type: "integer" },
1473
+ temperature: { type: "number" },
1474
+ topP: { type: "number" },
1475
+ stopSequences: {
1476
+ type: "array",
1477
+ items: { type: "string" }
1478
+ }
1479
+ }
1480
+ },
1481
+ toolConfig: { type: "object" }
1482
+ }
1483
+ },
1484
+ BedrockConverseResponse: {
1485
+ type: "object",
1486
+ properties: {
1487
+ output: {
1488
+ type: "object",
1489
+ properties: { message: {
1490
+ type: "object",
1491
+ properties: {
1492
+ role: { type: "string" },
1493
+ content: {
1494
+ type: "array",
1495
+ items: { type: "object" }
1496
+ }
1497
+ }
1498
+ } }
1499
+ },
1500
+ stopReason: { type: "string" },
1501
+ usage: {
1502
+ type: "object",
1503
+ properties: {
1504
+ inputTokens: { type: "integer" },
1505
+ outputTokens: { type: "integer" },
1506
+ totalTokens: { type: "integer" }
1507
+ }
1508
+ }
1509
+ }
1510
+ },
1511
+ VideoSubmitRequest: {
1512
+ type: "object",
1513
+ required: ["prompt"],
1514
+ properties: {
1515
+ model: { type: "string" },
1516
+ prompt: { type: "string" },
1517
+ size: { type: "string" },
1518
+ seconds: { type: "string" },
1519
+ n: { type: "integer" }
1520
+ }
1521
+ },
1522
+ VideoJob: {
1523
+ type: "object",
1524
+ required: ["id", "status"],
1525
+ properties: {
1526
+ id: { type: "string" },
1527
+ status: {
1528
+ type: "string",
1529
+ enum: [
1530
+ "queued",
1531
+ "in_progress",
1532
+ "completed",
1533
+ "failed"
1534
+ ]
1535
+ },
1536
+ created_at: { type: "integer" },
1537
+ url: { type: "string" },
1538
+ progress: { type: "number" }
1539
+ }
1540
+ },
1541
+ GrokVideoSubmitResponse: {
1542
+ type: "object",
1543
+ required: ["request_id"],
1544
+ properties: { request_id: { type: "string" } }
1545
+ },
1546
+ GrokVideoJob: {
1547
+ type: "object",
1548
+ required: ["request_id", "status"],
1549
+ properties: {
1550
+ request_id: { type: "string" },
1551
+ status: {
1552
+ type: "string",
1553
+ enum: [
1554
+ "pending",
1555
+ "in_progress",
1556
+ "done",
1557
+ "failed",
1558
+ "expired"
1559
+ ]
1560
+ },
1561
+ progress: { type: "number" },
1562
+ video: {
1563
+ type: "object",
1564
+ properties: {
1565
+ url: { type: "string" },
1566
+ duration: { type: "number" }
1567
+ }
1568
+ },
1569
+ usage: {
1570
+ type: "object",
1571
+ properties: { cost_in_usd_ticks: { type: "number" } }
1572
+ },
1573
+ code: { type: "string" },
1574
+ error: { type: "string" }
1575
+ }
1576
+ },
1577
+ VideoStatusResponse: { oneOf: [{ $ref: "#/components/schemas/VideoJob" }, { $ref: "#/components/schemas/GrokVideoJob" }] },
1578
+ OpenRouterVideoSubmitRequest: {
1579
+ type: "object",
1580
+ required: ["model", "prompt"],
1581
+ properties: {
1582
+ model: { type: "string" },
1583
+ prompt: { type: "string" },
1584
+ aspect_ratio: { type: "string" },
1585
+ duration: { type: "number" }
1586
+ }
1587
+ },
1588
+ OpenRouterVideoJob: {
1589
+ type: "object",
1590
+ required: ["id", "status"],
1591
+ properties: {
1592
+ id: { type: "string" },
1593
+ status: {
1594
+ type: "string",
1595
+ enum: [
1596
+ "queued",
1597
+ "in_progress",
1598
+ "completed",
1599
+ "failed"
1600
+ ]
1601
+ },
1602
+ created_at: { type: "integer" }
1603
+ }
1604
+ },
1605
+ OpenRouterVideoModelsResponse: {
1606
+ type: "object",
1607
+ properties: { data: {
1608
+ type: "array",
1609
+ items: {
1610
+ type: "object",
1611
+ required: ["id"],
1612
+ properties: {
1613
+ id: { type: "string" },
1614
+ canonical_slug: { type: "string" },
1615
+ name: { type: "string" },
1616
+ created: { type: "integer" },
1617
+ description: { type: "string" },
1618
+ context_length: { type: "integer" }
1619
+ }
1620
+ }
1621
+ } }
1622
+ },
1623
+ OpenRouterKeyResponse: {
1624
+ type: "object",
1625
+ properties: { data: {
1626
+ type: "object",
1627
+ properties: {
1628
+ label: { type: "string" },
1629
+ usage: { type: "number" },
1630
+ limit: { type: ["number", "null"] },
1631
+ limit_remaining: { type: ["number", "null"] },
1632
+ is_free_tier: { type: "boolean" },
1633
+ rate_limit: {
1634
+ type: "object",
1635
+ properties: {
1636
+ requests: { type: "integer" },
1637
+ interval: { type: "string" }
1638
+ }
1639
+ }
1640
+ }
1641
+ } }
1642
+ },
1643
+ OpenRouterCreditsResponse: {
1644
+ type: "object",
1645
+ properties: { data: {
1646
+ type: "object",
1647
+ properties: {
1648
+ total_credits: { type: "number" },
1649
+ total_usage: { type: "number" }
1650
+ }
1651
+ } }
1652
+ },
1653
+ BytePlusSubmitRequest: {
1654
+ type: "object",
1655
+ required: ["model", "content"],
1656
+ properties: {
1657
+ model: { type: "string" },
1658
+ content: {
1659
+ type: "array",
1660
+ items: { type: "object" }
1661
+ }
1662
+ }
1663
+ },
1664
+ BytePlusTaskStatus: {
1665
+ type: "object",
1666
+ required: ["id", "status"],
1667
+ properties: {
1668
+ id: { type: "string" },
1669
+ model: { type: "string" },
1670
+ status: {
1671
+ type: "string",
1672
+ enum: [
1673
+ "queued",
1674
+ "running",
1675
+ "succeeded",
1676
+ "failed",
1677
+ "cancelled"
1678
+ ]
1679
+ },
1680
+ created_at: { type: "integer" }
1681
+ }
1682
+ },
1683
+ VeoSubmitRequest: {
1684
+ type: "object",
1685
+ description: "Veo `:predictLongRunning` body (instances + parameters), recorded and replayed.",
1686
+ properties: {
1687
+ instances: {
1688
+ type: "array",
1689
+ items: { type: "object" }
1690
+ },
1691
+ parameters: { type: "object" }
1692
+ }
1693
+ },
1694
+ VeoOperation: {
1695
+ type: "object",
1696
+ required: ["name"],
1697
+ properties: {
1698
+ name: { type: "string" },
1699
+ done: { type: "boolean" },
1700
+ metadata: { type: "object" },
1701
+ response: { type: "object" },
1702
+ error: { $ref: "#/components/schemas/ErrorResponse" }
1703
+ }
1704
+ },
1705
+ ElevenLabsTTSRequest: {
1706
+ type: "object",
1707
+ required: ["text"],
1708
+ properties: {
1709
+ text: { type: "string" },
1710
+ model_id: { type: "string" },
1711
+ voice_settings: {
1712
+ type: "object",
1713
+ properties: {
1714
+ stability: { type: "number" },
1715
+ similarity_boost: { type: "number" },
1716
+ style: { type: "number" }
1717
+ }
1718
+ },
1719
+ output_format: { type: "string" }
1720
+ }
1721
+ },
1722
+ ElevenLabsVoice: {
1723
+ type: "object",
1724
+ required: ["voice_id"],
1725
+ properties: {
1726
+ voice_id: { type: "string" },
1727
+ name: { type: "string" },
1728
+ category: { type: "string" },
1729
+ description: { type: "string" }
1730
+ }
1731
+ },
1732
+ ElevenLabsVoiceDeleteResponse: {
1733
+ type: "object",
1734
+ required: ["status"],
1735
+ properties: { status: {
1736
+ type: "string",
1737
+ enum: ["ok"]
1738
+ } }
1739
+ },
1740
+ ElevenLabsMusicRequest: {
1741
+ type: "object",
1742
+ properties: {
1743
+ prompt: { type: "string" },
1744
+ text: { type: "string" },
1745
+ model_id: { type: "string" },
1746
+ duration_seconds: { type: "number" },
1747
+ output_format: { type: "string" }
1748
+ }
1749
+ },
1750
+ SoundGenerationRequest: {
1751
+ type: "object",
1752
+ required: ["text"],
1753
+ properties: {
1754
+ text: { type: "string" },
1755
+ duration_seconds: { type: "number" },
1756
+ prompt_influence: { type: "number" },
1757
+ model_id: { type: "string" },
1758
+ output_format: { type: "string" }
1759
+ }
1760
+ },
1761
+ VoiceDesignRequest: {
1762
+ type: "object",
1763
+ required: ["voice_description"],
1764
+ properties: {
1765
+ voice_description: {
1766
+ type: "string",
1767
+ minLength: 20,
1768
+ description: "At least 20 code points; shorter values 400."
1769
+ },
1770
+ model_id: { type: "string" },
1771
+ text: { type: "string" },
1772
+ auto_generate_text: { type: "boolean" },
1773
+ loudness: { type: "number" },
1774
+ quality: { type: "string" },
1775
+ seed: { type: "integer" },
1776
+ guidance_scale: { type: "number" }
1777
+ }
1778
+ },
1779
+ VoiceDesignPreviewResponse: {
1780
+ type: "object",
1781
+ properties: {
1782
+ previews: {
1783
+ type: "array",
1784
+ items: {
1785
+ type: "object",
1786
+ required: ["generated_voice_id"],
1787
+ properties: {
1788
+ generated_voice_id: { type: "string" },
1789
+ audio_base_64: { type: "string" },
1790
+ media_type: { type: "string" },
1791
+ duration_secs: { type: "number" },
1792
+ language: { type: "string" }
1793
+ }
1794
+ }
1795
+ },
1796
+ text: { type: "string" }
1797
+ }
1798
+ },
1799
+ VoiceCreateRequest: {
1800
+ type: "object",
1801
+ required: ["voice_name", "generated_voice_id"],
1802
+ properties: {
1803
+ voice_name: { type: "string" },
1804
+ generated_voice_id: { type: "string" },
1805
+ voice_description: { type: "string" },
1806
+ labels: { type: "object" }
1807
+ }
1808
+ },
1809
+ VoiceCreateResponse: {
1810
+ type: "object",
1811
+ required: ["voice_id"],
1812
+ properties: { voice_id: { type: "string" } }
1813
+ },
1814
+ FalQueueSubmitResponse: {
1815
+ type: "object",
1816
+ required: ["request_id"],
1817
+ properties: {
1818
+ request_id: { type: "string" },
1819
+ response_url: { type: "string" },
1820
+ status_url: { type: "string" }
1821
+ }
1822
+ },
1823
+ FalQueueStatusResponse: {
1824
+ type: "object",
1825
+ required: ["status"],
1826
+ properties: {
1827
+ status: {
1828
+ type: "string",
1829
+ enum: [
1830
+ "IN_QUEUE",
1831
+ "IN_PROGRESS",
1832
+ "COMPLETED"
1833
+ ]
1834
+ },
1835
+ request_id: { type: "string" },
1836
+ response: { type: "object" },
1837
+ queue_position: { type: "integer" }
1838
+ }
1839
+ },
1840
+ FalRunRequest: {
1841
+ type: "object",
1842
+ description: "Model-dependent synchronous run input, matched against fixtures."
1843
+ },
1844
+ FalRunResponse: {
1845
+ type: "object",
1846
+ description: "Synchronous fal.ai result, replayed from the matched fixture."
1847
+ },
1848
+ FalQueueSubmitRequest: {
1849
+ type: "object",
1850
+ description: "Model-dependent queue input, matched against fixtures."
1851
+ },
1852
+ FileUploadRequest: {
1853
+ type: "object",
1854
+ required: ["file"],
1855
+ description: "Multipart form (file + optional purpose/filename) or a JSON body.",
1856
+ properties: {
1857
+ file: {
1858
+ type: "string",
1859
+ format: "binary",
1860
+ description: "File bytes (multipart)"
1861
+ },
1862
+ purpose: { type: "string" },
1863
+ filename: { type: "string" }
1864
+ }
1865
+ },
1866
+ FileObject: {
1867
+ type: "object",
1868
+ required: [
1869
+ "id",
1870
+ "object",
1871
+ "bytes",
1872
+ "created_at",
1873
+ "filename",
1874
+ "purpose",
1875
+ "status"
1876
+ ],
1877
+ properties: {
1878
+ id: { type: "string" },
1879
+ object: {
1880
+ type: "string",
1881
+ enum: ["file"]
1882
+ },
1883
+ bytes: { type: "integer" },
1884
+ created_at: { type: "integer" },
1885
+ filename: { type: "string" },
1886
+ purpose: { type: "string" },
1887
+ status: {
1888
+ type: "string",
1889
+ enum: [
1890
+ "uploaded",
1891
+ "processed",
1892
+ "pending",
1893
+ "error"
1894
+ ]
1895
+ },
1896
+ status_details: { type: "string" }
1897
+ }
1898
+ },
1899
+ FileListResponse: {
1900
+ type: "object",
1901
+ properties: {
1902
+ object: {
1903
+ type: "string",
1904
+ enum: ["list"]
1905
+ },
1906
+ data: {
1907
+ type: "array",
1908
+ items: { $ref: "#/components/schemas/FileObject" }
1909
+ }
1910
+ }
1911
+ },
1912
+ FileDeleteResponse: {
1913
+ type: "object",
1914
+ required: [
1915
+ "id",
1916
+ "object",
1917
+ "deleted"
1918
+ ],
1919
+ properties: {
1920
+ id: { type: "string" },
1921
+ object: {
1922
+ type: "string",
1923
+ enum: ["file"]
1924
+ },
1925
+ deleted: { type: "boolean" }
1926
+ }
1927
+ },
1928
+ FineTuningJobCreateRequest: {
1929
+ type: "object",
1930
+ required: ["training_file", "model"],
1931
+ properties: {
1932
+ training_file: { type: "string" },
1933
+ model: { type: "string" },
1934
+ validation_file: { type: ["string", "null"] },
1935
+ suffix: { type: ["string", "null"] },
1936
+ hyperparameters: {
1937
+ type: "object",
1938
+ properties: {
1939
+ n_epochs: { oneOf: [{ type: "integer" }, {
1940
+ type: "string",
1941
+ enum: ["auto"]
1942
+ }] },
1943
+ batch_size: { oneOf: [{ type: "integer" }, {
1944
+ type: "string",
1945
+ enum: ["auto"]
1946
+ }] },
1947
+ learning_rate_multiplier: { oneOf: [{ type: "number" }, {
1948
+ type: "string",
1949
+ enum: ["auto"]
1950
+ }] }
1951
+ }
1952
+ },
1953
+ seed: { type: ["integer", "null"] },
1954
+ integrations: {
1955
+ type: ["array", "null"],
1956
+ items: { type: "object" }
1957
+ },
1958
+ method: { type: ["object", "null"] },
1959
+ metadata: { type: ["object", "null"] }
1960
+ }
1961
+ },
1962
+ FineTuningJob: {
1963
+ type: "object",
1964
+ required: [
1965
+ "id",
1966
+ "object",
1967
+ "model",
1968
+ "training_file",
1969
+ "status",
1970
+ "created_at"
1971
+ ],
1972
+ properties: {
1973
+ id: { type: "string" },
1974
+ object: {
1975
+ type: "string",
1976
+ enum: ["fine_tuning.job"]
1977
+ },
1978
+ model: { type: "string" },
1979
+ training_file: { type: "string" },
1980
+ validation_file: { type: ["string", "null"] },
1981
+ status: {
1982
+ type: "string",
1983
+ enum: [
1984
+ "validating_files",
1985
+ "queued",
1986
+ "running",
1987
+ "succeeded",
1988
+ "cancelled",
1989
+ "failed"
1990
+ ]
1991
+ },
1992
+ created_at: { type: "integer" },
1993
+ finished_at: { type: ["integer", "null"] },
1994
+ fine_tuned_model: { type: ["string", "null"] },
1995
+ hyperparameters: { type: "object" },
1996
+ error: { type: ["object", "null"] },
1997
+ organization_id: { type: "string" },
1998
+ result_files: {
1999
+ type: "array",
2000
+ items: { type: "string" }
2001
+ },
2002
+ seed: { type: "integer" },
2003
+ trained_tokens: { type: ["integer", "null"] }
2004
+ }
2005
+ },
2006
+ FineTuningJobListResponse: {
2007
+ type: "object",
2008
+ properties: {
2009
+ object: {
2010
+ type: "string",
2011
+ enum: ["list"]
2012
+ },
2013
+ data: {
2014
+ type: "array",
2015
+ items: { $ref: "#/components/schemas/FineTuningJob" }
2016
+ },
2017
+ has_more: { type: "boolean" }
2018
+ }
2019
+ },
2020
+ FineTuningJobEvent: {
2021
+ type: "object",
2022
+ required: [
2023
+ "id",
2024
+ "object",
2025
+ "created_at",
2026
+ "level",
2027
+ "message",
2028
+ "type"
2029
+ ],
2030
+ properties: {
2031
+ id: { type: "string" },
2032
+ object: {
2033
+ type: "string",
2034
+ enum: ["fine_tuning.job.event"]
2035
+ },
2036
+ created_at: { type: "integer" },
2037
+ level: {
2038
+ type: "string",
2039
+ enum: [
2040
+ "info",
2041
+ "warn",
2042
+ "error"
2043
+ ]
2044
+ },
2045
+ message: { type: "string" },
2046
+ type: {
2047
+ type: "string",
2048
+ enum: ["message"]
2049
+ }
2050
+ }
2051
+ },
2052
+ FineTuningJobEventListResponse: {
2053
+ type: "object",
2054
+ properties: {
2055
+ object: {
2056
+ type: "string",
2057
+ enum: ["list"]
2058
+ },
2059
+ data: {
2060
+ type: "array",
2061
+ items: { $ref: "#/components/schemas/FineTuningJobEvent" }
2062
+ },
2063
+ has_more: { type: "boolean" }
2064
+ }
2065
+ },
2066
+ BatchCreateRequest: {
2067
+ type: "object",
2068
+ required: [
2069
+ "input_file_id",
2070
+ "endpoint",
2071
+ "completion_window"
2072
+ ],
2073
+ properties: {
2074
+ input_file_id: { type: "string" },
2075
+ endpoint: {
2076
+ type: "string",
2077
+ enum: [
2078
+ "/v1/responses",
2079
+ "/v1/chat/completions",
2080
+ "/v1/embeddings",
2081
+ "/v1/completions"
2082
+ ]
2083
+ },
2084
+ completion_window: {
2085
+ type: "string",
2086
+ enum: ["24h"]
2087
+ },
2088
+ metadata: { type: "object" }
2089
+ }
2090
+ },
2091
+ BatchObject: {
2092
+ type: "object",
2093
+ required: [
2094
+ "id",
2095
+ "object",
2096
+ "endpoint",
2097
+ "input_file_id",
2098
+ "completion_window",
2099
+ "status",
2100
+ "created_at"
2101
+ ],
2102
+ properties: {
2103
+ id: { type: "string" },
2104
+ object: {
2105
+ type: "string",
2106
+ enum: ["batch"]
2107
+ },
2108
+ endpoint: { type: "string" },
2109
+ input_file_id: { type: "string" },
2110
+ completion_window: { type: "string" },
2111
+ status: {
2112
+ type: "string",
2113
+ enum: [
2114
+ "validating",
2115
+ "in_progress",
2116
+ "completed",
2117
+ "failed",
2118
+ "expired",
2119
+ "cancelling",
2120
+ "cancelled"
2121
+ ]
2122
+ },
2123
+ created_at: { type: "integer" },
2124
+ metadata: { type: "object" },
2125
+ in_progress_at: { type: "integer" },
2126
+ completed_at: { type: "integer" },
2127
+ failed_at: { type: "integer" },
2128
+ expired_at: { type: "integer" },
2129
+ cancelling_at: { type: "integer" },
2130
+ cancelled_at: { type: "integer" },
2131
+ output_file_id: { type: "string" },
2132
+ error_file_id: { type: "string" },
2133
+ errors: {
2134
+ type: "object",
2135
+ properties: {
2136
+ object: {
2137
+ type: "string",
2138
+ enum: ["list"]
2139
+ },
2140
+ data: {
2141
+ type: "array",
2142
+ items: {
2143
+ type: "object",
2144
+ properties: {
2145
+ code: { type: "string" },
2146
+ message: { type: "string" },
2147
+ param: { type: ["string", "null"] },
2148
+ line: { type: ["integer", "null"] }
2149
+ }
2150
+ }
2151
+ }
2152
+ }
2153
+ },
2154
+ request_counts: {
2155
+ type: "object",
2156
+ properties: {
2157
+ total: { type: "integer" },
2158
+ completed: { type: "integer" },
2159
+ failed: { type: "integer" }
2160
+ }
2161
+ }
2162
+ }
2163
+ },
2164
+ BatchListResponse: {
2165
+ type: "object",
2166
+ properties: {
2167
+ object: {
2168
+ type: "string",
2169
+ enum: ["list"]
2170
+ },
2171
+ data: {
2172
+ type: "array",
2173
+ items: { $ref: "#/components/schemas/BatchObject" }
2174
+ },
2175
+ has_more: { type: "boolean" },
2176
+ first_id: { type: ["string", "null"] },
2177
+ last_id: { type: ["string", "null"] }
2178
+ }
2179
+ },
2180
+ VectorStore: {
2181
+ type: "object",
2182
+ required: [
2183
+ "id",
2184
+ "object",
2185
+ "created_at",
2186
+ "name",
2187
+ "usage_bytes",
2188
+ "file_counts",
2189
+ "status"
2190
+ ],
2191
+ properties: {
2192
+ id: { type: "string" },
2193
+ object: {
2194
+ type: "string",
2195
+ enum: ["vector_store"]
2196
+ },
2197
+ created_at: { type: "integer" },
2198
+ name: { type: "string" },
2199
+ usage_bytes: { type: "integer" },
2200
+ file_counts: { type: "object" },
2201
+ status: {
2202
+ type: "string",
2203
+ enum: [
2204
+ "expired",
2205
+ "in_progress",
2206
+ "completed"
2207
+ ]
2208
+ },
2209
+ metadata: { type: ["object", "null"] },
2210
+ expires_after: { $ref: "#/components/schemas/VectorStoreExpiresAfter" },
2211
+ chunking_strategy: { $ref: "#/components/schemas/VectorStoreChunkingStrategyRequest" },
2212
+ expires_at: { type: ["integer", "null"] },
2213
+ last_active_at: { type: ["integer", "null"] }
2214
+ }
2215
+ },
2216
+ VectorStoreDeleteResponse: {
2217
+ type: "object",
2218
+ required: [
2219
+ "id",
2220
+ "object",
2221
+ "deleted"
2222
+ ],
2223
+ properties: {
2224
+ id: { type: "string" },
2225
+ object: {
2226
+ type: "string",
2227
+ enum: ["vector_store.deleted"]
2228
+ },
2229
+ deleted: {
2230
+ type: "boolean",
2231
+ enum: [true]
2232
+ }
2233
+ }
2234
+ },
2235
+ VectorStoreListResponse: {
2236
+ type: "object",
2237
+ properties: {
2238
+ object: {
2239
+ type: "string",
2240
+ enum: ["list"]
2241
+ },
2242
+ data: {
2243
+ type: "array",
2244
+ items: { $ref: "#/components/schemas/VectorStore" }
2245
+ },
2246
+ first_id: { type: ["string", "null"] },
2247
+ last_id: { type: ["string", "null"] },
2248
+ has_more: { type: "boolean" }
2249
+ }
2250
+ },
2251
+ VectorStoreFile: {
2252
+ type: "object",
2253
+ required: [
2254
+ "id",
2255
+ "object",
2256
+ "created_at",
2257
+ "vector_store_id",
2258
+ "status",
2259
+ "usage_bytes",
2260
+ "attributes"
2261
+ ],
2262
+ properties: {
2263
+ id: { type: "string" },
2264
+ object: {
2265
+ type: "string",
2266
+ enum: ["vector_store.file"]
2267
+ },
2268
+ created_at: { type: "integer" },
2269
+ vector_store_id: { type: "string" },
2270
+ status: {
2271
+ type: "string",
2272
+ enum: [
2273
+ "in_progress",
2274
+ "completed",
2275
+ "failed",
2276
+ "cancelled"
2277
+ ]
2278
+ },
2279
+ usage_bytes: { type: "integer" },
2280
+ attributes: { $ref: "#/components/schemas/VectorStoreAttributes" },
2281
+ chunking_strategy: { $ref: "#/components/schemas/VectorStoreFileChunkingStrategy" },
2282
+ last_error: { type: ["object", "null"] }
2283
+ }
2284
+ },
2285
+ VectorStoreFileDeleteResponse: {
2286
+ type: "object",
2287
+ required: [
2288
+ "id",
2289
+ "object",
2290
+ "deleted"
2291
+ ],
2292
+ properties: {
2293
+ id: { type: "string" },
2294
+ object: {
2295
+ type: "string",
2296
+ enum: ["vector_store.file.deleted"]
2297
+ },
2298
+ deleted: {
2299
+ type: "boolean",
2300
+ enum: [true]
2301
+ }
2302
+ }
2303
+ },
2304
+ VectorStoreFileListResponse: {
2305
+ type: "object",
2306
+ properties: {
2307
+ object: {
2308
+ type: "string",
2309
+ enum: ["list"]
2310
+ },
2311
+ data: {
2312
+ type: "array",
2313
+ items: { $ref: "#/components/schemas/VectorStoreFile" }
2314
+ },
2315
+ first_id: { type: ["string", "null"] },
2316
+ last_id: { type: ["string", "null"] },
2317
+ has_more: { type: "boolean" }
2318
+ }
2319
+ },
2320
+ VectorFileBatch: {
2321
+ type: "object",
2322
+ required: [
2323
+ "id",
2324
+ "object",
2325
+ "created_at",
2326
+ "vector_store_id",
2327
+ "status",
2328
+ "file_counts"
2329
+ ],
2330
+ properties: {
2331
+ id: { type: "string" },
2332
+ object: {
2333
+ type: "string",
2334
+ enum: ["vector_store.file_batch"]
2335
+ },
2336
+ created_at: { type: "integer" },
2337
+ vector_store_id: { type: "string" },
2338
+ status: {
2339
+ type: "string",
2340
+ enum: [
2341
+ "in_progress",
2342
+ "completed",
2343
+ "failed",
2344
+ "cancelled",
2345
+ "cancelling"
2346
+ ]
2347
+ },
2348
+ file_counts: { type: "object" }
2349
+ }
2350
+ },
2351
+ VectorFileBatchFilesResponse: {
2352
+ type: "object",
2353
+ properties: {
2354
+ object: {
2355
+ type: "string",
2356
+ enum: ["list"]
2357
+ },
2358
+ data: {
2359
+ type: "array",
2360
+ items: { $ref: "#/components/schemas/VectorStoreFile" }
2361
+ },
2362
+ first_id: { type: ["string", "null"] },
2363
+ last_id: { type: ["string", "null"] },
2364
+ has_more: { type: "boolean" }
2365
+ }
2366
+ },
2367
+ VectorSearchResponse: {
2368
+ type: "object",
2369
+ required: [
2370
+ "object",
2371
+ "search_query",
2372
+ "data",
2373
+ "has_more"
2374
+ ],
2375
+ properties: {
2376
+ object: {
2377
+ type: "string",
2378
+ enum: ["vector_store.search_results_page"]
2379
+ },
2380
+ search_query: { oneOf: [{ type: "string" }, {
2381
+ type: "array",
2382
+ items: { type: "string" }
2383
+ }] },
2384
+ data: {
2385
+ type: "array",
2386
+ items: {
2387
+ type: "object",
2388
+ required: [
2389
+ "file_id",
2390
+ "filename",
2391
+ "score",
2392
+ "content",
2393
+ "attributes"
2394
+ ],
2395
+ properties: {
2396
+ file_id: { type: "string" },
2397
+ filename: { type: "string" },
2398
+ score: { type: "number" },
2399
+ attributes: {
2400
+ type: ["object", "null"],
2401
+ additionalProperties: { type: [
2402
+ "string",
2403
+ "number",
2404
+ "boolean"
2405
+ ] }
2406
+ },
2407
+ content: {
2408
+ type: "array",
2409
+ items: { type: "object" }
2410
+ }
2411
+ }
2412
+ }
2413
+ },
2414
+ has_more: { type: "boolean" }
2415
+ }
2416
+ },
2417
+ VectorStoreExpiresAfter: {
2418
+ type: "object",
2419
+ required: ["anchor", "days"],
2420
+ properties: {
2421
+ anchor: {
2422
+ type: "string",
2423
+ enum: ["last_active_at"]
2424
+ },
2425
+ days: {
2426
+ type: "integer",
2427
+ minimum: 1,
2428
+ maximum: 365
2429
+ }
2430
+ }
2431
+ },
2432
+ VectorStoreMetadata: {
2433
+ type: ["object", "null"],
2434
+ maxProperties: 16,
2435
+ propertyNames: { maxLength: 64 },
2436
+ additionalProperties: {
2437
+ type: "string",
2438
+ maxLength: 512
2439
+ }
2440
+ },
2441
+ VectorStoreAttributes: {
2442
+ type: ["object", "null"],
2443
+ maxProperties: 16,
2444
+ propertyNames: { maxLength: 64 },
2445
+ additionalProperties: { oneOf: [
2446
+ {
2447
+ type: "string",
2448
+ maxLength: 512
2449
+ },
2450
+ { type: "number" },
2451
+ { type: "boolean" }
2452
+ ] }
2453
+ },
2454
+ VectorStoreChunkingStrategyRequest: { oneOf: [{
2455
+ type: "object",
2456
+ required: ["type"],
2457
+ properties: { type: {
2458
+ type: "string",
2459
+ enum: ["auto"]
2460
+ } }
2461
+ }, {
2462
+ type: "object",
2463
+ required: ["type", "static"],
2464
+ properties: {
2465
+ type: {
2466
+ type: "string",
2467
+ enum: ["static"]
2468
+ },
2469
+ static: {
2470
+ type: "object",
2471
+ required: ["max_chunk_size_tokens", "chunk_overlap_tokens"],
2472
+ properties: {
2473
+ max_chunk_size_tokens: {
2474
+ type: "integer",
2475
+ minimum: 100,
2476
+ maximum: 4096
2477
+ },
2478
+ chunk_overlap_tokens: {
2479
+ type: "integer",
2480
+ minimum: 0,
2481
+ maximum: 2048,
2482
+ description: "Must be at most half of max_chunk_size_tokens."
2483
+ }
2484
+ }
2485
+ }
2486
+ }
2487
+ }] },
2488
+ VectorStoreFileChunkingStrategy: {
2489
+ type: "object",
2490
+ required: ["type", "static"],
2491
+ properties: {
2492
+ type: {
2493
+ type: "string",
2494
+ enum: ["static"]
2495
+ },
2496
+ static: {
2497
+ type: "object",
2498
+ required: ["max_chunk_size_tokens", "chunk_overlap_tokens"],
2499
+ properties: {
2500
+ max_chunk_size_tokens: {
2501
+ type: "integer",
2502
+ minimum: 100,
2503
+ maximum: 4096
2504
+ },
2505
+ chunk_overlap_tokens: {
2506
+ type: "integer",
2507
+ minimum: 0,
2508
+ maximum: 2048,
2509
+ description: "Must be at most half of max_chunk_size_tokens."
2510
+ }
2511
+ }
2512
+ }
2513
+ }
2514
+ },
2515
+ VectorStoreAttributeFilter: { oneOf: [{
2516
+ type: "object",
2517
+ required: [
2518
+ "type",
2519
+ "key",
2520
+ "value"
2521
+ ],
2522
+ properties: {
2523
+ type: {
2524
+ type: "string",
2525
+ enum: [
2526
+ "eq",
2527
+ "ne",
2528
+ "gt",
2529
+ "gte",
2530
+ "lt",
2531
+ "lte"
2532
+ ]
2533
+ },
2534
+ key: { type: "string" },
2535
+ value: { type: [
2536
+ "string",
2537
+ "number",
2538
+ "boolean"
2539
+ ] }
2540
+ }
2541
+ }, {
2542
+ type: "object",
2543
+ required: ["type", "filters"],
2544
+ properties: {
2545
+ type: {
2546
+ type: "string",
2547
+ enum: ["and", "or"]
2548
+ },
2549
+ filters: {
2550
+ type: "array",
2551
+ items: { $ref: "#/components/schemas/VectorStoreAttributeFilter" }
2552
+ }
2553
+ }
2554
+ }] },
2555
+ VectorStoreCreateRequest: {
2556
+ type: "object",
2557
+ properties: {
2558
+ name: { type: "string" },
2559
+ file_ids: {
2560
+ type: "array",
2561
+ maxItems: 2e3,
2562
+ items: {
2563
+ type: "string",
2564
+ minLength: 1
2565
+ }
2566
+ },
2567
+ expires_after: { $ref: "#/components/schemas/VectorStoreExpiresAfter" },
2568
+ chunking_strategy: { $ref: "#/components/schemas/VectorStoreChunkingStrategyRequest" },
2569
+ metadata: { $ref: "#/components/schemas/VectorStoreMetadata" }
2570
+ }
2571
+ },
2572
+ VectorStoreUpdateRequest: {
2573
+ type: "object",
2574
+ properties: {
2575
+ name: { type: ["string", "null"] },
2576
+ expires_after: { oneOf: [{ $ref: "#/components/schemas/VectorStoreExpiresAfter" }, { type: "null" }] },
2577
+ metadata: { $ref: "#/components/schemas/VectorStoreMetadata" }
2578
+ }
2579
+ },
2580
+ VectorStoreFileCreateRequest: {
2581
+ type: "object",
2582
+ required: ["file_id"],
2583
+ properties: {
2584
+ file_id: {
2585
+ type: "string",
2586
+ minLength: 1
2587
+ },
2588
+ attributes: { $ref: "#/components/schemas/VectorStoreAttributes" },
2589
+ chunking_strategy: { $ref: "#/components/schemas/VectorStoreChunkingStrategyRequest" }
2590
+ }
2591
+ },
2592
+ VectorStoreFileBatchCreateRequest: {
2593
+ type: "object",
2594
+ required: ["file_ids"],
2595
+ properties: {
2596
+ file_ids: {
2597
+ type: "array",
2598
+ minItems: 1,
2599
+ maxItems: 2e3,
2600
+ uniqueItems: true,
2601
+ items: {
2602
+ type: "string",
2603
+ minLength: 1
2604
+ }
2605
+ },
2606
+ attributes: { $ref: "#/components/schemas/VectorStoreAttributes" },
2607
+ chunking_strategy: { $ref: "#/components/schemas/VectorStoreChunkingStrategyRequest" }
2608
+ }
2609
+ },
2610
+ VectorStoreSearchRequest: {
2611
+ type: "object",
2612
+ required: ["query"],
2613
+ properties: {
2614
+ query: { oneOf: [{
2615
+ type: "string",
2616
+ minLength: 1
2617
+ }, {
2618
+ type: "array",
2619
+ minItems: 1,
2620
+ items: {
2621
+ type: "string",
2622
+ minLength: 1
2623
+ }
2624
+ }] },
2625
+ filters: { $ref: "#/components/schemas/VectorStoreAttributeFilter" },
2626
+ max_num_results: {
2627
+ type: "integer",
2628
+ minimum: 1,
2629
+ maximum: 50
2630
+ },
2631
+ ranking_options: {
2632
+ type: "object",
2633
+ properties: { score_threshold: {
2634
+ type: "number",
2635
+ minimum: 0,
2636
+ maximum: 1
2637
+ } }
2638
+ }
2639
+ }
2640
+ },
2641
+ ModelsListResponse: {
2642
+ type: "object",
2643
+ properties: {
2644
+ object: {
2645
+ type: "string",
2646
+ enum: ["list"]
2647
+ },
2648
+ data: {
2649
+ type: "array",
2650
+ items: {
2651
+ type: "object",
2652
+ required: ["id", "object"],
2653
+ properties: {
2654
+ id: { type: "string" },
2655
+ object: {
2656
+ type: "string",
2657
+ enum: ["model"]
2658
+ },
2659
+ created: { type: "integer" },
2660
+ owned_by: { type: "string" }
2661
+ }
2662
+ }
2663
+ }
2664
+ }
2665
+ },
2666
+ ReadyResponse: {
2667
+ type: "object",
2668
+ required: ["status"],
2669
+ properties: { status: {
2670
+ type: "string",
2671
+ enum: ["ready"]
2672
+ } }
2673
+ },
2674
+ HealthResponse: {
2675
+ type: "object",
2676
+ required: ["status"],
2677
+ properties: {
2678
+ status: {
2679
+ type: "string",
2680
+ enum: ["ok"]
2681
+ },
2682
+ services: { type: "object" }
2683
+ }
2684
+ },
2685
+ JournalEntry: {
2686
+ type: "object",
2687
+ required: [
2688
+ "method",
2689
+ "path",
2690
+ "headers",
2691
+ "response"
2692
+ ],
2693
+ properties: {
2694
+ method: { type: "string" },
2695
+ path: { type: "string" },
2696
+ headers: { type: "object" },
2697
+ body: { type: ["object", "null"] },
2698
+ response: {
2699
+ type: "object",
2700
+ properties: {
2701
+ status: { type: "integer" },
2702
+ fixture: { type: ["integer", "null"] }
2703
+ }
2704
+ },
2705
+ service: { type: "string" }
2706
+ }
2707
+ },
2708
+ ChaosConfig: {
2709
+ type: "object",
2710
+ description: "Install REPLACES the scope config wholesale; `{}` means explicitly no chaos.",
2711
+ properties: {
2712
+ dropRate: {
2713
+ type: "number",
2714
+ minimum: 0,
2715
+ maximum: 1
2716
+ },
2717
+ malformedRate: {
2718
+ type: "number",
2719
+ minimum: 0,
2720
+ maximum: 1
2721
+ },
2722
+ disconnectRate: {
2723
+ type: "number",
2724
+ minimum: 0,
2725
+ maximum: 1
2726
+ },
2727
+ rateLimitRate: {
2728
+ type: "number",
2729
+ minimum: 0,
2730
+ maximum: 1
2731
+ },
2732
+ latencyMs: {
2733
+ type: "integer",
2734
+ minimum: 0,
2735
+ maximum: 3e4
2736
+ }
2737
+ }
2738
+ },
2739
+ ChaosEnvelope: {
2740
+ type: "object",
2741
+ properties: { chaos: { $ref: "#/components/schemas/ChaosConfig" } }
2742
+ },
2743
+ FixturesAddRequest: {
2744
+ type: "object",
2745
+ required: ["fixtures"],
2746
+ properties: { fixtures: {
2747
+ type: "array",
2748
+ items: { type: "object" }
2749
+ } }
2750
+ },
2751
+ FixturesAddResponse: {
2752
+ type: "object",
2753
+ properties: { added: { type: "integer" } }
2754
+ },
2755
+ FixturesInspectResponse: {
2756
+ type: "object",
2757
+ properties: {
2758
+ count: { type: "integer" },
2759
+ fixtures: {
2760
+ type: "array",
2761
+ items: {
2762
+ type: "object",
2763
+ properties: {
2764
+ index: { type: "integer" },
2765
+ match: { type: "object" },
2766
+ responseKind: { type: "string" }
2767
+ }
2768
+ }
2769
+ }
2770
+ }
2771
+ },
2772
+ FixturesClearResponse: {
2773
+ type: "object",
2774
+ properties: { cleared: { type: "boolean" } }
2775
+ },
2776
+ ResetResponse: {
2777
+ type: "object",
2778
+ properties: {
2779
+ reset: { type: "boolean" },
2780
+ deprecated: { type: "boolean" },
2781
+ deprecation: { type: "string" }
2782
+ }
2783
+ },
2784
+ ErrorInjectRequest: {
2785
+ type: "object",
2786
+ properties: {
2787
+ status: { type: "integer" },
2788
+ body: {
2789
+ type: "object",
2790
+ properties: {
2791
+ message: { type: "string" },
2792
+ type: { type: "string" },
2793
+ code: { type: "string" }
2794
+ }
2795
+ }
2796
+ }
2797
+ },
2798
+ ErrorInjectResponse: {
2799
+ type: "object",
2800
+ properties: { queued: { type: "boolean" } }
2801
+ },
2802
+ RoutesListResponse: {
2803
+ type: "object",
2804
+ properties: {
2805
+ count: { type: "integer" },
2806
+ routes: {
2807
+ type: "array",
2808
+ items: {
2809
+ type: "object",
2810
+ required: [
2811
+ "method",
2812
+ "path",
2813
+ "service",
2814
+ "description"
2815
+ ],
2816
+ properties: {
2817
+ method: { type: "string" },
2818
+ path: { type: "string" },
2819
+ service: { type: "string" },
2820
+ description: { type: "string" }
2821
+ }
2822
+ }
2823
+ }
2824
+ }
2825
+ },
2826
+ OpenApiDocument: {
2827
+ type: "object",
2828
+ description: "The OpenAPI 3.1 document served by GET /__aimock/openapi.json."
2829
+ },
2830
+ ControlErrorResponse: {
2831
+ type: "object",
2832
+ required: ["error"],
2833
+ properties: { error: { type: "string" } }
2834
+ },
2835
+ FixtureValidationErrorResponse: {
2836
+ type: "object",
2837
+ required: ["error"],
2838
+ properties: {
2839
+ error: { type: "string" },
2840
+ details: {
2841
+ type: "array",
2842
+ description: "Validation issues when fixture or MCP fake validation fails.",
2843
+ items: { type: "object" }
2844
+ }
2845
+ }
2846
+ },
2847
+ ErrorResponse: {
2848
+ type: "object",
2849
+ properties: { error: {
2850
+ type: "object",
2851
+ properties: {
2852
+ message: { type: "string" },
2853
+ type: { type: "string" },
2854
+ code: {}
2855
+ }
2856
+ } }
2857
+ }
2858
+ };
2859
+ const JSON = "application/json";
2860
+ const MULTIPART = "multipart/form-data";
2861
+ const AUDIO = "audio/mpeg";
2862
+ const OCTET = "application/octet-stream";
2863
+ const VECTOR_LIST_QUERY = [
2864
+ {
2865
+ name: "limit",
2866
+ description: "Maximum entries per page",
2867
+ schema: {
2868
+ type: "integer",
2869
+ minimum: 1,
2870
+ maximum: 100,
2871
+ default: 20
2872
+ }
2873
+ },
2874
+ {
2875
+ name: "order",
2876
+ description: "Sort order by creation time",
2877
+ schema: {
2878
+ type: "string",
2879
+ enum: ["asc", "desc"],
2880
+ default: "desc"
2881
+ }
2882
+ },
2883
+ {
2884
+ name: "after",
2885
+ description: "Known entry ID to page after; mutually exclusive with before",
2886
+ schema: { type: "string" }
2887
+ },
2888
+ {
2889
+ name: "before",
2890
+ description: "Known entry ID to page before; mutually exclusive with after",
2891
+ schema: { type: "string" }
2892
+ }
2893
+ ];
2894
+ const VECTOR_FILE_LIST_QUERY = [...VECTOR_LIST_QUERY, {
2895
+ name: "filter",
2896
+ description: "Filter by file ingestion status before pagination",
2897
+ schema: {
2898
+ type: "string",
2899
+ enum: [
2900
+ "in_progress",
2901
+ "completed",
2902
+ "failed",
2903
+ "cancelled"
2904
+ ]
2905
+ }
2906
+ }];
2907
+ const JOURNAL_QUERY = [
2908
+ {
2909
+ name: "limit",
2910
+ description: "Max entries (integer >= 0)",
2911
+ schema: { type: "integer" }
2912
+ },
2913
+ {
2914
+ name: "offset",
2915
+ description: "Entries to skip (integer >= 0)",
2916
+ schema: { type: "integer" }
2917
+ },
2918
+ {
2919
+ name: "path",
2920
+ description: "Substring filter on the request path",
2921
+ schema: { type: "string" }
2922
+ },
2923
+ {
2924
+ name: "method",
2925
+ description: "Exact method filter (case-insensitive)",
2926
+ schema: { type: "string" }
2927
+ },
2928
+ {
2929
+ name: "status",
2930
+ description: "Exact response status filter",
2931
+ schema: { type: "integer" }
2932
+ },
2933
+ {
2934
+ name: "service",
2935
+ description: "Exact service filter",
2936
+ schema: { type: "string" }
2937
+ },
2938
+ {
2939
+ name: "testId",
2940
+ description: "Test-id scope filter",
2941
+ schema: { type: "string" }
2942
+ },
2943
+ {
2944
+ name: "requestId",
2945
+ description: "Request-id filter",
2946
+ schema: { type: "string" }
2947
+ }
2948
+ ];
2949
+ const SCHEMA_REFS = {
2950
+ [`POST ${COMPLETIONS_PATH}`]: {
2951
+ request: "ChatCompletionRequest",
2952
+ response: "ChatCompletionResponse",
2953
+ streamResponse: "ChatCompletionEventStream"
2954
+ },
2955
+ [`POST ${RESPONSES_PATH}`]: {
2956
+ request: "ResponsesRequest",
2957
+ response: "ResponsesResponse"
2958
+ },
2959
+ [`POST ${MESSAGES_PATH}`]: {
2960
+ request: "MessagesRequest",
2961
+ response: "MessagesResponse"
2962
+ },
2963
+ [`POST ${EMBEDDINGS_PATH}`]: {
2964
+ request: "EmbeddingRequest",
2965
+ response: "EmbeddingResponse"
2966
+ },
2967
+ [`POST ${COHERE_CHAT_PATH}`]: {
2968
+ request: "CohereChatRequest",
2969
+ response: "CohereChatResponse"
2970
+ },
2971
+ [`POST ${COHERE_EMBED_PATH}`]: {
2972
+ request: "CohereEmbedRequest",
2973
+ response: "CohereEmbedResponse"
2974
+ },
2975
+ [`POST ${IMAGES_PATH}`]: {
2976
+ request: "ImageGenerationRequest",
2977
+ response: "ImageResponse"
2978
+ },
2979
+ "POST /v1/images/edits": {
2980
+ request: "ImageEditRequest",
2981
+ reqContent: MULTIPART,
2982
+ response: "ImageResponse"
2983
+ },
2984
+ "POST /v1/images/variations": {
2985
+ successStatus: "404",
2986
+ successDescription: "Removed upstream 2026-05-12 — aimock replays the removal with a 404 and an empty body."
2987
+ },
2988
+ [`POST ${SPEECH_PATH}`]: {
2989
+ request: "SpeechRequest",
2990
+ respContent: AUDIO
2991
+ },
2992
+ "POST /v1/audio/transcriptions": {
2993
+ request: "TranscriptionRequest",
2994
+ reqContent: MULTIPART,
2995
+ response: "TranscriptionResponse"
2996
+ },
2997
+ "POST /v1/audio/translations": {
2998
+ request: "TranscriptionRequest",
2999
+ reqContent: MULTIPART,
3000
+ response: "TranscriptionResponse"
3001
+ },
3002
+ [`POST ${MODERATIONS_PATH}`]: {
3003
+ request: "ModerationRequest",
3004
+ response: "ModerationResponse"
3005
+ },
3006
+ [`GET ${MODELS_PATH}`]: { response: "ModelsListResponse" },
3007
+ [`POST ${SEARCH_PATH}`]: {
3008
+ request: "SearchRequest",
3009
+ response: "SearchResponse"
3010
+ },
3011
+ [`POST ${RERANK_PATH}`]: {
3012
+ request: "RerankRequest",
3013
+ response: "RerankResponse"
3014
+ },
3015
+ "POST /openai/deployments/{deploymentId}/chat/completions": {
3016
+ request: "ChatCompletionRequest",
3017
+ response: "ChatCompletionResponse",
3018
+ streamResponse: "ChatCompletionEventStream"
3019
+ },
3020
+ "POST /openai/deployments/{deploymentId}/embeddings": {
3021
+ request: "EmbeddingRequest",
3022
+ response: "EmbeddingResponse"
3023
+ },
3024
+ "POST /api/chat": {
3025
+ request: "OllamaChatRequest",
3026
+ response: "OllamaChatResponse"
3027
+ },
3028
+ "POST /api/generate": {
3029
+ request: "OllamaGenerateRequest",
3030
+ response: "OllamaGenerateResponse"
3031
+ },
3032
+ "POST /api/embeddings": {
3033
+ request: "OllamaEmbedRequest",
3034
+ response: "OllamaEmbedResponse"
3035
+ },
3036
+ "POST /api/embed": {
3037
+ request: "OllamaEmbedRequest",
3038
+ response: "OllamaEmbedResponse"
3039
+ },
3040
+ "GET /api/tags": { response: "OllamaTagsResponse" },
3041
+ "POST /v1/batches/{batch_id}/cancel": { response: "BatchObject" },
3042
+ "GET /v1/batches/{batch_id}": { response: "BatchObject" },
3043
+ "GET /v1/batches": {
3044
+ response: "BatchListResponse",
3045
+ query: [{
3046
+ name: "limit",
3047
+ description: "Max batches",
3048
+ schema: { type: "integer" }
3049
+ }, {
3050
+ name: "after",
3051
+ description: "Pagination cursor",
3052
+ schema: { type: "string" }
3053
+ }]
3054
+ },
3055
+ "POST /v1/batches": {
3056
+ request: "BatchCreateRequest",
3057
+ response: "BatchObject"
3058
+ },
3059
+ "GET /v1/files/{file_id}/content": { respContent: OCTET },
3060
+ "GET /v1/files/{file_id}": { response: "FileObject" },
3061
+ "DELETE /v1/files/{file_id}": { response: "FileDeleteResponse" },
3062
+ "GET /v1/files": {
3063
+ response: "FileListResponse",
3064
+ query: [
3065
+ {
3066
+ name: "purpose",
3067
+ description: "Filter by purpose",
3068
+ schema: { type: "string" }
3069
+ },
3070
+ {
3071
+ name: "order",
3072
+ description: "Sort order",
3073
+ schema: {
3074
+ type: "string",
3075
+ enum: ["asc", "desc"]
3076
+ }
3077
+ },
3078
+ {
3079
+ name: "limit",
3080
+ description: "Max files",
3081
+ schema: { type: "integer" }
3082
+ },
3083
+ {
3084
+ name: "after",
3085
+ description: "Pagination cursor",
3086
+ schema: { type: "string" }
3087
+ }
3088
+ ]
3089
+ },
3090
+ "POST /v1/files": {
3091
+ request: "FileUploadRequest",
3092
+ reqContent: MULTIPART,
3093
+ response: "FileObject"
3094
+ },
3095
+ "POST /v1/vector_stores/{vector_store_id}/search": {
3096
+ request: "VectorStoreSearchRequest",
3097
+ response: "VectorSearchResponse"
3098
+ },
3099
+ "GET /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": {
3100
+ response: "VectorFileBatchFilesResponse",
3101
+ query: VECTOR_FILE_LIST_QUERY
3102
+ },
3103
+ "POST /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { response: "VectorFileBatch" },
3104
+ "GET /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { response: "VectorFileBatch" },
3105
+ "POST /v1/vector_stores/{vector_store_id}/file_batches": {
3106
+ request: "VectorStoreFileBatchCreateRequest",
3107
+ response: "VectorFileBatch"
3108
+ },
3109
+ "GET /v1/vector_stores/{vector_store_id}/files/{file_id}": { response: "VectorStoreFile" },
3110
+ "DELETE /v1/vector_stores/{vector_store_id}/files/{file_id}": { response: "VectorStoreFileDeleteResponse" },
3111
+ "POST /v1/vector_stores/{vector_store_id}/files": {
3112
+ request: "VectorStoreFileCreateRequest",
3113
+ response: "VectorStoreFile"
3114
+ },
3115
+ "GET /v1/vector_stores/{vector_store_id}/files": {
3116
+ response: "VectorStoreFileListResponse",
3117
+ query: VECTOR_FILE_LIST_QUERY
3118
+ },
3119
+ "GET /v1/vector_stores/{vector_store_id}": { response: "VectorStore" },
3120
+ "POST /v1/vector_stores/{vector_store_id}": {
3121
+ request: "VectorStoreUpdateRequest",
3122
+ response: "VectorStore"
3123
+ },
3124
+ "DELETE /v1/vector_stores/{vector_store_id}": { response: "VectorStoreDeleteResponse" },
3125
+ "GET /v1/vector_stores": {
3126
+ response: "VectorStoreListResponse",
3127
+ query: VECTOR_LIST_QUERY
3128
+ },
3129
+ "POST /v1/vector_stores": {
3130
+ request: "VectorStoreCreateRequest",
3131
+ response: "VectorStore"
3132
+ },
3133
+ "POST /v1/fine_tuning/jobs/{job_id}/cancel": { response: "FineTuningJob" },
3134
+ "GET /v1/fine_tuning/jobs/{job_id}/events": { response: "FineTuningJobEventListResponse" },
3135
+ "GET /v1/fine_tuning/jobs/{job_id}": { response: "FineTuningJob" },
3136
+ "GET /v1/fine_tuning/jobs": {
3137
+ response: "FineTuningJobListResponse",
3138
+ query: [{
3139
+ name: "limit",
3140
+ description: "Max jobs",
3141
+ schema: { type: "integer" }
3142
+ }, {
3143
+ name: "after",
3144
+ description: "Pagination cursor",
3145
+ schema: { type: "string" }
3146
+ }]
3147
+ },
3148
+ "POST /v1/fine_tuning/jobs": {
3149
+ request: "FineTuningJobCreateRequest",
3150
+ response: "FineTuningJob"
3151
+ },
3152
+ "POST /v1beta/models/{model}:predict": {
3153
+ request: "GeminiPredictRequest",
3154
+ response: "GeminiPredictResponse"
3155
+ },
3156
+ "POST /v1beta/interactions": {
3157
+ request: "InteractionsRequest",
3158
+ response: "InteractionsResponse",
3159
+ streamResponse: "InteractionsSSEStream"
3160
+ },
3161
+ "POST /v1beta/models/{model}:embedContent": {
3162
+ request: "GeminiEmbedRequest",
3163
+ response: "GeminiEmbedResponse"
3164
+ },
3165
+ "POST /v1beta/models/{model}:generateContent": {
3166
+ request: "GeminiGenerateRequest",
3167
+ response: "GeminiGenerateResponse"
3168
+ },
3169
+ "POST /v1beta/models/{model}:streamGenerateContent": {
3170
+ request: "GeminiGenerateRequest",
3171
+ response: "GeminiGenerateEventStream",
3172
+ respContent: "text/event-stream"
3173
+ },
3174
+ "POST /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent": {
3175
+ request: "GeminiGenerateRequest",
3176
+ response: "GeminiGenerateResponse"
3177
+ },
3178
+ "POST /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent": {
3179
+ request: "GeminiGenerateRequest",
3180
+ response: "GeminiGenerateEventStream",
3181
+ respContent: "text/event-stream"
3182
+ },
3183
+ "POST /model/{modelId}/invoke": {
3184
+ request: "BedrockInvokeRequest",
3185
+ response: "BedrockInvokeResponse"
3186
+ },
3187
+ "POST /model/{modelId}/invoke-with-response-stream": {
3188
+ request: "BedrockInvokeRequest",
3189
+ response: "BedrockInvokeResponse"
3190
+ },
3191
+ "POST /model/{modelId}/converse": {
3192
+ request: "BedrockConverseRequest",
3193
+ response: "BedrockConverseResponse"
3194
+ },
3195
+ "POST /model/{modelId}/converse-stream": {
3196
+ request: "BedrockConverseRequest",
3197
+ response: "BedrockConverseResponse"
3198
+ },
3199
+ "POST /v1/videos": {
3200
+ request: "VideoSubmitRequest",
3201
+ response: "VideoJob"
3202
+ },
3203
+ "POST /v1/videos/generations": {
3204
+ request: "VideoSubmitRequest",
3205
+ response: "GrokVideoSubmitResponse"
3206
+ },
3207
+ "GET /v1/videos/{id}": { response: "VideoStatusResponse" },
3208
+ "POST /api/v1/videos": {
3209
+ request: "OpenRouterVideoSubmitRequest",
3210
+ response: "OpenRouterVideoJob"
3211
+ },
3212
+ "GET /api/v1/videos/models": { response: "OpenRouterVideoModelsResponse" },
3213
+ "GET /api/v1/videos/{jobId}": { response: "OpenRouterVideoJob" },
3214
+ "GET /api/v1/videos/{jobId}/content": { respContent: OCTET },
3215
+ "POST /contents/generations/tasks": {
3216
+ request: "BytePlusSubmitRequest",
3217
+ response: "BytePlusTaskStatus"
3218
+ },
3219
+ "POST /api/v3/contents/generations/tasks": {
3220
+ request: "BytePlusSubmitRequest",
3221
+ response: "BytePlusTaskStatus"
3222
+ },
3223
+ "GET /contents/generations/tasks/{id}": { response: "BytePlusTaskStatus" },
3224
+ "GET /api/v3/contents/generations/tasks/{id}": { response: "BytePlusTaskStatus" },
3225
+ "POST /v1beta/models/{model}:predictLongRunning": {
3226
+ request: "VeoSubmitRequest",
3227
+ response: "VeoOperation"
3228
+ },
3229
+ "GET /v1beta/operations/{name}": { response: "VeoOperation" },
3230
+ "GET /api/v1/models": { response: "OpenRouterVideoModelsResponse" },
3231
+ "GET /api/v1/key": { response: "OpenRouterKeyResponse" },
3232
+ "GET /api/v1/credits": { response: "OpenRouterCreditsResponse" },
3233
+ "POST /v1/sound-generation": {
3234
+ request: "SoundGenerationRequest",
3235
+ respContent: AUDIO
3236
+ },
3237
+ "POST /v1/text-to-voice/design": {
3238
+ request: "VoiceDesignRequest",
3239
+ response: "VoiceDesignPreviewResponse"
3240
+ },
3241
+ "POST /v1/text-to-voice": {
3242
+ request: "VoiceCreateRequest",
3243
+ response: "VoiceCreateResponse"
3244
+ },
3245
+ "GET /v1/voices/{voice_id}": { response: "ElevenLabsVoice" },
3246
+ "DELETE /v1/voices/{voice_id}": { response: "ElevenLabsVoiceDeleteResponse" },
3247
+ "POST /v1/text-to-speech/{voice_id}": {
3248
+ request: "ElevenLabsTTSRequest",
3249
+ respContent: AUDIO
3250
+ },
3251
+ "POST /v1/music": {
3252
+ request: "ElevenLabsMusicRequest",
3253
+ respContent: AUDIO
3254
+ },
3255
+ "POST /v1/music/{subtype}": {
3256
+ request: "ElevenLabsMusicRequest",
3257
+ respContent: AUDIO
3258
+ },
3259
+ "POST /fal/queue/submit/{model}": {
3260
+ request: "FalQueueSubmitRequest",
3261
+ response: "FalQueueSubmitResponse"
3262
+ },
3263
+ "GET /fal/queue/requests/{requestId}": { response: "FalQueueStatusResponse" },
3264
+ "POST /fal/queue/requests/{requestId}": { response: "FalQueueStatusResponse" },
3265
+ "PUT /fal/queue/requests/{requestId}": { response: "FalQueueStatusResponse" },
3266
+ "POST /fal/run/{model}": {
3267
+ request: "FalRunRequest",
3268
+ response: "FalRunResponse"
3269
+ },
3270
+ "GET /health": { response: "HealthResponse" },
3271
+ "GET /ready": { response: "ReadyResponse" },
3272
+ "GET /metrics": { respContent: "text/plain; version=0.0.4" },
3273
+ "GET /v1/_requests": {
3274
+ response: "JournalEntry",
3275
+ query: [{
3276
+ name: "limit",
3277
+ description: "Max entries",
3278
+ schema: { type: "integer" }
3279
+ }]
3280
+ },
3281
+ "DELETE /v1/_requests": {
3282
+ successStatus: "204",
3283
+ successDescription: "Journal entries cleared (fixture sequencing preserved)."
3284
+ },
3285
+ "GET /__aimock/health": { response: "HealthResponse" },
3286
+ "GET /__aimock/journal": {
3287
+ response: "JournalEntry",
3288
+ query: JOURNAL_QUERY,
3289
+ invalidRequest: "ControlErrorResponse"
3290
+ },
3291
+ "GET /__aimock/fixtures": {
3292
+ response: "FixturesInspectResponse",
3293
+ invalidRequest: "ControlErrorResponse",
3294
+ query: [{
3295
+ name: "include",
3296
+ description: "Set to 'fixtures' for the full redacted dump",
3297
+ schema: {
3298
+ type: "string",
3299
+ enum: ["fixtures"]
3300
+ }
3301
+ }]
3302
+ },
3303
+ "POST /__aimock/fixtures": {
3304
+ request: "FixturesAddRequest",
3305
+ response: "FixturesAddResponse",
3306
+ invalidRequest: "FixtureValidationErrorResponse"
3307
+ },
3308
+ "DELETE /__aimock/fixtures": { response: "FixturesClearResponse" },
3309
+ "GET /__aimock/chaos": {
3310
+ response: "ChaosEnvelope",
3311
+ invalidRequest: "ControlErrorResponse"
3312
+ },
3313
+ "POST /__aimock/chaos": {
3314
+ request: "ChaosConfig",
3315
+ response: "ChaosEnvelope",
3316
+ invalidRequest: "ControlErrorResponse"
3317
+ },
3318
+ "DELETE /__aimock/chaos": {
3319
+ response: "ChaosEnvelope",
3320
+ invalidRequest: "ControlErrorResponse"
3321
+ },
3322
+ "POST /__aimock/reset": { response: "ResetResponse" },
3323
+ "POST /__aimock/reset/journal": { response: "ResetResponse" },
3324
+ "POST /__aimock/reset/fixtures": { response: "ResetResponse" },
3325
+ "POST /__aimock/error": {
3326
+ request: "ErrorInjectRequest",
3327
+ response: "ErrorInjectResponse",
3328
+ invalidRequest: "ControlErrorResponse"
3329
+ },
3330
+ "GET /__aimock/openapi.json": { response: "OpenApiDocument" },
3331
+ "GET /__aimock/routes": { response: "RoutesListResponse" }
3332
+ };
3333
+ function operationFor(method, path, service, description) {
3334
+ const params = pathParams(path);
3335
+ const refs = SCHEMA_REFS[`${method} ${path}`];
3336
+ const operation = {
3337
+ summary: description,
3338
+ tags: [service]
3339
+ };
3340
+ if (refs?.query) for (const q of refs.query) params.push({
3341
+ name: q.name,
3342
+ in: "query",
3343
+ required: q.required ?? false,
3344
+ description: q.description,
3345
+ schema: q.schema
3346
+ });
3347
+ if (params.length > 0) operation.parameters = params;
3348
+ const reqContent = refs?.reqContent ?? JSON;
3349
+ if (refs?.request) operation.requestBody = {
3350
+ required: true,
3351
+ content: { [reqContent]: { schema: { $ref: `#/components/schemas/${refs.request}` } } }
3352
+ };
3353
+ const respContent = refs?.respContent ?? JSON;
3354
+ const successStatus = refs?.successStatus ?? "200";
3355
+ const successDescription = refs?.successDescription ?? "OK";
3356
+ const successSchema = refs?.response ? { $ref: `#/components/schemas/${refs.response}` } : respContent !== JSON ? {
3357
+ type: "string",
3358
+ format: "binary"
3359
+ } : void 0;
3360
+ const successContent = refs?.response === "JournalEntry" ? { [respContent]: { schema: {
3361
+ type: "array",
3362
+ items: { $ref: "#/components/schemas/JournalEntry" }
3363
+ } } } : successSchema ? { [respContent]: { schema: successSchema } } : void 0;
3364
+ operation.responses = {
3365
+ [successStatus]: {
3366
+ description: successDescription,
3367
+ ...successContent || refs?.streamResponse ? { content: {
3368
+ ...successContent,
3369
+ ...refs?.streamResponse ? { "text/event-stream": { schema: { $ref: `#/components/schemas/${refs.streamResponse}` } } } : void 0
3370
+ } } : void 0
3371
+ },
3372
+ ...successStatus === "200" ? {
3373
+ "400": {
3374
+ description: "Invalid request",
3375
+ content: { [JSON]: { schema: { $ref: `#/components/schemas/${refs?.invalidRequest ?? "ErrorResponse"}` } } }
3376
+ },
3377
+ "404": {
3378
+ description: "No fixture match",
3379
+ content: { [JSON]: { schema: { $ref: "#/components/schemas/ErrorResponse" } } }
3380
+ }
3381
+ } : void 0
3382
+ };
3383
+ return operation;
3384
+ }
3385
+ function buildOpenApiDocument() {
3386
+ const paths = {};
3387
+ for (const r of ROUTE_DEFINITIONS) {
3388
+ const item = paths[r.path] ??= {};
3389
+ item[r.method.toLowerCase()] = operationFor(r.method, r.path, r.service, r.description);
3390
+ }
3391
+ return {
3392
+ openapi: "3.1.0",
3393
+ info: {
3394
+ title: "aimock",
3395
+ version: "1.0.0"
3396
+ },
3397
+ paths,
3398
+ components: { schemas: COMPONENTS }
3399
+ };
3400
+ }
3401
+
3402
+ //#endregion
3403
+ export { CATALOG_ROUTES, buildOpenApiDocument };
3404
+ //# sourceMappingURL=openapi.js.map