@opencode/ai 2.1.3 → 2.2.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 (288) hide show
  1. package/README.md +283 -114
  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 +13 -22
  22. package/dist/image-client.js +0 -1
  23. package/dist/image.d.ts +154 -324
  24. package/dist/image.js +4 -11
  25. package/dist/index.d.ts +1426 -34
  26. package/dist/index.js +127 -24
  27. package/dist/llm.d.ts +16 -1
  28. package/dist/llm.js +34 -0
  29. package/dist/media-client.d.ts +2 -1
  30. package/dist/media-model.d.ts +3 -0
  31. package/dist/media-model.js +4 -1
  32. package/dist/media.d.ts +0 -7
  33. package/dist/media.js +0 -6
  34. package/dist/protocols/alibaba-chat.d.ts +32 -12
  35. package/dist/protocols/alibaba-images.d.ts +22 -0
  36. package/dist/protocols/alibaba-images.js +77 -0
  37. package/dist/protocols/alibaba-messages.d.ts +62 -27
  38. package/dist/protocols/alibaba-responses.d.ts +41 -38
  39. package/dist/protocols/anthropic-messages.d.ts +196 -94
  40. package/dist/protocols/anthropic-messages.js +47 -16
  41. package/dist/protocols/bedrock-converse.d.ts +140 -47
  42. package/dist/protocols/bedrock-converse.js +114 -18
  43. package/dist/protocols/bedrock-event-stream.js +1 -0
  44. package/dist/protocols/bfl-images.d.ts +9 -0
  45. package/dist/protocols/bfl-images.js +17 -15
  46. package/dist/protocols/cartesia-speech.d.ts +32 -50
  47. package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
  48. package/dist/protocols/cloudflare-run-decisions.js +36 -0
  49. package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
  50. package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
  51. package/dist/protocols/cohere-chat.d.ts +7 -8
  52. package/dist/protocols/deepgram-speech.d.ts +32 -50
  53. package/dist/protocols/elevenlabs-speech.d.ts +32 -50
  54. package/dist/protocols/fal-images.d.ts +10 -1
  55. package/dist/protocols/fal-images.js +16 -25
  56. package/dist/protocols/fal-video.js +1 -1
  57. package/dist/protocols/gemini.d.ts +37 -34
  58. package/dist/protocols/gemini.js +13 -8
  59. package/dist/protocols/google-images.d.ts +2 -2
  60. package/dist/protocols/google-images.js +8 -37
  61. package/dist/protocols/google-interactions.d.ts +18 -14
  62. package/dist/protocols/google-interactions.js +14 -7
  63. package/dist/protocols/google-speech.d.ts +32 -50
  64. package/dist/protocols/google-speech.js +0 -1
  65. package/dist/protocols/google-transcription.d.ts +32 -50
  66. package/dist/protocols/google-transcription.js +0 -1
  67. package/dist/protocols/google-video.d.ts +1 -1
  68. package/dist/protocols/google-video.js +2 -7
  69. package/dist/protocols/index.d.ts +3 -0
  70. package/dist/protocols/index.js +3 -0
  71. package/dist/protocols/meta-images.d.ts +7 -1
  72. package/dist/protocols/meta-images.js +10 -8
  73. package/dist/protocols/meta-messages.d.ts +73 -38
  74. package/dist/protocols/meta-messages.js +14 -1
  75. package/dist/protocols/meta-responses.d.ts +84 -78
  76. package/dist/protocols/meta-responses.js +29 -1
  77. package/dist/protocols/mistral-chat.d.ts +81 -78
  78. package/dist/protocols/mistral-chat.js +2 -1
  79. package/dist/protocols/open-responses-channel.js +47 -46
  80. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  81. package/dist/protocols/open-responses-continuation.js +3 -1
  82. package/dist/protocols/open-responses.d.ts +426 -396
  83. package/dist/protocols/open-responses.js +16 -25
  84. package/dist/protocols/openai-chat.d.ts +764 -52
  85. package/dist/protocols/openai-chat.js +38 -25
  86. package/dist/protocols/openai-compatible-chat.d.ts +35 -15
  87. package/dist/protocols/openai-compatible-responses.d.ts +44 -42
  88. package/dist/protocols/openai-decisions.d.ts +22 -0
  89. package/dist/protocols/openai-decisions.js +128 -0
  90. package/dist/protocols/openai-images.d.ts +53 -56
  91. package/dist/protocols/openai-images.js +100 -34
  92. package/dist/protocols/openai-responses.d.ts +322 -264
  93. package/dist/protocols/openai-responses.js +33 -3
  94. package/dist/protocols/openai-speech.d.ts +32 -50
  95. package/dist/protocols/openai-speech.js +15 -5
  96. package/dist/protocols/openai-transcription.d.ts +32 -50
  97. package/dist/protocols/openai-transcription.js +15 -11
  98. package/dist/protocols/replicate-images.js +1 -1
  99. package/dist/protocols/runway-video.d.ts +1 -1
  100. package/dist/protocols/runway-video.js +1 -1
  101. package/dist/protocols/shared.d.ts +9 -1
  102. package/dist/protocols/shared.js +13 -2
  103. package/dist/protocols/stability-images.d.ts +5 -0
  104. package/dist/protocols/stability-images.js +4 -9
  105. package/dist/protocols/system-one.d.ts +101 -0
  106. package/dist/protocols/system-one.js +230 -0
  107. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  108. package/dist/protocols/utils/bedrock-cache.js +7 -6
  109. package/dist/protocols/utils/cache.d.ts +14 -3
  110. package/dist/protocols/utils/cache.js +11 -4
  111. package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
  112. package/dist/protocols/utils/gemini-generate-content.js +10 -16
  113. package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
  114. package/dist/protocols/utils/gemini-json-schema.js +3 -3
  115. package/dist/protocols/utils/image-sizing.d.ts +31 -0
  116. package/dist/protocols/utils/image-sizing.js +73 -0
  117. package/dist/protocols/utils/media-input.d.ts +4 -5
  118. package/dist/protocols/utils/media-input.js +8 -5
  119. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  120. package/dist/protocols/utils/partial-json-options.js +0 -1
  121. package/dist/protocols/utils/speech-stream.d.ts +0 -1
  122. package/dist/protocols/utils/speech-stream.js +0 -1
  123. package/dist/protocols/utils/tool-schema.js +15 -5
  124. package/dist/protocols/utils/tool-stream.d.ts +10 -1
  125. package/dist/protocols/venice-chat.d.ts +71 -53
  126. package/dist/protocols/venice-chat.js +7 -6
  127. package/dist/protocols/xai-images.d.ts +1 -2
  128. package/dist/protocols/xai-images.js +9 -2
  129. package/dist/protocols/xai-responses.d.ts +88 -78
  130. package/dist/protocols/xai-responses.js +28 -2
  131. package/dist/protocols/xai-video.d.ts +1 -1
  132. package/dist/protocols/xai-video.js +11 -8
  133. package/dist/protocols/zai-chat.d.ts +54 -30
  134. package/dist/protocols/zai-chat.js +8 -3
  135. package/dist/protocols/zai-images.d.ts +3 -1
  136. package/dist/protocols/zai-images.js +12 -11
  137. package/dist/protocols/zai-messages.d.ts +72 -35
  138. package/dist/protocols/zai-messages.js +3 -2
  139. package/dist/provider-error.js +24 -7
  140. package/dist/providers/alibaba/images.d.ts +2 -0
  141. package/dist/providers/alibaba/images.js +1 -0
  142. package/dist/providers/alibaba.d.ts +146 -85
  143. package/dist/providers/alibaba.js +16 -8
  144. package/dist/providers/amazon-bedrock-mantle.d.ts +277 -218
  145. package/dist/providers/amazon-bedrock.d.ts +48 -28
  146. package/dist/providers/amazon-bedrock.js +11 -11
  147. package/dist/providers/anthropic-compatible.d.ts +64 -29
  148. package/dist/providers/anthropic.d.ts +64 -29
  149. package/dist/providers/azure/images.d.ts +2 -0
  150. package/dist/providers/azure/images.js +1 -0
  151. package/dist/providers/azure.d.ts +156 -115
  152. package/dist/providers/azure.js +19 -1
  153. package/dist/providers/baseten/decisions.d.ts +2 -0
  154. package/dist/providers/baseten/decisions.js +1 -0
  155. package/dist/providers/baseten.d.ts +75 -25
  156. package/dist/providers/baseten.js +41 -8
  157. package/dist/providers/cerebras.d.ts +66 -24
  158. package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
  159. package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
  160. package/dist/providers/cloudflare-ai-gateway.d.ts +409 -272
  161. package/dist/providers/cloudflare-ai-gateway.js +33 -6
  162. package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
  163. package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
  164. package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
  165. package/dist/providers/cloudflare-workers-ai/images.js +1 -0
  166. package/dist/providers/cloudflare-workers-ai.d.ts +79 -25
  167. package/dist/providers/cloudflare-workers-ai.js +45 -9
  168. package/dist/providers/cohere.d.ts +117 -75
  169. package/dist/providers/deepinfra.d.ts +66 -24
  170. package/dist/providers/deepseek.d.ts +66 -24
  171. package/dist/providers/digitalocean/decisions.d.ts +2 -0
  172. package/dist/providers/digitalocean/decisions.js +1 -0
  173. package/dist/providers/digitalocean/images.d.ts +2 -0
  174. package/dist/providers/digitalocean/images.js +1 -0
  175. package/dist/providers/digitalocean.d.ts +108 -37
  176. package/dist/providers/digitalocean.js +39 -8
  177. package/dist/providers/fireworks.d.ts +66 -24
  178. package/dist/providers/google/images.d.ts +2 -0
  179. package/dist/providers/google/images.js +1 -0
  180. package/dist/providers/google-vertex/images.d.ts +2 -0
  181. package/dist/providers/google-vertex/images.js +1 -0
  182. package/dist/providers/google-vertex-chat.d.ts +33 -12
  183. package/dist/providers/google-vertex-messages.d.ts +64 -29
  184. package/dist/providers/google-vertex-mistral.d.ts +17 -17
  185. package/dist/providers/google-vertex-responses.d.ts +38 -35
  186. package/dist/providers/google-vertex.d.ts +20 -18
  187. package/dist/providers/google-vertex.js +32 -15
  188. package/dist/providers/google.d.ts +22 -21
  189. package/dist/providers/google.js +15 -8
  190. package/dist/providers/groq.d.ts +66 -28
  191. package/dist/providers/groq.js +0 -6
  192. package/dist/providers/meta.d.ts +144 -85
  193. package/dist/providers/minimax.d.ts +145 -86
  194. package/dist/providers/mistral.d.ts +28 -28
  195. package/dist/providers/moonshot.d.ts +277 -218
  196. package/dist/providers/open-responses-options.d.ts +0 -1
  197. package/dist/providers/open-responses-options.js +1 -1
  198. package/dist/providers/openai/images.d.ts +2 -0
  199. package/dist/providers/openai/images.js +1 -0
  200. package/dist/providers/openai-compatible/images.d.ts +2 -0
  201. package/dist/providers/openai-compatible/images.js +1 -0
  202. package/dist/providers/openai-compatible-responses.d.ts +38 -35
  203. package/dist/providers/openai-compatible.d.ts +36 -13
  204. package/dist/providers/openai-compatible.js +22 -10
  205. package/dist/providers/openai-options.d.ts +3 -2
  206. package/dist/providers/openai-options.js +0 -1
  207. package/dist/providers/openai.d.ts +146 -109
  208. package/dist/providers/openai.js +20 -4
  209. package/dist/providers/opencode/decisions.d.ts +2 -0
  210. package/dist/providers/opencode/decisions.js +1 -0
  211. package/dist/providers/opencode.d.ts +9 -10
  212. package/dist/providers/opencode.js +10 -8
  213. package/dist/providers/openrouter/decisions.d.ts +2 -0
  214. package/dist/providers/openrouter/decisions.js +1 -0
  215. package/dist/providers/openrouter/images.d.ts +2 -0
  216. package/dist/providers/openrouter/images.js +1 -0
  217. package/dist/providers/openrouter.d.ts +128 -47
  218. package/dist/providers/openrouter.js +38 -16
  219. package/dist/providers/togetherai.d.ts +66 -24
  220. package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
  221. package/dist/providers/typesafe-ai/decisions.js +1 -0
  222. package/dist/providers/typesafe-ai.d.ts +9 -10
  223. package/dist/providers/typesafe-ai.js +10 -8
  224. package/dist/providers/venice.d.ts +214 -20
  225. package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
  226. package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
  227. package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
  228. package/dist/providers/vercel-ai-gateway/images.js +1 -0
  229. package/dist/providers/vercel-ai-gateway.d.ts +10 -16
  230. package/dist/providers/vercel-ai-gateway.js +31 -85
  231. package/dist/providers/xai/images.d.ts +2 -0
  232. package/dist/providers/xai/images.js +1 -0
  233. package/dist/providers/xai.d.ts +40 -17
  234. package/dist/providers/xai.js +15 -8
  235. package/dist/providers/zai/images.d.ts +2 -0
  236. package/dist/providers/zai/images.js +1 -0
  237. package/dist/providers/zai-coding-plan.d.ts +224 -85
  238. package/dist/providers/zai.d.ts +110 -23
  239. package/dist/providers/zai.js +15 -8
  240. package/dist/route/auth-options.d.ts +0 -3
  241. package/dist/route/auth.d.ts +0 -2
  242. package/dist/route/auth.js +0 -2
  243. package/dist/route/client.d.ts +2 -4
  244. package/dist/route/client.js +29 -8
  245. package/dist/route/decision.d.ts +58 -0
  246. package/dist/route/decision.js +75 -0
  247. package/dist/route/executor-service.js +1 -1
  248. package/dist/route/executor.d.ts +1 -1
  249. package/dist/route/framing.d.ts +2 -0
  250. package/dist/route/index.d.ts +3 -0
  251. package/dist/route/index.js +3 -0
  252. package/dist/route/media-protocol.d.ts +1 -0
  253. package/dist/route/media-protocol.js +12 -8
  254. package/dist/route/media.d.ts +5 -1
  255. package/dist/route/media.js +6 -2
  256. package/dist/route/transport/http.js +1 -0
  257. package/dist/route/transport/index.d.ts +1 -0
  258. package/dist/schema/events.d.ts +148 -6
  259. package/dist/schema/events.js +20 -0
  260. package/dist/schema/messages.d.ts +6 -2
  261. package/dist/schema/messages.js +3 -0
  262. package/dist/schema/options.d.ts +5 -3
  263. package/dist/schema/options.js +8 -3
  264. package/dist/speech-client.d.ts +13 -22
  265. package/dist/speech-client.js +0 -1
  266. package/dist/speech.d.ts +148 -283
  267. package/dist/speech.js +2 -4
  268. package/dist/testing.d.ts +25 -24
  269. package/dist/testing.js +3 -21
  270. package/dist/transcription-client.d.ts +13 -22
  271. package/dist/transcription.d.ts +148 -283
  272. package/dist/transcription.js +1 -1
  273. package/dist/utils/media-type.js +22 -1
  274. package/dist/video-client.d.ts +13 -22
  275. package/dist/video-client.js +0 -1
  276. package/dist/video.d.ts +115 -250
  277. package/dist/video.js +3 -5
  278. package/package.json +516 -13
  279. package/dist/experimental/evaluation-client.d.ts +0 -21
  280. package/dist/experimental/evaluation-client.js +0 -64
  281. package/dist/experimental/evaluation.d.ts +0 -242
  282. package/dist/experimental/evaluation.js +0 -115
  283. package/dist/experimental/system-one.d.ts +0 -16
  284. package/dist/experimental/system-one.js +0 -135
  285. package/dist/promise.d.ts +0 -1021
  286. package/dist/promise.js +0 -101
  287. package/dist/provider.d.ts +0 -23
  288. package/dist/provider.js +0 -2
@@ -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"];
@@ -27,58 +27,15 @@ 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 ({
33
- readonly [x: string]: unknown;
34
- readonly type: "web_search_call";
35
- readonly id: string;
36
- readonly status?: string | undefined;
37
- readonly action?: {
38
- readonly [x: string]: unknown;
39
- } | null | undefined;
40
- } | {
41
- readonly [x: string]: unknown;
42
- readonly type: "file_search_call";
43
- readonly id: string;
44
- readonly status?: string | undefined;
45
- readonly queries?: readonly string[] | undefined;
46
- readonly results?: readonly {
47
- readonly [x: string]: unknown;
48
- }[] | null | undefined;
49
- } | {
50
- readonly [x: string]: unknown;
51
- readonly type: "code_interpreter_call";
52
- readonly id: string;
53
- readonly status?: string | undefined;
54
- readonly code?: string | null | undefined;
55
- readonly container_id?: string | null | undefined;
56
- readonly outputs?: readonly {
57
- readonly [x: string]: unknown;
58
- }[] | null | undefined;
59
- } | {
60
- readonly [x: string]: unknown;
61
- readonly type: "mcp_call";
62
- readonly id: string;
63
- readonly status?: string | undefined;
64
- readonly server_label?: string | undefined;
65
- readonly name?: string | undefined;
66
- readonly arguments?: string | undefined;
67
- readonly output?: string | null | undefined;
68
- readonly error?: unknown;
69
- } | {
70
35
  readonly type: "configuration_update";
71
36
  readonly reasoning: {
72
37
  readonly effort: import("../schema/options.js").ReasoningEffort;
73
38
  };
74
- } | {
75
- readonly [x: string]: unknown;
76
- readonly type: string;
77
- readonly id: string;
78
- } | {
79
- readonly type: "compaction";
80
- readonly id?: string | null | undefined;
81
- readonly encrypted_content: string;
82
39
  } | {
83
40
  readonly type: "message";
84
41
  readonly role: "system";
@@ -87,10 +44,48 @@ export declare const responsesRoute: import("../route/client.js").Route<{
87
44
  readonly type: "message";
88
45
  readonly role: "developer";
89
46
  readonly content: string;
47
+ } | {
48
+ readonly type: "function_call_output";
49
+ readonly call_id: string;
50
+ readonly output: string | readonly ({
51
+ readonly type: "input_text";
52
+ readonly text: string;
53
+ } | {
54
+ readonly type: "input_video";
55
+ readonly video_url: string;
56
+ } | {
57
+ readonly type: "input_image";
58
+ readonly image_url: string;
59
+ readonly detail?: string | undefined;
60
+ } | {
61
+ readonly type: "input_file";
62
+ readonly filename: string;
63
+ readonly detail?: string | undefined;
64
+ readonly file_data?: string | undefined;
65
+ readonly file_url?: string | undefined;
66
+ })[];
67
+ } | {
68
+ readonly type: "reasoning";
69
+ readonly id?: string | undefined;
70
+ readonly summary: readonly {
71
+ readonly type: "summary_text";
72
+ readonly text: string;
73
+ }[];
74
+ readonly encrypted_content?: string | null | undefined;
75
+ } | {
76
+ readonly type: "compaction";
77
+ readonly id?: string | null | undefined;
78
+ readonly encrypted_content: string;
90
79
  } | {
91
80
  readonly type: "message";
92
81
  readonly role: "user";
93
82
  readonly content: readonly ({
83
+ readonly type: "input_text";
84
+ readonly text: string;
85
+ } | {
86
+ readonly type: "input_video";
87
+ readonly video_url: string;
88
+ } | {
94
89
  readonly type: "input_image";
95
90
  readonly image_url: string;
96
91
  readonly detail?: string | undefined;
@@ -100,9 +95,6 @@ export declare const responsesRoute: import("../route/client.js").Route<{
100
95
  readonly detail?: string | undefined;
101
96
  readonly file_data?: string | undefined;
102
97
  readonly file_url?: string | undefined;
103
- } | {
104
- readonly type: "input_text";
105
- readonly text: string;
106
98
  })[];
107
99
  readonly id?: string | undefined;
108
100
  readonly status?: string | undefined;
@@ -116,14 +108,6 @@ export declare const responsesRoute: import("../route/client.js").Route<{
116
108
  }[];
117
109
  readonly phase?: "commentary" | "final_answer" | null | undefined;
118
110
  readonly status?: string | undefined;
119
- } | {
120
- readonly type: "reasoning";
121
- readonly id?: string | undefined;
122
- readonly summary: readonly {
123
- readonly type: "summary_text";
124
- readonly text: string;
125
- }[];
126
- readonly encrypted_content?: string | null | undefined;
127
111
  } | {
128
112
  readonly type: "function_call";
129
113
  readonly id?: string | undefined;
@@ -132,25 +116,46 @@ export declare const responsesRoute: import("../route/client.js").Route<{
132
116
  readonly namespace?: string | undefined;
133
117
  readonly arguments: string;
134
118
  } | {
135
- readonly type: "function_call_output";
136
- readonly call_id: string;
137
- readonly output: string | readonly ({
138
- readonly type: "input_image";
139
- readonly image_url: string;
140
- readonly detail?: string | undefined;
141
- } | {
142
- readonly type: "input_file";
143
- readonly filename: string;
144
- readonly detail?: string | undefined;
145
- readonly file_data?: string | undefined;
146
- readonly file_url?: string | undefined;
147
- } | {
148
- readonly type: "input_text";
149
- readonly text: string;
150
- } | {
151
- readonly type: "input_video";
152
- readonly video_url: string;
153
- })[];
119
+ readonly [x: string]: unknown;
120
+ readonly type: "web_search_call";
121
+ readonly id: string;
122
+ readonly status?: string | undefined;
123
+ readonly action?: {
124
+ readonly [x: string]: unknown;
125
+ } | null | undefined;
126
+ } | {
127
+ readonly [x: string]: unknown;
128
+ readonly type: "file_search_call";
129
+ readonly id: string;
130
+ readonly status?: string | undefined;
131
+ readonly queries?: readonly string[] | undefined;
132
+ readonly results?: readonly {
133
+ readonly [x: string]: unknown;
134
+ }[] | null | undefined;
135
+ } | {
136
+ readonly [x: string]: unknown;
137
+ readonly type: "code_interpreter_call";
138
+ readonly id: string;
139
+ readonly status?: string | undefined;
140
+ readonly code?: string | null | undefined;
141
+ readonly container_id?: string | null | undefined;
142
+ readonly outputs?: readonly {
143
+ readonly [x: string]: unknown;
144
+ }[] | null | undefined;
145
+ } | {
146
+ readonly [x: string]: unknown;
147
+ readonly type: "mcp_call";
148
+ readonly id: string;
149
+ readonly status?: string | undefined;
150
+ readonly server_label?: string | undefined;
151
+ readonly name?: string | undefined;
152
+ readonly arguments?: string | undefined;
153
+ readonly output?: string | null | undefined;
154
+ readonly error?: unknown;
155
+ } | {
156
+ readonly [x: string]: unknown;
157
+ readonly type: string;
158
+ readonly id: string;
154
159
  })[];
155
160
  readonly instructions?: string | undefined;
156
161
  readonly store?: boolean | undefined;
@@ -166,10 +171,6 @@ export declare const responsesRoute: import("../route/client.js").Route<{
166
171
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
167
172
  readonly prompt_cache_key?: string | undefined;
168
173
  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
174
  readonly text?: {
174
175
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
175
176
  } | undefined;
@@ -180,7 +181,24 @@ export declare const responsesRoute: import("../route/client.js").Route<{
180
181
  readonly top_p?: number | undefined;
181
182
  readonly presence_penalty?: number | undefined;
182
183
  readonly frequency_penalty?: number | undefined;
184
+ readonly prompt_cache_retention?: string | undefined;
185
+ readonly prompt_cache_options?: {
186
+ readonly ttl?: string | undefined;
187
+ } | undefined;
183
188
  readonly tools?: readonly ({
189
+ readonly type: "namespace";
190
+ readonly name: string;
191
+ readonly description: string;
192
+ readonly tools: readonly {
193
+ readonly type: "function";
194
+ readonly name: string;
195
+ readonly description: string;
196
+ readonly parameters: {
197
+ readonly [x: string]: unknown;
198
+ };
199
+ readonly strict?: boolean | undefined;
200
+ }[];
201
+ } | {
184
202
  readonly type: "function";
185
203
  readonly name: string;
186
204
  readonly description: string;
@@ -198,19 +216,6 @@ export declare const responsesRoute: import("../route/client.js").Route<{
198
216
  readonly partial_images?: number | undefined;
199
217
  readonly quality?: "auto" | "high" | "low" | "medium" | undefined;
200
218
  readonly size?: string | undefined;
201
- } | {
202
- readonly type: "namespace";
203
- readonly name: string;
204
- readonly description: string;
205
- readonly tools: readonly {
206
- readonly type: "function";
207
- readonly name: string;
208
- readonly description: string;
209
- readonly parameters: {
210
- readonly [x: string]: unknown;
211
- };
212
- readonly strict?: boolean | undefined;
213
- }[];
214
219
  })[] | undefined;
215
220
  readonly tool_choice?: "auto" | "none" | "required" | {
216
221
  readonly type: "function";
@@ -225,6 +230,12 @@ export declare const responsesRoute: import("../route/client.js").Route<{
225
230
  } | {
226
231
  readonly type: "image_generation";
227
232
  } | undefined;
233
+ readonly reasoning?: {
234
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
235
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
236
+ readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
237
+ readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
238
+ } | undefined;
228
239
  readonly context_management?: readonly {
229
240
  readonly type: "compaction";
230
241
  readonly compact_threshold?: number | undefined;
@@ -252,7 +263,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
252
263
  readonly text: string;
253
264
  readonly cache_control?: {
254
265
  readonly type: "ephemeral";
255
- readonly ttl?: "1h" | "5m" | undefined;
266
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
256
267
  } | undefined;
257
268
  }[] | undefined;
258
269
  readonly messages: readonly ({
@@ -262,7 +273,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
262
273
  readonly text: string;
263
274
  readonly cache_control?: {
264
275
  readonly type: "ephemeral";
265
- readonly ttl?: "1h" | "5m" | undefined;
276
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
266
277
  } | undefined;
267
278
  } | {
268
279
  readonly type: "image";
@@ -279,11 +290,28 @@ export declare const messagesRoute: import("../route/client.js").Route<{
279
290
  };
280
291
  readonly cache_control?: {
281
292
  readonly type: "ephemeral";
282
- readonly ttl?: "1h" | "5m" | undefined;
293
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
283
294
  } | undefined;
284
295
  readonly transformations?: {
285
296
  readonly oversized_image?: "downsize" | "error" | undefined;
286
297
  } | undefined;
298
+ } | {
299
+ readonly type: "video";
300
+ readonly source: {
301
+ readonly type: "base64";
302
+ readonly media_type: string;
303
+ readonly data: string;
304
+ } | {
305
+ readonly type: "url";
306
+ readonly url: string;
307
+ } | {
308
+ readonly type: "file";
309
+ readonly file_id: string;
310
+ };
311
+ readonly cache_control?: {
312
+ readonly type: "ephemeral";
313
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
314
+ } | undefined;
287
315
  } | {
288
316
  readonly type: "document";
289
317
  readonly source: {
@@ -303,7 +331,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
303
331
  };
304
332
  readonly cache_control?: {
305
333
  readonly type: "ephemeral";
306
- readonly ttl?: "1h" | "5m" | undefined;
334
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
307
335
  } | undefined;
308
336
  readonly title?: string | undefined;
309
337
  readonly context?: string | undefined;
@@ -318,7 +346,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
318
346
  readonly text: string;
319
347
  readonly cache_control?: {
320
348
  readonly type: "ephemeral";
321
- readonly ttl?: "1h" | "5m" | undefined;
349
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
322
350
  } | undefined;
323
351
  } | {
324
352
  readonly type: "image";
@@ -335,11 +363,28 @@ export declare const messagesRoute: import("../route/client.js").Route<{
335
363
  };
336
364
  readonly cache_control?: {
337
365
  readonly type: "ephemeral";
338
- readonly ttl?: "1h" | "5m" | undefined;
366
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
339
367
  } | undefined;
340
368
  readonly transformations?: {
341
369
  readonly oversized_image?: "downsize" | "error" | undefined;
342
370
  } | undefined;
371
+ } | {
372
+ readonly type: "video";
373
+ readonly source: {
374
+ readonly type: "base64";
375
+ readonly media_type: string;
376
+ readonly data: string;
377
+ } | {
378
+ readonly type: "url";
379
+ readonly url: string;
380
+ } | {
381
+ readonly type: "file";
382
+ readonly file_id: string;
383
+ };
384
+ readonly cache_control?: {
385
+ readonly type: "ephemeral";
386
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
387
+ } | undefined;
343
388
  } | {
344
389
  readonly type: "document";
345
390
  readonly source: {
@@ -359,7 +404,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
359
404
  };
360
405
  readonly cache_control?: {
361
406
  readonly type: "ephemeral";
362
- readonly ttl?: "1h" | "5m" | undefined;
407
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
363
408
  } | undefined;
364
409
  readonly title?: string | undefined;
365
410
  readonly context?: string | undefined;
@@ -370,43 +415,35 @@ export declare const messagesRoute: import("../route/client.js").Route<{
370
415
  readonly is_error?: boolean | undefined;
371
416
  readonly cache_control?: {
372
417
  readonly type: "ephemeral";
373
- readonly ttl?: "1h" | "5m" | undefined;
418
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
374
419
  } | undefined;
375
420
  })[];
376
421
  } | {
377
422
  readonly role: "assistant";
378
423
  readonly content: readonly ({
424
+ readonly type: "compaction";
425
+ readonly content: string | null;
426
+ } | {
379
427
  readonly type: "text";
380
428
  readonly text: string;
381
429
  readonly cache_control?: {
382
430
  readonly type: "ephemeral";
383
- readonly ttl?: "1h" | "5m" | undefined;
431
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
384
432
  } | undefined;
385
- } | {
386
- readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
387
- readonly tool_use_id: string;
388
- readonly content: unknown;
389
- readonly cache_control?: {
390
- readonly type: "ephemeral";
391
- readonly ttl?: "1h" | "5m" | undefined;
392
- } | undefined;
393
- } | {
394
- readonly type: "compaction";
395
- readonly content: string | null;
396
433
  } | {
397
434
  readonly type: "thinking";
398
435
  readonly thinking: string;
399
436
  readonly signature: string;
400
437
  readonly cache_control?: {
401
438
  readonly type: "ephemeral";
402
- readonly ttl?: "1h" | "5m" | undefined;
439
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
403
440
  } | undefined;
404
441
  } | {
405
442
  readonly type: "redacted_thinking";
406
443
  readonly data: string;
407
444
  readonly cache_control?: {
408
445
  readonly type: "ephemeral";
409
- readonly ttl?: "1h" | "5m" | undefined;
446
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
410
447
  } | undefined;
411
448
  } | {
412
449
  readonly type: "tool_use";
@@ -415,7 +452,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
415
452
  readonly input: unknown;
416
453
  readonly cache_control?: {
417
454
  readonly type: "ephemeral";
418
- readonly ttl?: "1h" | "5m" | undefined;
455
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
419
456
  } | undefined;
420
457
  } | {
421
458
  readonly type: "server_tool_use";
@@ -424,7 +461,15 @@ export declare const messagesRoute: import("../route/client.js").Route<{
424
461
  readonly input: unknown;
425
462
  readonly cache_control?: {
426
463
  readonly type: "ephemeral";
427
- readonly ttl?: "1h" | "5m" | undefined;
464
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
465
+ } | undefined;
466
+ } | {
467
+ readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
468
+ readonly tool_use_id: string;
469
+ readonly content: unknown;
470
+ readonly cache_control?: {
471
+ readonly type: "ephemeral";
472
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
428
473
  } | undefined;
429
474
  })[];
430
475
  } | {
@@ -434,7 +479,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
434
479
  readonly text: string;
435
480
  readonly cache_control?: {
436
481
  readonly type: "ephemeral";
437
- readonly ttl?: "1h" | "5m" | undefined;
482
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
438
483
  } | undefined;
439
484
  }[];
440
485
  readonly output_config?: {
@@ -449,7 +494,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
449
494
  };
450
495
  readonly cache_control?: {
451
496
  readonly type: "ephemeral";
452
- readonly ttl?: "1h" | "5m" | undefined;
497
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
453
498
  } | undefined;
454
499
  }[] | undefined;
455
500
  readonly tool_choice?: {
@@ -467,6 +512,8 @@ export declare const messagesRoute: import("../route/client.js").Route<{
467
512
  readonly top_k?: number | undefined;
468
513
  readonly stop_sequences?: readonly string[] | undefined;
469
514
  readonly thinking?: {
515
+ readonly type: "between_tools" | "disabled";
516
+ } | {
470
517
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
471
518
  readonly block_binding?: {
472
519
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -479,8 +526,6 @@ export declare const messagesRoute: import("../route/client.js").Route<{
479
526
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
480
527
  } | undefined;
481
528
  readonly type: "adaptive";
482
- } | {
483
- readonly type: "between_tools" | "disabled";
484
529
  } | undefined;
485
530
  readonly output_config?: {
486
531
  readonly effort?: string | undefined;
@@ -493,7 +538,7 @@ export declare const messagesRoute: import("../route/client.js").Route<{
493
538
  } | undefined;
494
539
  readonly cache_control?: {
495
540
  readonly type: "ephemeral";
496
- readonly ttl?: "1h" | "5m" | undefined;
541
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
497
542
  } | undefined;
498
543
  readonly container?: string | {
499
544
  readonly id?: string | null | undefined;
@@ -506,50 +551,61 @@ export declare const messagesRoute: import("../route/client.js").Route<{
506
551
  readonly user_id?: string | null | undefined;
507
552
  } | undefined;
508
553
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
554
+ readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
509
555
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
510
556
  export declare const route: import("../route/client.js").Route<{
511
557
  readonly model: string;
512
558
  readonly messages: readonly ({
513
559
  readonly role: "system";
514
560
  readonly content: string | readonly ({
515
- readonly type: "text";
516
- readonly text: string;
517
- readonly cache_control?: {
518
- readonly type: "ephemeral";
519
- readonly ttl?: string | undefined;
520
- } | undefined;
521
- } | {
522
561
  readonly type: "image_url";
523
562
  readonly image_url: {
524
563
  readonly url: string;
525
564
  };
565
+ } | {
566
+ readonly type: "video_url";
567
+ readonly video_url: {
568
+ readonly url: string;
569
+ };
526
570
  } | {
527
571
  readonly type: "file";
528
572
  readonly file: {
529
573
  readonly filename: string;
530
574
  readonly file_data: string;
531
575
  };
532
- })[];
533
- } | {
534
- readonly role: "user";
535
- readonly content: string | readonly ({
576
+ } | {
536
577
  readonly type: "text";
537
578
  readonly text: string;
538
579
  readonly cache_control?: {
539
580
  readonly type: "ephemeral";
540
581
  readonly ttl?: string | undefined;
541
582
  } | undefined;
542
- } | {
583
+ })[];
584
+ } | {
585
+ readonly role: "user";
586
+ readonly content: string | readonly ({
543
587
  readonly type: "image_url";
544
588
  readonly image_url: {
545
589
  readonly url: string;
546
590
  };
591
+ } | {
592
+ readonly type: "video_url";
593
+ readonly video_url: {
594
+ readonly url: string;
595
+ };
547
596
  } | {
548
597
  readonly type: "file";
549
598
  readonly file: {
550
599
  readonly filename: string;
551
600
  readonly file_data: string;
552
601
  };
602
+ } | {
603
+ readonly type: "text";
604
+ readonly text: string;
605
+ readonly cache_control?: {
606
+ readonly type: "ephemeral";
607
+ readonly ttl?: string | undefined;
608
+ } | undefined;
553
609
  })[];
554
610
  } | {
555
611
  readonly role: "tool";
@@ -618,7 +674,18 @@ export declare const route: import("../route/client.js").Route<{
618
674
  } | undefined;
619
675
  readonly store?: boolean | undefined;
620
676
  readonly prompt_cache_key?: string | undefined;
677
+ readonly prompt_cache_retention?: string | undefined;
678
+ readonly prompt_cache_options?: {
679
+ readonly ttl?: string | undefined;
680
+ } | undefined;
621
681
  readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
682
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
683
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
684
+ readonly parallel_tool_calls?: boolean | undefined;
685
+ readonly metadata?: {
686
+ readonly [x: string]: string;
687
+ } | undefined;
688
+ readonly safety_identifier?: string | undefined;
622
689
  readonly tool_stream?: boolean | undefined;
623
690
  readonly max_completion_tokens?: number | undefined;
624
691
  readonly max_tokens?: number | undefined;
@@ -647,7 +714,7 @@ export declare const routes: (import("../route/client.js").Route<{
647
714
  readonly text: string;
648
715
  readonly cache_control?: {
649
716
  readonly type: "ephemeral";
650
- readonly ttl?: "1h" | "5m" | undefined;
717
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
651
718
  } | undefined;
652
719
  }[] | undefined;
653
720
  readonly messages: readonly ({
@@ -657,7 +724,7 @@ export declare const routes: (import("../route/client.js").Route<{
657
724
  readonly text: string;
658
725
  readonly cache_control?: {
659
726
  readonly type: "ephemeral";
660
- readonly ttl?: "1h" | "5m" | undefined;
727
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
661
728
  } | undefined;
662
729
  } | {
663
730
  readonly type: "image";
@@ -674,11 +741,28 @@ export declare const routes: (import("../route/client.js").Route<{
674
741
  };
675
742
  readonly cache_control?: {
676
743
  readonly type: "ephemeral";
677
- readonly ttl?: "1h" | "5m" | undefined;
744
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
678
745
  } | undefined;
679
746
  readonly transformations?: {
680
747
  readonly oversized_image?: "downsize" | "error" | undefined;
681
748
  } | undefined;
749
+ } | {
750
+ readonly type: "video";
751
+ readonly source: {
752
+ readonly type: "base64";
753
+ readonly media_type: string;
754
+ readonly data: string;
755
+ } | {
756
+ readonly type: "url";
757
+ readonly url: string;
758
+ } | {
759
+ readonly type: "file";
760
+ readonly file_id: string;
761
+ };
762
+ readonly cache_control?: {
763
+ readonly type: "ephemeral";
764
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
765
+ } | undefined;
682
766
  } | {
683
767
  readonly type: "document";
684
768
  readonly source: {
@@ -698,7 +782,7 @@ export declare const routes: (import("../route/client.js").Route<{
698
782
  };
699
783
  readonly cache_control?: {
700
784
  readonly type: "ephemeral";
701
- readonly ttl?: "1h" | "5m" | undefined;
785
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
702
786
  } | undefined;
703
787
  readonly title?: string | undefined;
704
788
  readonly context?: string | undefined;
@@ -713,10 +797,30 @@ export declare const routes: (import("../route/client.js").Route<{
713
797
  readonly text: string;
714
798
  readonly cache_control?: {
715
799
  readonly type: "ephemeral";
716
- readonly ttl?: "1h" | "5m" | undefined;
800
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
801
+ } | undefined;
802
+ } | {
803
+ readonly type: "image";
804
+ readonly source: {
805
+ readonly type: "base64";
806
+ readonly media_type: string;
807
+ readonly data: string;
808
+ } | {
809
+ readonly type: "url";
810
+ readonly url: string;
811
+ } | {
812
+ readonly type: "file";
813
+ readonly file_id: string;
814
+ };
815
+ readonly cache_control?: {
816
+ readonly type: "ephemeral";
817
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
818
+ } | undefined;
819
+ readonly transformations?: {
820
+ readonly oversized_image?: "downsize" | "error" | undefined;
717
821
  } | undefined;
718
822
  } | {
719
- readonly type: "image";
823
+ readonly type: "video";
720
824
  readonly source: {
721
825
  readonly type: "base64";
722
826
  readonly media_type: string;
@@ -730,10 +834,7 @@ export declare const routes: (import("../route/client.js").Route<{
730
834
  };
731
835
  readonly cache_control?: {
732
836
  readonly type: "ephemeral";
733
- readonly ttl?: "1h" | "5m" | undefined;
734
- } | undefined;
735
- readonly transformations?: {
736
- readonly oversized_image?: "downsize" | "error" | undefined;
837
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
737
838
  } | undefined;
738
839
  } | {
739
840
  readonly type: "document";
@@ -754,7 +855,7 @@ export declare const routes: (import("../route/client.js").Route<{
754
855
  };
755
856
  readonly cache_control?: {
756
857
  readonly type: "ephemeral";
757
- readonly ttl?: "1h" | "5m" | undefined;
858
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
758
859
  } | undefined;
759
860
  readonly title?: string | undefined;
760
861
  readonly context?: string | undefined;
@@ -765,43 +866,35 @@ export declare const routes: (import("../route/client.js").Route<{
765
866
  readonly is_error?: boolean | undefined;
766
867
  readonly cache_control?: {
767
868
  readonly type: "ephemeral";
768
- readonly ttl?: "1h" | "5m" | undefined;
869
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
769
870
  } | undefined;
770
871
  })[];
771
872
  } | {
772
873
  readonly role: "assistant";
773
874
  readonly content: readonly ({
875
+ readonly type: "compaction";
876
+ readonly content: string | null;
877
+ } | {
774
878
  readonly type: "text";
775
879
  readonly text: string;
776
880
  readonly cache_control?: {
777
881
  readonly type: "ephemeral";
778
- readonly ttl?: "1h" | "5m" | undefined;
779
- } | undefined;
780
- } | {
781
- readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
782
- readonly tool_use_id: string;
783
- readonly content: unknown;
784
- readonly cache_control?: {
785
- readonly type: "ephemeral";
786
- readonly ttl?: "1h" | "5m" | undefined;
882
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
787
883
  } | undefined;
788
- } | {
789
- readonly type: "compaction";
790
- readonly content: string | null;
791
884
  } | {
792
885
  readonly type: "thinking";
793
886
  readonly thinking: string;
794
887
  readonly signature: string;
795
888
  readonly cache_control?: {
796
889
  readonly type: "ephemeral";
797
- readonly ttl?: "1h" | "5m" | undefined;
890
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
798
891
  } | undefined;
799
892
  } | {
800
893
  readonly type: "redacted_thinking";
801
894
  readonly data: string;
802
895
  readonly cache_control?: {
803
896
  readonly type: "ephemeral";
804
- readonly ttl?: "1h" | "5m" | undefined;
897
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
805
898
  } | undefined;
806
899
  } | {
807
900
  readonly type: "tool_use";
@@ -810,7 +903,7 @@ export declare const routes: (import("../route/client.js").Route<{
810
903
  readonly input: unknown;
811
904
  readonly cache_control?: {
812
905
  readonly type: "ephemeral";
813
- readonly ttl?: "1h" | "5m" | undefined;
906
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
814
907
  } | undefined;
815
908
  } | {
816
909
  readonly type: "server_tool_use";
@@ -819,7 +912,15 @@ export declare const routes: (import("../route/client.js").Route<{
819
912
  readonly input: unknown;
820
913
  readonly cache_control?: {
821
914
  readonly type: "ephemeral";
822
- readonly ttl?: "1h" | "5m" | undefined;
915
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
916
+ } | undefined;
917
+ } | {
918
+ readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
919
+ readonly tool_use_id: string;
920
+ readonly content: unknown;
921
+ readonly cache_control?: {
922
+ readonly type: "ephemeral";
923
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
823
924
  } | undefined;
824
925
  })[];
825
926
  } | {
@@ -829,7 +930,7 @@ export declare const routes: (import("../route/client.js").Route<{
829
930
  readonly text: string;
830
931
  readonly cache_control?: {
831
932
  readonly type: "ephemeral";
832
- readonly ttl?: "1h" | "5m" | undefined;
933
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
833
934
  } | undefined;
834
935
  }[];
835
936
  readonly output_config?: {
@@ -844,7 +945,7 @@ export declare const routes: (import("../route/client.js").Route<{
844
945
  };
845
946
  readonly cache_control?: {
846
947
  readonly type: "ephemeral";
847
- readonly ttl?: "1h" | "5m" | undefined;
948
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
848
949
  } | undefined;
849
950
  }[] | undefined;
850
951
  readonly tool_choice?: {
@@ -862,6 +963,8 @@ export declare const routes: (import("../route/client.js").Route<{
862
963
  readonly top_k?: number | undefined;
863
964
  readonly stop_sequences?: readonly string[] | undefined;
864
965
  readonly thinking?: {
966
+ readonly type: "between_tools" | "disabled";
967
+ } | {
865
968
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
866
969
  readonly block_binding?: {
867
970
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -874,8 +977,6 @@ export declare const routes: (import("../route/client.js").Route<{
874
977
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
875
978
  } | undefined;
876
979
  readonly type: "adaptive";
877
- } | {
878
- readonly type: "between_tools" | "disabled";
879
980
  } | undefined;
880
981
  readonly output_config?: {
881
982
  readonly effort?: string | undefined;
@@ -888,7 +989,7 @@ export declare const routes: (import("../route/client.js").Route<{
888
989
  } | undefined;
889
990
  readonly cache_control?: {
890
991
  readonly type: "ephemeral";
891
- readonly ttl?: "1h" | "5m" | undefined;
992
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
892
993
  } | undefined;
893
994
  readonly container?: string | {
894
995
  readonly id?: string | null | undefined;
@@ -901,49 +1002,60 @@ export declare const routes: (import("../route/client.js").Route<{
901
1002
  readonly user_id?: string | null | undefined;
902
1003
  } | undefined;
903
1004
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
1005
+ readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
904
1006
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
905
1007
  readonly model: string;
906
1008
  readonly messages: readonly ({
907
1009
  readonly role: "system";
908
1010
  readonly content: string | readonly ({
909
- readonly type: "text";
910
- readonly text: string;
911
- readonly cache_control?: {
912
- readonly type: "ephemeral";
913
- readonly ttl?: string | undefined;
914
- } | undefined;
915
- } | {
916
1011
  readonly type: "image_url";
917
1012
  readonly image_url: {
918
1013
  readonly url: string;
919
1014
  };
1015
+ } | {
1016
+ readonly type: "video_url";
1017
+ readonly video_url: {
1018
+ readonly url: string;
1019
+ };
920
1020
  } | {
921
1021
  readonly type: "file";
922
1022
  readonly file: {
923
1023
  readonly filename: string;
924
1024
  readonly file_data: string;
925
1025
  };
926
- })[];
927
- } | {
928
- readonly role: "user";
929
- readonly content: string | readonly ({
1026
+ } | {
930
1027
  readonly type: "text";
931
1028
  readonly text: string;
932
1029
  readonly cache_control?: {
933
1030
  readonly type: "ephemeral";
934
1031
  readonly ttl?: string | undefined;
935
1032
  } | undefined;
936
- } | {
1033
+ })[];
1034
+ } | {
1035
+ readonly role: "user";
1036
+ readonly content: string | readonly ({
937
1037
  readonly type: "image_url";
938
1038
  readonly image_url: {
939
1039
  readonly url: string;
940
1040
  };
1041
+ } | {
1042
+ readonly type: "video_url";
1043
+ readonly video_url: {
1044
+ readonly url: string;
1045
+ };
941
1046
  } | {
942
1047
  readonly type: "file";
943
1048
  readonly file: {
944
1049
  readonly filename: string;
945
1050
  readonly file_data: string;
946
1051
  };
1052
+ } | {
1053
+ readonly type: "text";
1054
+ readonly text: string;
1055
+ readonly cache_control?: {
1056
+ readonly type: "ephemeral";
1057
+ readonly ttl?: string | undefined;
1058
+ } | undefined;
947
1059
  })[];
948
1060
  } | {
949
1061
  readonly role: "tool";
@@ -1012,7 +1124,18 @@ export declare const routes: (import("../route/client.js").Route<{
1012
1124
  } | undefined;
1013
1125
  readonly store?: boolean | undefined;
1014
1126
  readonly prompt_cache_key?: string | undefined;
1127
+ readonly prompt_cache_retention?: string | undefined;
1128
+ readonly prompt_cache_options?: {
1129
+ readonly ttl?: string | undefined;
1130
+ } | undefined;
1015
1131
  readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
1132
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1133
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1134
+ readonly parallel_tool_calls?: boolean | undefined;
1135
+ readonly metadata?: {
1136
+ readonly [x: string]: string;
1137
+ } | undefined;
1138
+ readonly safety_identifier?: string | undefined;
1016
1139
  readonly tool_stream?: boolean | undefined;
1017
1140
  readonly max_completion_tokens?: number | undefined;
1018
1141
  readonly max_tokens?: number | undefined;
@@ -1025,55 +1148,10 @@ export declare const routes: (import("../route/client.js").Route<{
1025
1148
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
1026
1149
  readonly model: string;
1027
1150
  readonly input: readonly ({
1028
- readonly [x: string]: unknown;
1029
- readonly type: "web_search_call";
1030
- readonly id: string;
1031
- readonly status?: string | undefined;
1032
- readonly action?: {
1033
- readonly [x: string]: unknown;
1034
- } | null | undefined;
1035
- } | {
1036
- readonly [x: string]: unknown;
1037
- readonly type: "file_search_call";
1038
- readonly id: string;
1039
- readonly status?: string | undefined;
1040
- readonly queries?: readonly string[] | undefined;
1041
- readonly results?: readonly {
1042
- readonly [x: string]: unknown;
1043
- }[] | null | undefined;
1044
- } | {
1045
- readonly [x: string]: unknown;
1046
- readonly type: "code_interpreter_call";
1047
- readonly id: string;
1048
- readonly status?: string | undefined;
1049
- readonly code?: string | null | undefined;
1050
- readonly container_id?: string | null | undefined;
1051
- readonly outputs?: readonly {
1052
- readonly [x: string]: unknown;
1053
- }[] | null | undefined;
1054
- } | {
1055
- readonly [x: string]: unknown;
1056
- readonly type: "mcp_call";
1057
- readonly id: string;
1058
- readonly status?: string | undefined;
1059
- readonly server_label?: string | undefined;
1060
- readonly name?: string | undefined;
1061
- readonly arguments?: string | undefined;
1062
- readonly output?: string | null | undefined;
1063
- readonly error?: unknown;
1064
- } | {
1065
1151
  readonly type: "configuration_update";
1066
1152
  readonly reasoning: {
1067
1153
  readonly effort: import("../schema/options.js").ReasoningEffort;
1068
1154
  };
1069
- } | {
1070
- readonly [x: string]: unknown;
1071
- readonly type: string;
1072
- readonly id: string;
1073
- } | {
1074
- readonly type: "compaction";
1075
- readonly id?: string | null | undefined;
1076
- readonly encrypted_content: string;
1077
1155
  } | {
1078
1156
  readonly type: "message";
1079
1157
  readonly role: "system";
@@ -1082,10 +1160,48 @@ export declare const routes: (import("../route/client.js").Route<{
1082
1160
  readonly type: "message";
1083
1161
  readonly role: "developer";
1084
1162
  readonly content: string;
1163
+ } | {
1164
+ readonly type: "function_call_output";
1165
+ readonly call_id: string;
1166
+ readonly output: string | readonly ({
1167
+ readonly type: "input_text";
1168
+ readonly text: string;
1169
+ } | {
1170
+ readonly type: "input_video";
1171
+ readonly video_url: string;
1172
+ } | {
1173
+ readonly type: "input_image";
1174
+ readonly image_url: string;
1175
+ readonly detail?: string | undefined;
1176
+ } | {
1177
+ readonly type: "input_file";
1178
+ readonly filename: string;
1179
+ readonly detail?: string | undefined;
1180
+ readonly file_data?: string | undefined;
1181
+ readonly file_url?: string | undefined;
1182
+ })[];
1183
+ } | {
1184
+ readonly type: "reasoning";
1185
+ readonly id?: string | undefined;
1186
+ readonly summary: readonly {
1187
+ readonly type: "summary_text";
1188
+ readonly text: string;
1189
+ }[];
1190
+ readonly encrypted_content?: string | null | undefined;
1191
+ } | {
1192
+ readonly type: "compaction";
1193
+ readonly id?: string | null | undefined;
1194
+ readonly encrypted_content: string;
1085
1195
  } | {
1086
1196
  readonly type: "message";
1087
1197
  readonly role: "user";
1088
1198
  readonly content: readonly ({
1199
+ readonly type: "input_text";
1200
+ readonly text: string;
1201
+ } | {
1202
+ readonly type: "input_video";
1203
+ readonly video_url: string;
1204
+ } | {
1089
1205
  readonly type: "input_image";
1090
1206
  readonly image_url: string;
1091
1207
  readonly detail?: string | undefined;
@@ -1095,9 +1211,6 @@ export declare const routes: (import("../route/client.js").Route<{
1095
1211
  readonly detail?: string | undefined;
1096
1212
  readonly file_data?: string | undefined;
1097
1213
  readonly file_url?: string | undefined;
1098
- } | {
1099
- readonly type: "input_text";
1100
- readonly text: string;
1101
1214
  })[];
1102
1215
  readonly id?: string | undefined;
1103
1216
  readonly status?: string | undefined;
@@ -1111,14 +1224,6 @@ export declare const routes: (import("../route/client.js").Route<{
1111
1224
  }[];
1112
1225
  readonly phase?: "commentary" | "final_answer" | null | undefined;
1113
1226
  readonly status?: string | undefined;
1114
- } | {
1115
- readonly type: "reasoning";
1116
- readonly id?: string | undefined;
1117
- readonly summary: readonly {
1118
- readonly type: "summary_text";
1119
- readonly text: string;
1120
- }[];
1121
- readonly encrypted_content?: string | null | undefined;
1122
1227
  } | {
1123
1228
  readonly type: "function_call";
1124
1229
  readonly id?: string | undefined;
@@ -1127,25 +1232,46 @@ export declare const routes: (import("../route/client.js").Route<{
1127
1232
  readonly namespace?: string | undefined;
1128
1233
  readonly arguments: string;
1129
1234
  } | {
1130
- readonly type: "function_call_output";
1131
- readonly call_id: string;
1132
- readonly output: string | readonly ({
1133
- readonly type: "input_image";
1134
- readonly image_url: string;
1135
- readonly detail?: string | undefined;
1136
- } | {
1137
- readonly type: "input_file";
1138
- readonly filename: string;
1139
- readonly detail?: string | undefined;
1140
- readonly file_data?: string | undefined;
1141
- readonly file_url?: string | undefined;
1142
- } | {
1143
- readonly type: "input_text";
1144
- readonly text: string;
1145
- } | {
1146
- readonly type: "input_video";
1147
- readonly video_url: string;
1148
- })[];
1235
+ readonly [x: string]: unknown;
1236
+ readonly type: "web_search_call";
1237
+ readonly id: string;
1238
+ readonly status?: string | undefined;
1239
+ readonly action?: {
1240
+ readonly [x: string]: unknown;
1241
+ } | null | undefined;
1242
+ } | {
1243
+ readonly [x: string]: unknown;
1244
+ readonly type: "file_search_call";
1245
+ readonly id: string;
1246
+ readonly status?: string | undefined;
1247
+ readonly queries?: readonly string[] | undefined;
1248
+ readonly results?: readonly {
1249
+ readonly [x: string]: unknown;
1250
+ }[] | null | undefined;
1251
+ } | {
1252
+ readonly [x: string]: unknown;
1253
+ readonly type: "code_interpreter_call";
1254
+ readonly id: string;
1255
+ readonly status?: string | undefined;
1256
+ readonly code?: string | null | undefined;
1257
+ readonly container_id?: string | null | undefined;
1258
+ readonly outputs?: readonly {
1259
+ readonly [x: string]: unknown;
1260
+ }[] | null | undefined;
1261
+ } | {
1262
+ readonly [x: string]: unknown;
1263
+ readonly type: "mcp_call";
1264
+ readonly id: string;
1265
+ readonly status?: string | undefined;
1266
+ readonly server_label?: string | undefined;
1267
+ readonly name?: string | undefined;
1268
+ readonly arguments?: string | undefined;
1269
+ readonly output?: string | null | undefined;
1270
+ readonly error?: unknown;
1271
+ } | {
1272
+ readonly [x: string]: unknown;
1273
+ readonly type: string;
1274
+ readonly id: string;
1149
1275
  })[];
1150
1276
  readonly instructions?: string | undefined;
1151
1277
  readonly store?: boolean | undefined;
@@ -1161,10 +1287,6 @@ export declare const routes: (import("../route/client.js").Route<{
1161
1287
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1162
1288
  readonly prompt_cache_key?: string | undefined;
1163
1289
  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
1290
  readonly text?: {
1169
1291
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1170
1292
  } | undefined;
@@ -1175,7 +1297,24 @@ export declare const routes: (import("../route/client.js").Route<{
1175
1297
  readonly top_p?: number | undefined;
1176
1298
  readonly presence_penalty?: number | undefined;
1177
1299
  readonly frequency_penalty?: number | undefined;
1300
+ readonly prompt_cache_retention?: string | undefined;
1301
+ readonly prompt_cache_options?: {
1302
+ readonly ttl?: string | undefined;
1303
+ } | undefined;
1178
1304
  readonly tools?: readonly ({
1305
+ readonly type: "namespace";
1306
+ readonly name: string;
1307
+ readonly description: string;
1308
+ readonly tools: readonly {
1309
+ readonly type: "function";
1310
+ readonly name: string;
1311
+ readonly description: string;
1312
+ readonly parameters: {
1313
+ readonly [x: string]: unknown;
1314
+ };
1315
+ readonly strict?: boolean | undefined;
1316
+ }[];
1317
+ } | {
1179
1318
  readonly type: "function";
1180
1319
  readonly name: string;
1181
1320
  readonly description: string;
@@ -1193,19 +1332,6 @@ export declare const routes: (import("../route/client.js").Route<{
1193
1332
  readonly partial_images?: number | undefined;
1194
1333
  readonly quality?: "auto" | "high" | "low" | "medium" | undefined;
1195
1334
  readonly size?: string | undefined;
1196
- } | {
1197
- readonly type: "namespace";
1198
- readonly name: string;
1199
- readonly description: string;
1200
- readonly tools: readonly {
1201
- readonly type: "function";
1202
- readonly name: string;
1203
- readonly description: string;
1204
- readonly parameters: {
1205
- readonly [x: string]: unknown;
1206
- };
1207
- readonly strict?: boolean | undefined;
1208
- }[];
1209
1335
  })[] | undefined;
1210
1336
  readonly tool_choice?: "auto" | "none" | "required" | {
1211
1337
  readonly type: "function";
@@ -1220,6 +1346,12 @@ export declare const routes: (import("../route/client.js").Route<{
1220
1346
  } | {
1221
1347
  readonly type: "image_generation";
1222
1348
  } | undefined;
1349
+ readonly reasoning?: {
1350
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
1351
+ readonly summary?: "auto" | "concise" | "detailed" | undefined;
1352
+ readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
1353
+ readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
1354
+ } | undefined;
1223
1355
  readonly context_management?: readonly {
1224
1356
  readonly type: "compaction";
1225
1357
  readonly compact_threshold?: number | undefined;
@@ -1231,7 +1363,11 @@ export declare const routes: (import("../route/client.js").Route<{
1231
1363
  }>)[];
1232
1364
  export declare const configure: (input: LanguageModelOptions) => {
1233
1365
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
1234
- model: (input: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
1366
+ model: (value: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
1367
+ endpoint: import("../route/client.js").CompactOperation;
1368
+ trigger: import("../route/client.js").TriggerCompactOperation;
1369
+ }>;
1370
+ decision: (value: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
1235
1371
  configure: typeof configure;
1236
1372
  };
1237
1373
  export declare const provider: {
@@ -1239,4 +1375,5 @@ export declare const provider: {
1239
1375
  configure: typeof configure;
1240
1376
  };
1241
1377
  export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
1378
+ export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
1242
1379
  export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";