@opencode/ai 2.1.4 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +339 -166
  2. package/dist/ai-client.d.ts +2 -2
  3. package/dist/ai-client.js +2 -1
  4. package/dist/cache-policy.d.ts +4 -0
  5. package/dist/cache-policy.js +20 -6
  6. package/dist/decision-client.d.ts +21 -0
  7. package/dist/decision-client.js +55 -0
  8. package/dist/decision.d.ts +472 -0
  9. package/dist/decision.js +158 -0
  10. package/dist/effect.d.ts +38 -0
  11. package/dist/effect.js +27 -0
  12. package/dist/effort-updates.d.ts +2 -2
  13. package/dist/experimental/cloudflare-run-extraction.d.ts +13 -0
  14. package/dist/experimental/cloudflare-run-extraction.js +83 -0
  15. package/dist/experimental/extraction.d.ts +183 -0
  16. package/dist/experimental/extraction.js +102 -0
  17. package/dist/experimental/realtime.d.ts +7 -2
  18. package/dist/experimental/realtime.js +5 -5
  19. package/dist/experimental.d.ts +2 -3
  20. package/dist/experimental.js +1 -2
  21. package/dist/image-client.d.ts +50 -14
  22. package/dist/image-client.js +0 -1
  23. package/dist/image.d.ts +6 -176
  24. package/dist/image.js +4 -11
  25. package/dist/index.d.ts +1444 -34
  26. package/dist/index.js +139 -24
  27. package/dist/llm.d.ts +16 -1
  28. package/dist/llm.js +34 -0
  29. package/dist/media-client.d.ts +3 -1
  30. package/dist/media-client.js +1 -0
  31. package/dist/media-model.d.ts +3 -0
  32. package/dist/media-model.js +4 -1
  33. package/dist/media.d.ts +0 -7
  34. package/dist/media.js +0 -6
  35. package/dist/protocols/alibaba-chat.d.ts +59 -4
  36. package/dist/protocols/alibaba-images.d.ts +22 -0
  37. package/dist/protocols/alibaba-images.js +77 -0
  38. package/dist/protocols/alibaba-messages.d.ts +52 -17
  39. package/dist/protocols/alibaba-responses.d.ts +26 -6
  40. package/dist/protocols/anthropic-messages.d.ts +160 -54
  41. package/dist/protocols/anthropic-messages.js +44 -13
  42. package/dist/protocols/bedrock-converse.d.ts +110 -15
  43. package/dist/protocols/bedrock-converse.js +112 -15
  44. package/dist/protocols/bedrock-event-stream.js +1 -0
  45. package/dist/protocols/cartesia-speech.d.ts +0 -18
  46. package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
  47. package/dist/protocols/cloudflare-run-decisions.js +36 -0
  48. package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
  49. package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
  50. package/dist/protocols/deepgram-speech.d.ts +0 -18
  51. package/dist/protocols/elevenlabs-speech.d.ts +0 -18
  52. package/dist/protocols/gemini.d.ts +3 -0
  53. package/dist/protocols/gemini.js +11 -6
  54. package/dist/protocols/google-images.d.ts +2 -2
  55. package/dist/protocols/google-images.js +10 -37
  56. package/dist/protocols/google-interactions.d.ts +4 -0
  57. package/dist/protocols/google-interactions.js +12 -5
  58. package/dist/protocols/google-speech.d.ts +0 -18
  59. package/dist/protocols/google-speech.js +0 -1
  60. package/dist/protocols/google-transcription.d.ts +0 -18
  61. package/dist/protocols/google-transcription.js +0 -1
  62. package/dist/protocols/google-video.d.ts +1 -1
  63. package/dist/protocols/google-video.js +2 -7
  64. package/dist/protocols/index.d.ts +3 -0
  65. package/dist/protocols/index.js +3 -0
  66. package/dist/protocols/meta-images.d.ts +7 -1
  67. package/dist/protocols/meta-images.js +10 -8
  68. package/dist/protocols/meta-messages.d.ts +52 -17
  69. package/dist/protocols/meta-messages.js +14 -1
  70. package/dist/protocols/meta-responses.d.ts +46 -6
  71. package/dist/protocols/meta-responses.js +29 -1
  72. package/dist/protocols/minimax-images.d.ts +25 -0
  73. package/dist/protocols/minimax-images.js +150 -0
  74. package/dist/protocols/open-responses.d.ts +212 -27
  75. package/dist/protocols/open-responses.js +116 -54
  76. package/dist/protocols/openai-chat.d.ts +1135 -31
  77. package/dist/protocols/openai-chat.js +155 -60
  78. package/dist/protocols/openai-compatible-chat.d.ts +57 -5
  79. package/dist/protocols/openai-compatible-responses.d.ts +28 -8
  80. package/dist/protocols/openai-decisions.d.ts +22 -0
  81. package/dist/protocols/openai-decisions.js +128 -0
  82. package/dist/protocols/openai-freeform.d.ts +47 -0
  83. package/dist/protocols/openai-freeform.js +54 -0
  84. package/dist/protocols/openai-images.d.ts +36 -24
  85. package/dist/protocols/openai-images.js +137 -39
  86. package/dist/protocols/openai-responses.d.ts +202 -42
  87. package/dist/protocols/openai-responses.js +49 -10
  88. package/dist/protocols/openai-speech.d.ts +0 -18
  89. package/dist/protocols/openai-speech.js +15 -5
  90. package/dist/protocols/openai-transcription.d.ts +0 -18
  91. package/dist/protocols/openai-transcription.js +3 -4
  92. package/dist/protocols/runway-video.d.ts +1 -1
  93. package/dist/protocols/runway-video.js +1 -1
  94. package/dist/protocols/shared.d.ts +9 -1
  95. package/dist/protocols/shared.js +13 -2
  96. package/dist/protocols/system-one.d.ts +101 -0
  97. package/dist/protocols/system-one.js +230 -0
  98. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  99. package/dist/protocols/utils/bedrock-cache.js +7 -6
  100. package/dist/protocols/utils/cache.d.ts +14 -3
  101. package/dist/protocols/utils/cache.js +11 -4
  102. package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
  103. package/dist/protocols/utils/gemini-generate-content.js +10 -16
  104. package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
  105. package/dist/protocols/utils/gemini-json-schema.js +3 -3
  106. package/dist/protocols/utils/image-sizing.d.ts +31 -0
  107. package/dist/protocols/utils/image-sizing.js +73 -0
  108. package/dist/protocols/utils/media-input.d.ts +4 -5
  109. package/dist/protocols/utils/media-input.js +8 -5
  110. package/dist/protocols/utils/speech-stream.d.ts +0 -1
  111. package/dist/protocols/utils/speech-stream.js +0 -1
  112. package/dist/protocols/utils/tool-schema.js +15 -5
  113. package/dist/protocols/utils/tool-stream.d.ts +9 -0
  114. package/dist/protocols/venice-chat.d.ts +58 -4
  115. package/dist/protocols/venice-chat.js +2 -2
  116. package/dist/protocols/xai-images.d.ts +7 -2
  117. package/dist/protocols/xai-images.js +11 -5
  118. package/dist/protocols/xai-responses.d.ts +30 -3
  119. package/dist/protocols/xai-responses.js +30 -3
  120. package/dist/protocols/xai-video.d.ts +1 -1
  121. package/dist/protocols/xai-video.js +11 -8
  122. package/dist/protocols/zai-chat.d.ts +60 -4
  123. package/dist/protocols/zai-images.d.ts +3 -1
  124. package/dist/protocols/zai-images.js +12 -11
  125. package/dist/protocols/zai-messages.d.ts +52 -17
  126. package/dist/provider-error.js +23 -7
  127. package/dist/provider-package.d.ts +2 -0
  128. package/dist/providers/alibaba/images.d.ts +2 -0
  129. package/dist/providers/alibaba/images.js +1 -0
  130. package/dist/providers/alibaba.d.ts +137 -28
  131. package/dist/providers/alibaba.js +16 -8
  132. package/dist/providers/amazon-bedrock-mantle.d.ts +259 -145
  133. package/dist/providers/amazon-bedrock-mantle.js +1 -1
  134. package/dist/providers/amazon-bedrock.d.ts +34 -14
  135. package/dist/providers/amazon-bedrock.js +11 -11
  136. package/dist/providers/anthropic-compatible.d.ts +53 -18
  137. package/dist/providers/anthropic.d.ts +53 -18
  138. package/dist/providers/anthropic.js +1 -1
  139. package/dist/providers/azure/images.d.ts +2 -0
  140. package/dist/providers/azure/images.js +1 -0
  141. package/dist/providers/azure.d.ts +129 -24
  142. package/dist/providers/azure.js +19 -1
  143. package/dist/providers/baseten/decisions.d.ts +2 -0
  144. package/dist/providers/baseten/decisions.js +1 -0
  145. package/dist/providers/baseten.d.ts +124 -12
  146. package/dist/providers/baseten.js +41 -8
  147. package/dist/providers/cerebras.d.ts +115 -11
  148. package/dist/providers/cerebras.js +1 -1
  149. package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
  150. package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
  151. package/dist/providers/cloudflare-ai-gateway.d.ts +290 -60
  152. package/dist/providers/cloudflare-ai-gateway.js +32 -4
  153. package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
  154. package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
  155. package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
  156. package/dist/providers/cloudflare-workers-ai/images.js +1 -0
  157. package/dist/providers/cloudflare-workers-ai.d.ts +128 -12
  158. package/dist/providers/cloudflare-workers-ai.js +45 -9
  159. package/dist/providers/cohere/chat.d.ts +1 -1
  160. package/dist/providers/cohere/chat.js +1 -1
  161. package/dist/providers/cohere.d.ts +115 -11
  162. package/dist/providers/cohere.js +1 -1
  163. package/dist/providers/deepinfra.d.ts +115 -11
  164. package/dist/providers/deepinfra.js +1 -1
  165. package/dist/providers/deepseek.d.ts +115 -11
  166. package/dist/providers/deepseek.js +1 -1
  167. package/dist/providers/digitalocean/decisions.d.ts +2 -0
  168. package/dist/providers/digitalocean/decisions.js +1 -0
  169. package/dist/providers/digitalocean/images.d.ts +2 -0
  170. package/dist/providers/digitalocean/images.js +1 -0
  171. package/dist/providers/digitalocean/responses.d.ts +4 -0
  172. package/dist/providers/digitalocean/responses.js +1 -0
  173. package/dist/providers/digitalocean.d.ts +390 -20
  174. package/dist/providers/digitalocean.js +53 -11
  175. package/dist/providers/fireworks.d.ts +115 -11
  176. package/dist/providers/fireworks.js +1 -1
  177. package/dist/providers/google/images.d.ts +2 -0
  178. package/dist/providers/google/images.js +1 -0
  179. package/dist/providers/google/interactions.d.ts +1 -1
  180. package/dist/providers/google/interactions.js +1 -1
  181. package/dist/providers/google-vertex/images.d.ts +2 -0
  182. package/dist/providers/google-vertex/images.js +1 -0
  183. package/dist/providers/google-vertex-chat.d.ts +57 -5
  184. package/dist/providers/google-vertex-chat.js +1 -1
  185. package/dist/providers/google-vertex-interactions.d.ts +1 -1
  186. package/dist/providers/google-vertex-interactions.js +1 -1
  187. package/dist/providers/google-vertex-messages.d.ts +53 -18
  188. package/dist/providers/google-vertex-messages.js +1 -1
  189. package/dist/providers/google-vertex-mistral.d.ts +1 -1
  190. package/dist/providers/google-vertex-mistral.js +1 -1
  191. package/dist/providers/google-vertex-responses.d.ts +24 -4
  192. package/dist/providers/google-vertex-responses.js +1 -1
  193. package/dist/providers/google-vertex.d.ts +4 -2
  194. package/dist/providers/google-vertex.js +30 -13
  195. package/dist/providers/google.d.ts +6 -5
  196. package/dist/providers/google.js +15 -8
  197. package/dist/providers/groq.d.ts +119 -15
  198. package/dist/providers/groq.js +1 -7
  199. package/dist/providers/index.d.ts +0 -4
  200. package/dist/providers/index.js +0 -4
  201. package/dist/providers/meta/images.d.ts +2 -0
  202. package/dist/providers/meta/images.js +1 -0
  203. package/dist/providers/meta.d.ts +254 -146
  204. package/dist/providers/meta.js +2 -1
  205. package/dist/providers/minimax/chat.d.ts +1 -1
  206. package/dist/providers/minimax/chat.js +1 -1
  207. package/dist/providers/minimax/images.d.ts +3 -0
  208. package/dist/providers/minimax/images.js +1 -0
  209. package/dist/providers/minimax/responses.d.ts +1 -1
  210. package/dist/providers/minimax/responses.js +1 -1
  211. package/dist/providers/minimax.d.ts +139 -26
  212. package/dist/providers/minimax.js +22 -9
  213. package/dist/providers/mistral.d.ts +3 -3
  214. package/dist/providers/mistral.js +1 -1
  215. package/dist/providers/moonshot/messages.d.ts +1 -1
  216. package/dist/providers/moonshot/messages.js +1 -1
  217. package/dist/providers/moonshot/responses.d.ts +1 -1
  218. package/dist/providers/moonshot/responses.js +1 -1
  219. package/dist/providers/moonshot.d.ts +132 -25
  220. package/dist/providers/moonshot.js +1 -1
  221. package/dist/providers/openai/images.d.ts +2 -0
  222. package/dist/providers/openai/images.js +1 -0
  223. package/dist/providers/openai-compatible/images.d.ts +2 -0
  224. package/dist/providers/openai-compatible/images.js +1 -0
  225. package/dist/providers/openai-compatible-responses.d.ts +24 -4
  226. package/dist/providers/openai-compatible.d.ts +62 -8
  227. package/dist/providers/openai-compatible.js +29 -10
  228. package/dist/providers/openai-options.d.ts +3 -1
  229. package/dist/providers/openai.d.ts +103 -18
  230. package/dist/providers/openai.js +23 -5
  231. package/dist/providers/opencode/decisions.d.ts +2 -0
  232. package/dist/providers/opencode/decisions.js +1 -0
  233. package/dist/providers/opencode.d.ts +11 -12
  234. package/dist/providers/opencode.js +10 -8
  235. package/dist/providers/openrouter/decisions.d.ts +2 -0
  236. package/dist/providers/openrouter/decisions.js +1 -0
  237. package/dist/providers/openrouter/images.d.ts +2 -0
  238. package/dist/providers/openrouter/images.js +1 -0
  239. package/dist/providers/openrouter/responses.d.ts +4 -0
  240. package/dist/providers/openrouter/responses.js +1 -0
  241. package/dist/providers/openrouter.d.ts +446 -35
  242. package/dist/providers/openrouter.js +78 -27
  243. package/dist/providers/togetherai.d.ts +115 -11
  244. package/dist/providers/togetherai.js +1 -1
  245. package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
  246. package/dist/providers/typesafe-ai/decisions.js +1 -0
  247. package/dist/providers/typesafe-ai.d.ts +11 -12
  248. package/dist/providers/typesafe-ai.js +10 -8
  249. package/dist/providers/venice/responses.d.ts +4 -0
  250. package/dist/providers/venice/responses.js +1 -0
  251. package/dist/providers/venice.d.ts +261 -9
  252. package/dist/providers/venice.js +33 -17
  253. package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
  254. package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
  255. package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
  256. package/dist/providers/vercel-ai-gateway/images.js +1 -0
  257. package/dist/providers/vercel-ai-gateway.d.ts +16 -22
  258. package/dist/providers/vercel-ai-gateway.js +41 -85
  259. package/dist/providers/xai/images.d.ts +2 -0
  260. package/dist/providers/xai/images.js +1 -0
  261. package/dist/providers/xai.d.ts +66 -12
  262. package/dist/providers/xai.js +15 -8
  263. package/dist/providers/zai/images.d.ts +2 -0
  264. package/dist/providers/zai/images.js +1 -0
  265. package/dist/providers/zai-coding-plan/messages.d.ts +1 -1
  266. package/dist/providers/zai-coding-plan/messages.js +1 -1
  267. package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
  268. package/dist/providers/zai-coding-plan/responses.js +1 -1
  269. package/dist/providers/zai-coding-plan.d.ts +132 -25
  270. package/dist/providers/zai-coding-plan.js +1 -1
  271. package/dist/providers/zai.d.ts +62 -9
  272. package/dist/providers/zai.js +15 -8
  273. package/dist/route/auth.d.ts +1 -1
  274. package/dist/route/client.d.ts +2 -2
  275. package/dist/route/client.js +26 -4
  276. package/dist/route/decision.d.ts +58 -0
  277. package/dist/route/decision.js +75 -0
  278. package/dist/route/executor.d.ts +1 -1
  279. package/dist/route/framing.d.ts +2 -0
  280. package/dist/route/index.d.ts +3 -0
  281. package/dist/route/index.js +3 -0
  282. package/dist/route/media-protocol.d.ts +3 -4
  283. package/dist/route/media-protocol.js +12 -8
  284. package/dist/route/media.d.ts +6 -2
  285. package/dist/route/media.js +8 -6
  286. package/dist/route/transport/http.js +1 -0
  287. package/dist/route/transport/index.d.ts +1 -0
  288. package/dist/schema/events.d.ts +148 -6
  289. package/dist/schema/events.js +20 -0
  290. package/dist/schema/messages.d.ts +41 -3
  291. package/dist/schema/messages.js +23 -0
  292. package/dist/schema/options.d.ts +5 -3
  293. package/dist/schema/options.js +8 -3
  294. package/dist/speech-client.d.ts +53 -14
  295. package/dist/speech-client.js +0 -1
  296. package/dist/speech.d.ts +0 -135
  297. package/dist/speech.js +2 -4
  298. package/dist/testing/decision.d.ts +16 -0
  299. package/dist/testing/decision.js +20 -0
  300. package/dist/testing/image.d.ts +14 -0
  301. package/dist/testing/image.js +12 -0
  302. package/dist/testing/media.d.ts +18 -0
  303. package/dist/testing/media.js +36 -0
  304. package/dist/testing/script.d.ts +28 -0
  305. package/dist/testing/script.js +60 -0
  306. package/dist/testing/speech.d.ts +14 -0
  307. package/dist/testing/speech.js +12 -0
  308. package/dist/testing/transcription.d.ts +14 -0
  309. package/dist/testing/transcription.js +12 -0
  310. package/dist/testing/video.d.ts +14 -0
  311. package/dist/testing/video.js +12 -0
  312. package/dist/testing.d.ts +35 -45
  313. package/dist/testing.js +14 -75
  314. package/dist/tool.d.ts +12 -1
  315. package/dist/tool.js +10 -2
  316. package/dist/transcription-client.d.ts +69 -14
  317. package/dist/transcription.d.ts +0 -135
  318. package/dist/transcription.js +1 -1
  319. package/dist/utils/media-type.js +22 -1
  320. package/dist/video-client.d.ts +46 -14
  321. package/dist/video-client.js +0 -1
  322. package/dist/video.d.ts +1 -136
  323. package/dist/video.js +3 -5
  324. package/package.json +497 -11
  325. package/dist/experimental/evaluation-client.d.ts +0 -21
  326. package/dist/experimental/evaluation-client.js +0 -64
  327. package/dist/experimental/evaluation.d.ts +0 -242
  328. package/dist/experimental/evaluation.js +0 -108
  329. package/dist/experimental/system-one.d.ts +0 -16
  330. package/dist/experimental/system-one.js +0 -135
  331. package/dist/promise.d.ts +0 -1021
  332. package/dist/promise.js +0 -101
  333. package/dist/protocols/bfl-images.d.ts +0 -38
  334. package/dist/protocols/bfl-images.js +0 -153
  335. package/dist/protocols/fal-images.d.ts +0 -25
  336. package/dist/protocols/fal-images.js +0 -104
  337. package/dist/protocols/fal-video.d.ts +0 -29
  338. package/dist/protocols/fal-video.js +0 -73
  339. package/dist/protocols/replicate-images.d.ts +0 -28
  340. package/dist/protocols/replicate-images.js +0 -127
  341. package/dist/protocols/stability-images.d.ts +0 -39
  342. package/dist/protocols/stability-images.js +0 -136
  343. package/dist/protocols/utils/fal-queue.d.ts +0 -26
  344. package/dist/protocols/utils/fal-queue.js +0 -67
  345. package/dist/provider.d.ts +0 -23
  346. package/dist/provider.js +0 -2
  347. package/dist/providers/black-forest-labs.d.ts +0 -21
  348. package/dist/providers/black-forest-labs.js +0 -23
  349. package/dist/providers/fal.d.ts +0 -24
  350. package/dist/providers/fal.js +0 -26
  351. package/dist/providers/replicate.d.ts +0 -21
  352. package/dist/providers/replicate.js +0 -17
  353. package/dist/providers/stability.d.ts +0 -23
  354. package/dist/providers/stability.js +0 -18
@@ -2,7 +2,7 @@ import type { Config, Redacted } from "effect";
2
2
  import type { ProviderPackage } from "../provider-package.js";
3
3
  import type { AtLeastOne, ProviderAuthOption } from "../route/auth-options.js";
4
4
  import type { RouteDefaultsInput } from "../route/client.js";
5
- import { type ModelID } from "../schema/index.js";
5
+ import { type ModelID, type ProviderOptions } from "../schema/index.js";
6
6
  import type { OpenAIProviderOptionsInput } from "./openai-options.js";
7
7
  export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
8
8
  export declare const authEnvVars: readonly ["CLOUDFLARE_API_TOKEN", "CF_AIG_TOKEN"];
@@ -18,7 +18,7 @@ type GatewayOptions = {
18
18
  readonly skipCache?: boolean;
19
19
  readonly collectLog?: boolean;
20
20
  };
21
- export type LanguageModelOptions = GatewayURL & GatewayOptions & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
21
+ export type Config = GatewayURL & GatewayOptions & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
22
22
  readonly gatewayApiKey?: string | Redacted.Redacted | Config.Config<string | Redacted.Redacted>;
23
23
  readonly providerOptions?: OpenAIProviderOptionsInput;
24
24
  };
@@ -27,6 +27,8 @@ export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & G
27
27
  readonly gatewayApiKey?: string;
28
28
  };
29
29
  export declare const baseURL: (input: GatewayURL) => string;
30
+ /** The Run API (`/ai/run`) next to the OpenAI-compatible `/ai/v1` base. */
31
+ export declare const runBaseURL: (input: GatewayURL) => string;
30
32
  export declare const responsesRoute: import("../route/client.js").Route<{
31
33
  readonly model: string;
32
34
  readonly input: readonly ({
@@ -43,7 +45,7 @@ export declare const responsesRoute: import("../route/client.js").Route<{
43
45
  readonly role: "developer";
44
46
  readonly content: string;
45
47
  } | {
46
- readonly type: "function_call_output";
48
+ readonly type: "custom_tool_call_output" | "function_call_output";
47
49
  readonly call_id: string;
48
50
  readonly output: string | readonly ({
49
51
  readonly type: "input_text";
@@ -80,6 +82,9 @@ export declare const responsesRoute: import("../route/client.js").Route<{
80
82
  readonly content: readonly ({
81
83
  readonly type: "input_text";
82
84
  readonly text: string;
85
+ } | {
86
+ readonly type: "input_video";
87
+ readonly video_url: string;
83
88
  } | {
84
89
  readonly type: "input_image";
85
90
  readonly image_url: string;
@@ -110,6 +115,12 @@ export declare const responsesRoute: import("../route/client.js").Route<{
110
115
  readonly name: string;
111
116
  readonly namespace?: string | undefined;
112
117
  readonly arguments: string;
118
+ } | {
119
+ readonly type: "custom_tool_call";
120
+ readonly id?: string | undefined;
121
+ readonly call_id: string;
122
+ readonly name: string;
123
+ readonly input: string;
113
124
  } | {
114
125
  readonly [x: string]: unknown;
115
126
  readonly type: "web_search_call";
@@ -166,10 +177,6 @@ export declare const responsesRoute: import("../route/client.js").Route<{
166
177
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
167
178
  readonly prompt_cache_key?: string | undefined;
168
179
  readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
169
- readonly reasoning?: {
170
- readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
171
- readonly summary?: "auto" | "concise" | "detailed" | undefined;
172
- } | undefined;
173
180
  readonly text?: {
174
181
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
175
182
  } | undefined;
@@ -180,7 +187,22 @@ export declare const responsesRoute: import("../route/client.js").Route<{
180
187
  readonly top_p?: number | undefined;
181
188
  readonly presence_penalty?: number | undefined;
182
189
  readonly frequency_penalty?: number | undefined;
190
+ readonly prompt_cache_retention?: string | undefined;
191
+ readonly prompt_cache_options?: {
192
+ readonly ttl?: string | undefined;
193
+ } | undefined;
183
194
  readonly tools?: readonly ({
195
+ readonly type: "custom";
196
+ readonly name: string;
197
+ readonly description: string;
198
+ readonly format: {
199
+ readonly type: "text";
200
+ } | {
201
+ readonly type: "grammar";
202
+ readonly syntax: "lark" | "regex";
203
+ readonly definition: string;
204
+ };
205
+ } | {
184
206
  readonly type: "namespace";
185
207
  readonly name: string;
186
208
  readonly description: string;
@@ -213,18 +235,24 @@ export declare const responsesRoute: import("../route/client.js").Route<{
213
235
  readonly size?: string | undefined;
214
236
  })[] | undefined;
215
237
  readonly tool_choice?: "auto" | "none" | "required" | {
216
- readonly type: "function";
238
+ readonly type: "custom" | "function";
217
239
  readonly name: string;
218
240
  } | {
219
241
  readonly type: "allowed_tools";
220
242
  readonly mode: "auto" | "none" | "required";
221
243
  readonly tools: readonly {
222
- readonly type: "function";
244
+ readonly type: "custom" | "function";
223
245
  readonly name: string;
224
246
  }[];
225
247
  } | {
226
248
  readonly type: "image_generation";
227
249
  } | undefined;
250
+ readonly reasoning?: {
251
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
252
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
253
+ readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
254
+ readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
255
+ } | undefined;
228
256
  readonly context_management?: readonly {
229
257
  readonly type: "compaction";
230
258
  readonly compact_threshold?: number | undefined;
@@ -252,7 +280,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
252
280
  readonly text: string;
253
281
  readonly cache_control?: {
254
282
  readonly type: "ephemeral";
255
- readonly ttl?: "1h" | "5m" | undefined;
283
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
256
284
  } | undefined;
257
285
  }[] | undefined;
258
286
  readonly messages: readonly ({
@@ -262,7 +290,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
262
290
  readonly text: string;
263
291
  readonly cache_control?: {
264
292
  readonly type: "ephemeral";
265
- readonly ttl?: "1h" | "5m" | undefined;
293
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
266
294
  } | undefined;
267
295
  } | {
268
296
  readonly type: "image";
@@ -279,11 +307,28 @@ export declare const messagesRoute: import("../route/client.js").Route<{
279
307
  };
280
308
  readonly cache_control?: {
281
309
  readonly type: "ephemeral";
282
- readonly ttl?: "1h" | "5m" | undefined;
310
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
283
311
  } | undefined;
284
312
  readonly transformations?: {
285
313
  readonly oversized_image?: "downsize" | "error" | undefined;
286
314
  } | undefined;
315
+ } | {
316
+ readonly type: "video";
317
+ readonly source: {
318
+ readonly type: "base64";
319
+ readonly media_type: string;
320
+ readonly data: string;
321
+ } | {
322
+ readonly type: "url";
323
+ readonly url: string;
324
+ } | {
325
+ readonly type: "file";
326
+ readonly file_id: string;
327
+ };
328
+ readonly cache_control?: {
329
+ readonly type: "ephemeral";
330
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
331
+ } | undefined;
287
332
  } | {
288
333
  readonly type: "document";
289
334
  readonly source: {
@@ -303,7 +348,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
303
348
  };
304
349
  readonly cache_control?: {
305
350
  readonly type: "ephemeral";
306
- readonly ttl?: "1h" | "5m" | undefined;
351
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
307
352
  } | undefined;
308
353
  readonly title?: string | undefined;
309
354
  readonly context?: string | undefined;
@@ -318,7 +363,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
318
363
  readonly text: string;
319
364
  readonly cache_control?: {
320
365
  readonly type: "ephemeral";
321
- readonly ttl?: "1h" | "5m" | undefined;
366
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
322
367
  } | undefined;
323
368
  } | {
324
369
  readonly type: "image";
@@ -335,11 +380,28 @@ export declare const messagesRoute: import("../route/client.js").Route<{
335
380
  };
336
381
  readonly cache_control?: {
337
382
  readonly type: "ephemeral";
338
- readonly ttl?: "1h" | "5m" | undefined;
383
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
339
384
  } | undefined;
340
385
  readonly transformations?: {
341
386
  readonly oversized_image?: "downsize" | "error" | undefined;
342
387
  } | undefined;
388
+ } | {
389
+ readonly type: "video";
390
+ readonly source: {
391
+ readonly type: "base64";
392
+ readonly media_type: string;
393
+ readonly data: string;
394
+ } | {
395
+ readonly type: "url";
396
+ readonly url: string;
397
+ } | {
398
+ readonly type: "file";
399
+ readonly file_id: string;
400
+ };
401
+ readonly cache_control?: {
402
+ readonly type: "ephemeral";
403
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
404
+ } | undefined;
343
405
  } | {
344
406
  readonly type: "document";
345
407
  readonly source: {
@@ -359,7 +421,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
359
421
  };
360
422
  readonly cache_control?: {
361
423
  readonly type: "ephemeral";
362
- readonly ttl?: "1h" | "5m" | undefined;
424
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
363
425
  } | undefined;
364
426
  readonly title?: string | undefined;
365
427
  readonly context?: string | undefined;
@@ -370,7 +432,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
370
432
  readonly is_error?: boolean | undefined;
371
433
  readonly cache_control?: {
372
434
  readonly type: "ephemeral";
373
- readonly ttl?: "1h" | "5m" | undefined;
435
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
374
436
  } | undefined;
375
437
  })[];
376
438
  } | {
@@ -383,7 +445,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
383
445
  readonly text: string;
384
446
  readonly cache_control?: {
385
447
  readonly type: "ephemeral";
386
- readonly ttl?: "1h" | "5m" | undefined;
448
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
387
449
  } | undefined;
388
450
  } | {
389
451
  readonly type: "thinking";
@@ -391,14 +453,14 @@ export declare const messagesRoute: import("../route/client.js").Route<{
391
453
  readonly signature: string;
392
454
  readonly cache_control?: {
393
455
  readonly type: "ephemeral";
394
- readonly ttl?: "1h" | "5m" | undefined;
456
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
395
457
  } | undefined;
396
458
  } | {
397
459
  readonly type: "redacted_thinking";
398
460
  readonly data: string;
399
461
  readonly cache_control?: {
400
462
  readonly type: "ephemeral";
401
- readonly ttl?: "1h" | "5m" | undefined;
463
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
402
464
  } | undefined;
403
465
  } | {
404
466
  readonly type: "tool_use";
@@ -407,7 +469,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
407
469
  readonly input: unknown;
408
470
  readonly cache_control?: {
409
471
  readonly type: "ephemeral";
410
- readonly ttl?: "1h" | "5m" | undefined;
472
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
411
473
  } | undefined;
412
474
  } | {
413
475
  readonly type: "server_tool_use";
@@ -416,7 +478,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
416
478
  readonly input: unknown;
417
479
  readonly cache_control?: {
418
480
  readonly type: "ephemeral";
419
- readonly ttl?: "1h" | "5m" | undefined;
481
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
420
482
  } | undefined;
421
483
  } | {
422
484
  readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
@@ -424,7 +486,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
424
486
  readonly content: unknown;
425
487
  readonly cache_control?: {
426
488
  readonly type: "ephemeral";
427
- readonly ttl?: "1h" | "5m" | undefined;
489
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
428
490
  } | undefined;
429
491
  })[];
430
492
  } | {
@@ -434,7 +496,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
434
496
  readonly text: string;
435
497
  readonly cache_control?: {
436
498
  readonly type: "ephemeral";
437
- readonly ttl?: "1h" | "5m" | undefined;
499
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
438
500
  } | undefined;
439
501
  }[];
440
502
  readonly output_config?: {
@@ -449,7 +511,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
449
511
  };
450
512
  readonly cache_control?: {
451
513
  readonly type: "ephemeral";
452
- readonly ttl?: "1h" | "5m" | undefined;
514
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
453
515
  } | undefined;
454
516
  }[] | undefined;
455
517
  readonly tool_choice?: {
@@ -493,7 +555,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
493
555
  } | undefined;
494
556
  readonly cache_control?: {
495
557
  readonly type: "ephemeral";
496
- readonly ttl?: "1h" | "5m" | undefined;
558
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
497
559
  } | undefined;
498
560
  readonly container?: string | {
499
561
  readonly id?: string | null | undefined;
@@ -506,6 +568,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
506
568
  readonly user_id?: string | null | undefined;
507
569
  } | undefined;
508
570
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
571
+ readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
509
572
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
510
573
  export declare const route: import("../route/client.js").Route<{
511
574
  readonly model: string;
@@ -516,6 +579,11 @@ export declare const route: import("../route/client.js").Route<{
516
579
  readonly image_url: {
517
580
  readonly url: string;
518
581
  };
582
+ } | {
583
+ readonly type: "video_url";
584
+ readonly video_url: {
585
+ readonly url: string;
586
+ };
519
587
  } | {
520
588
  readonly type: "file";
521
589
  readonly file: {
@@ -537,6 +605,11 @@ export declare const route: import("../route/client.js").Route<{
537
605
  readonly image_url: {
538
606
  readonly url: string;
539
607
  };
608
+ } | {
609
+ readonly type: "video_url";
610
+ readonly video_url: {
611
+ readonly url: string;
612
+ };
540
613
  } | {
541
614
  readonly type: "file";
542
615
  readonly file: {
@@ -573,7 +646,14 @@ export declare const route: import("../route/client.js").Route<{
573
646
  readonly ttl?: string | undefined;
574
647
  } | undefined;
575
648
  }[] | null;
576
- readonly tool_calls?: readonly {
649
+ readonly tool_calls?: readonly ({
650
+ readonly id: string;
651
+ readonly type: "custom";
652
+ readonly custom: {
653
+ readonly name: string;
654
+ readonly input: string;
655
+ };
656
+ } | {
577
657
  readonly id: string;
578
658
  readonly type: "function";
579
659
  readonly function: {
@@ -585,13 +665,13 @@ export declare const route: import("../route/client.js").Route<{
585
665
  readonly thought_signature: string;
586
666
  };
587
667
  } | undefined;
588
- }[] | undefined;
668
+ })[] | undefined;
589
669
  readonly reasoning_content?: string | undefined;
590
670
  readonly reasoning?: string | undefined;
591
671
  readonly reasoning_text?: string | undefined;
592
672
  readonly reasoning_details?: unknown;
593
673
  })[];
594
- readonly tools?: readonly {
674
+ readonly tools?: readonly ({
595
675
  readonly type: "function";
596
676
  readonly function: {
597
677
  readonly name: string;
@@ -605,12 +685,36 @@ export declare const route: import("../route/client.js").Route<{
605
685
  readonly type: "ephemeral";
606
686
  readonly ttl?: string | undefined;
607
687
  } | undefined;
608
- }[] | undefined;
688
+ } | {
689
+ readonly type: "custom";
690
+ readonly custom: {
691
+ readonly name: string;
692
+ readonly description: string;
693
+ readonly format: {
694
+ readonly type: "text";
695
+ } | {
696
+ readonly type: "grammar";
697
+ readonly grammar: {
698
+ readonly syntax: "lark" | "regex";
699
+ readonly definition: string;
700
+ };
701
+ };
702
+ };
703
+ readonly cache_control?: {
704
+ readonly type: "ephemeral";
705
+ readonly ttl?: string | undefined;
706
+ } | undefined;
707
+ })[] | undefined;
609
708
  readonly tool_choice?: "auto" | "none" | "required" | {
610
709
  readonly type: "function";
611
710
  readonly function: {
612
711
  readonly name: string;
613
712
  };
713
+ } | {
714
+ readonly type: "custom";
715
+ readonly custom: {
716
+ readonly name: string;
717
+ };
614
718
  } | undefined;
615
719
  readonly stream: true;
616
720
  readonly stream_options?: {
@@ -618,7 +722,18 @@ export declare const route: import("../route/client.js").Route<{
618
722
  } | undefined;
619
723
  readonly store?: boolean | undefined;
620
724
  readonly prompt_cache_key?: string | undefined;
725
+ readonly prompt_cache_retention?: string | undefined;
726
+ readonly prompt_cache_options?: {
727
+ readonly ttl?: string | undefined;
728
+ } | undefined;
621
729
  readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
730
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
731
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
732
+ readonly parallel_tool_calls?: boolean | undefined;
733
+ readonly metadata?: {
734
+ readonly [x: string]: string;
735
+ } | undefined;
736
+ readonly safety_identifier?: string | undefined;
622
737
  readonly tool_stream?: boolean | undefined;
623
738
  readonly max_completion_tokens?: number | undefined;
624
739
  readonly max_tokens?: number | undefined;
@@ -647,7 +762,7 @@ export declare const routes: (import("../route/client.js").Route<{
647
762
  readonly text: string;
648
763
  readonly cache_control?: {
649
764
  readonly type: "ephemeral";
650
- readonly ttl?: "1h" | "5m" | undefined;
765
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
651
766
  } | undefined;
652
767
  }[] | undefined;
653
768
  readonly messages: readonly ({
@@ -657,7 +772,7 @@ export declare const routes: (import("../route/client.js").Route<{
657
772
  readonly text: string;
658
773
  readonly cache_control?: {
659
774
  readonly type: "ephemeral";
660
- readonly ttl?: "1h" | "5m" | undefined;
775
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
661
776
  } | undefined;
662
777
  } | {
663
778
  readonly type: "image";
@@ -674,11 +789,28 @@ export declare const routes: (import("../route/client.js").Route<{
674
789
  };
675
790
  readonly cache_control?: {
676
791
  readonly type: "ephemeral";
677
- readonly ttl?: "1h" | "5m" | undefined;
792
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
678
793
  } | undefined;
679
794
  readonly transformations?: {
680
795
  readonly oversized_image?: "downsize" | "error" | undefined;
681
796
  } | undefined;
797
+ } | {
798
+ readonly type: "video";
799
+ readonly source: {
800
+ readonly type: "base64";
801
+ readonly media_type: string;
802
+ readonly data: string;
803
+ } | {
804
+ readonly type: "url";
805
+ readonly url: string;
806
+ } | {
807
+ readonly type: "file";
808
+ readonly file_id: string;
809
+ };
810
+ readonly cache_control?: {
811
+ readonly type: "ephemeral";
812
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
813
+ } | undefined;
682
814
  } | {
683
815
  readonly type: "document";
684
816
  readonly source: {
@@ -698,7 +830,7 @@ export declare const routes: (import("../route/client.js").Route<{
698
830
  };
699
831
  readonly cache_control?: {
700
832
  readonly type: "ephemeral";
701
- readonly ttl?: "1h" | "5m" | undefined;
833
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
702
834
  } | undefined;
703
835
  readonly title?: string | undefined;
704
836
  readonly context?: string | undefined;
@@ -713,7 +845,7 @@ export declare const routes: (import("../route/client.js").Route<{
713
845
  readonly text: string;
714
846
  readonly cache_control?: {
715
847
  readonly type: "ephemeral";
716
- readonly ttl?: "1h" | "5m" | undefined;
848
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
717
849
  } | undefined;
718
850
  } | {
719
851
  readonly type: "image";
@@ -730,11 +862,28 @@ export declare const routes: (import("../route/client.js").Route<{
730
862
  };
731
863
  readonly cache_control?: {
732
864
  readonly type: "ephemeral";
733
- readonly ttl?: "1h" | "5m" | undefined;
865
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
734
866
  } | undefined;
735
867
  readonly transformations?: {
736
868
  readonly oversized_image?: "downsize" | "error" | undefined;
737
869
  } | undefined;
870
+ } | {
871
+ readonly type: "video";
872
+ readonly source: {
873
+ readonly type: "base64";
874
+ readonly media_type: string;
875
+ readonly data: string;
876
+ } | {
877
+ readonly type: "url";
878
+ readonly url: string;
879
+ } | {
880
+ readonly type: "file";
881
+ readonly file_id: string;
882
+ };
883
+ readonly cache_control?: {
884
+ readonly type: "ephemeral";
885
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
886
+ } | undefined;
738
887
  } | {
739
888
  readonly type: "document";
740
889
  readonly source: {
@@ -754,7 +903,7 @@ export declare const routes: (import("../route/client.js").Route<{
754
903
  };
755
904
  readonly cache_control?: {
756
905
  readonly type: "ephemeral";
757
- readonly ttl?: "1h" | "5m" | undefined;
906
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
758
907
  } | undefined;
759
908
  readonly title?: string | undefined;
760
909
  readonly context?: string | undefined;
@@ -765,7 +914,7 @@ export declare const routes: (import("../route/client.js").Route<{
765
914
  readonly is_error?: boolean | undefined;
766
915
  readonly cache_control?: {
767
916
  readonly type: "ephemeral";
768
- readonly ttl?: "1h" | "5m" | undefined;
917
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
769
918
  } | undefined;
770
919
  })[];
771
920
  } | {
@@ -778,7 +927,7 @@ export declare const routes: (import("../route/client.js").Route<{
778
927
  readonly text: string;
779
928
  readonly cache_control?: {
780
929
  readonly type: "ephemeral";
781
- readonly ttl?: "1h" | "5m" | undefined;
930
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
782
931
  } | undefined;
783
932
  } | {
784
933
  readonly type: "thinking";
@@ -786,14 +935,14 @@ export declare const routes: (import("../route/client.js").Route<{
786
935
  readonly signature: string;
787
936
  readonly cache_control?: {
788
937
  readonly type: "ephemeral";
789
- readonly ttl?: "1h" | "5m" | undefined;
938
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
790
939
  } | undefined;
791
940
  } | {
792
941
  readonly type: "redacted_thinking";
793
942
  readonly data: string;
794
943
  readonly cache_control?: {
795
944
  readonly type: "ephemeral";
796
- readonly ttl?: "1h" | "5m" | undefined;
945
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
797
946
  } | undefined;
798
947
  } | {
799
948
  readonly type: "tool_use";
@@ -802,7 +951,7 @@ export declare const routes: (import("../route/client.js").Route<{
802
951
  readonly input: unknown;
803
952
  readonly cache_control?: {
804
953
  readonly type: "ephemeral";
805
- readonly ttl?: "1h" | "5m" | undefined;
954
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
806
955
  } | undefined;
807
956
  } | {
808
957
  readonly type: "server_tool_use";
@@ -811,7 +960,7 @@ export declare const routes: (import("../route/client.js").Route<{
811
960
  readonly input: unknown;
812
961
  readonly cache_control?: {
813
962
  readonly type: "ephemeral";
814
- readonly ttl?: "1h" | "5m" | undefined;
963
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
815
964
  } | undefined;
816
965
  } | {
817
966
  readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
@@ -819,7 +968,7 @@ export declare const routes: (import("../route/client.js").Route<{
819
968
  readonly content: unknown;
820
969
  readonly cache_control?: {
821
970
  readonly type: "ephemeral";
822
- readonly ttl?: "1h" | "5m" | undefined;
971
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
823
972
  } | undefined;
824
973
  })[];
825
974
  } | {
@@ -829,7 +978,7 @@ export declare const routes: (import("../route/client.js").Route<{
829
978
  readonly text: string;
830
979
  readonly cache_control?: {
831
980
  readonly type: "ephemeral";
832
- readonly ttl?: "1h" | "5m" | undefined;
981
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
833
982
  } | undefined;
834
983
  }[];
835
984
  readonly output_config?: {
@@ -844,7 +993,7 @@ export declare const routes: (import("../route/client.js").Route<{
844
993
  };
845
994
  readonly cache_control?: {
846
995
  readonly type: "ephemeral";
847
- readonly ttl?: "1h" | "5m" | undefined;
996
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
848
997
  } | undefined;
849
998
  }[] | undefined;
850
999
  readonly tool_choice?: {
@@ -888,7 +1037,7 @@ export declare const routes: (import("../route/client.js").Route<{
888
1037
  } | undefined;
889
1038
  readonly cache_control?: {
890
1039
  readonly type: "ephemeral";
891
- readonly ttl?: "1h" | "5m" | undefined;
1040
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
892
1041
  } | undefined;
893
1042
  readonly container?: string | {
894
1043
  readonly id?: string | null | undefined;
@@ -901,6 +1050,7 @@ export declare const routes: (import("../route/client.js").Route<{
901
1050
  readonly user_id?: string | null | undefined;
902
1051
  } | undefined;
903
1052
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
1053
+ readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
904
1054
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
905
1055
  readonly model: string;
906
1056
  readonly messages: readonly ({
@@ -910,6 +1060,11 @@ export declare const routes: (import("../route/client.js").Route<{
910
1060
  readonly image_url: {
911
1061
  readonly url: string;
912
1062
  };
1063
+ } | {
1064
+ readonly type: "video_url";
1065
+ readonly video_url: {
1066
+ readonly url: string;
1067
+ };
913
1068
  } | {
914
1069
  readonly type: "file";
915
1070
  readonly file: {
@@ -931,6 +1086,11 @@ export declare const routes: (import("../route/client.js").Route<{
931
1086
  readonly image_url: {
932
1087
  readonly url: string;
933
1088
  };
1089
+ } | {
1090
+ readonly type: "video_url";
1091
+ readonly video_url: {
1092
+ readonly url: string;
1093
+ };
934
1094
  } | {
935
1095
  readonly type: "file";
936
1096
  readonly file: {
@@ -967,7 +1127,14 @@ export declare const routes: (import("../route/client.js").Route<{
967
1127
  readonly ttl?: string | undefined;
968
1128
  } | undefined;
969
1129
  }[] | null;
970
- readonly tool_calls?: readonly {
1130
+ readonly tool_calls?: readonly ({
1131
+ readonly id: string;
1132
+ readonly type: "custom";
1133
+ readonly custom: {
1134
+ readonly name: string;
1135
+ readonly input: string;
1136
+ };
1137
+ } | {
971
1138
  readonly id: string;
972
1139
  readonly type: "function";
973
1140
  readonly function: {
@@ -979,13 +1146,13 @@ export declare const routes: (import("../route/client.js").Route<{
979
1146
  readonly thought_signature: string;
980
1147
  };
981
1148
  } | undefined;
982
- }[] | undefined;
1149
+ })[] | undefined;
983
1150
  readonly reasoning_content?: string | undefined;
984
1151
  readonly reasoning?: string | undefined;
985
1152
  readonly reasoning_text?: string | undefined;
986
1153
  readonly reasoning_details?: unknown;
987
1154
  })[];
988
- readonly tools?: readonly {
1155
+ readonly tools?: readonly ({
989
1156
  readonly type: "function";
990
1157
  readonly function: {
991
1158
  readonly name: string;
@@ -999,12 +1166,36 @@ export declare const routes: (import("../route/client.js").Route<{
999
1166
  readonly type: "ephemeral";
1000
1167
  readonly ttl?: string | undefined;
1001
1168
  } | undefined;
1002
- }[] | undefined;
1169
+ } | {
1170
+ readonly type: "custom";
1171
+ readonly custom: {
1172
+ readonly name: string;
1173
+ readonly description: string;
1174
+ readonly format: {
1175
+ readonly type: "text";
1176
+ } | {
1177
+ readonly type: "grammar";
1178
+ readonly grammar: {
1179
+ readonly syntax: "lark" | "regex";
1180
+ readonly definition: string;
1181
+ };
1182
+ };
1183
+ };
1184
+ readonly cache_control?: {
1185
+ readonly type: "ephemeral";
1186
+ readonly ttl?: string | undefined;
1187
+ } | undefined;
1188
+ })[] | undefined;
1003
1189
  readonly tool_choice?: "auto" | "none" | "required" | {
1004
1190
  readonly type: "function";
1005
1191
  readonly function: {
1006
1192
  readonly name: string;
1007
1193
  };
1194
+ } | {
1195
+ readonly type: "custom";
1196
+ readonly custom: {
1197
+ readonly name: string;
1198
+ };
1008
1199
  } | undefined;
1009
1200
  readonly stream: true;
1010
1201
  readonly stream_options?: {
@@ -1012,7 +1203,18 @@ export declare const routes: (import("../route/client.js").Route<{
1012
1203
  } | undefined;
1013
1204
  readonly store?: boolean | undefined;
1014
1205
  readonly prompt_cache_key?: string | undefined;
1206
+ readonly prompt_cache_retention?: string | undefined;
1207
+ readonly prompt_cache_options?: {
1208
+ readonly ttl?: string | undefined;
1209
+ } | undefined;
1015
1210
  readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
1211
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1212
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1213
+ readonly parallel_tool_calls?: boolean | undefined;
1214
+ readonly metadata?: {
1215
+ readonly [x: string]: string;
1216
+ } | undefined;
1217
+ readonly safety_identifier?: string | undefined;
1016
1218
  readonly tool_stream?: boolean | undefined;
1017
1219
  readonly max_completion_tokens?: number | undefined;
1018
1220
  readonly max_tokens?: number | undefined;
@@ -1038,7 +1240,7 @@ export declare const routes: (import("../route/client.js").Route<{
1038
1240
  readonly role: "developer";
1039
1241
  readonly content: string;
1040
1242
  } | {
1041
- readonly type: "function_call_output";
1243
+ readonly type: "custom_tool_call_output" | "function_call_output";
1042
1244
  readonly call_id: string;
1043
1245
  readonly output: string | readonly ({
1044
1246
  readonly type: "input_text";
@@ -1075,6 +1277,9 @@ export declare const routes: (import("../route/client.js").Route<{
1075
1277
  readonly content: readonly ({
1076
1278
  readonly type: "input_text";
1077
1279
  readonly text: string;
1280
+ } | {
1281
+ readonly type: "input_video";
1282
+ readonly video_url: string;
1078
1283
  } | {
1079
1284
  readonly type: "input_image";
1080
1285
  readonly image_url: string;
@@ -1105,6 +1310,12 @@ export declare const routes: (import("../route/client.js").Route<{
1105
1310
  readonly name: string;
1106
1311
  readonly namespace?: string | undefined;
1107
1312
  readonly arguments: string;
1313
+ } | {
1314
+ readonly type: "custom_tool_call";
1315
+ readonly id?: string | undefined;
1316
+ readonly call_id: string;
1317
+ readonly name: string;
1318
+ readonly input: string;
1108
1319
  } | {
1109
1320
  readonly [x: string]: unknown;
1110
1321
  readonly type: "web_search_call";
@@ -1161,10 +1372,6 @@ export declare const routes: (import("../route/client.js").Route<{
1161
1372
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1162
1373
  readonly prompt_cache_key?: string | undefined;
1163
1374
  readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
1164
- readonly reasoning?: {
1165
- readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
1166
- readonly summary?: "auto" | "concise" | "detailed" | undefined;
1167
- } | undefined;
1168
1375
  readonly text?: {
1169
1376
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1170
1377
  } | undefined;
@@ -1175,7 +1382,22 @@ export declare const routes: (import("../route/client.js").Route<{
1175
1382
  readonly top_p?: number | undefined;
1176
1383
  readonly presence_penalty?: number | undefined;
1177
1384
  readonly frequency_penalty?: number | undefined;
1385
+ readonly prompt_cache_retention?: string | undefined;
1386
+ readonly prompt_cache_options?: {
1387
+ readonly ttl?: string | undefined;
1388
+ } | undefined;
1178
1389
  readonly tools?: readonly ({
1390
+ readonly type: "custom";
1391
+ readonly name: string;
1392
+ readonly description: string;
1393
+ readonly format: {
1394
+ readonly type: "text";
1395
+ } | {
1396
+ readonly type: "grammar";
1397
+ readonly syntax: "lark" | "regex";
1398
+ readonly definition: string;
1399
+ };
1400
+ } | {
1179
1401
  readonly type: "namespace";
1180
1402
  readonly name: string;
1181
1403
  readonly description: string;
@@ -1208,18 +1430,24 @@ export declare const routes: (import("../route/client.js").Route<{
1208
1430
  readonly size?: string | undefined;
1209
1431
  })[] | undefined;
1210
1432
  readonly tool_choice?: "auto" | "none" | "required" | {
1211
- readonly type: "function";
1433
+ readonly type: "custom" | "function";
1212
1434
  readonly name: string;
1213
1435
  } | {
1214
1436
  readonly type: "allowed_tools";
1215
1437
  readonly mode: "auto" | "none" | "required";
1216
1438
  readonly tools: readonly {
1217
- readonly type: "function";
1439
+ readonly type: "custom" | "function";
1218
1440
  readonly name: string;
1219
1441
  }[];
1220
1442
  } | {
1221
1443
  readonly type: "image_generation";
1222
1444
  } | undefined;
1445
+ readonly reasoning?: {
1446
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
1447
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
1448
+ readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
1449
+ readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
1450
+ } | undefined;
1223
1451
  readonly context_management?: readonly {
1224
1452
  readonly type: "compaction";
1225
1453
  readonly compact_threshold?: number | undefined;
@@ -1229,17 +1457,19 @@ export declare const routes: (import("../route/client.js").Route<{
1229
1457
  endpoint: import("../route/client.js").CompactOperation;
1230
1458
  trigger: import("../route/client.js").TriggerCompactOperation;
1231
1459
  }>)[];
1232
- export declare const configure: (input: LanguageModelOptions) => {
1460
+ export declare const configure: (input: Config) => {
1233
1461
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
1234
1462
  model: (value: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
1235
1463
  endpoint: import("../route/client.js").CompactOperation;
1236
1464
  trigger: import("../route/client.js").TriggerCompactOperation;
1237
1465
  }>;
1466
+ decision: (value: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
1238
1467
  configure: typeof configure;
1239
1468
  };
1240
1469
  export declare const provider: {
1241
1470
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
1242
1471
  configure: typeof configure;
1243
1472
  };
1244
- export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
1473
+ export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
1474
+ export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
1245
1475
  export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";