@opencode/ai 0.0.0-dev-21920 → 0.0.0-dev-21922

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 (56) hide show
  1. package/README.md +22 -2
  2. package/dist/cache-policy.d.ts +4 -0
  3. package/dist/cache-policy.js +20 -6
  4. package/dist/protocols/alibaba-chat.d.ts +4 -0
  5. package/dist/protocols/alibaba-messages.d.ts +19 -19
  6. package/dist/protocols/anthropic-messages.d.ts +59 -59
  7. package/dist/protocols/anthropic-messages.js +3 -5
  8. package/dist/protocols/bedrock-converse.d.ts +12 -12
  9. package/dist/protocols/meta-messages.d.ts +19 -19
  10. package/dist/protocols/meta-messages.js +2 -1
  11. package/dist/protocols/openai-chat.d.ts +585 -1
  12. package/dist/protocols/openai-chat.js +7 -2
  13. package/dist/protocols/openai-compatible-chat.d.ts +4 -0
  14. package/dist/protocols/openai-responses.d.ts +24 -0
  15. package/dist/protocols/openai-responses.js +5 -0
  16. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  17. package/dist/protocols/utils/bedrock-cache.js +7 -6
  18. package/dist/protocols/utils/cache.d.ts +14 -3
  19. package/dist/protocols/utils/cache.js +11 -4
  20. package/dist/protocols/venice-chat.d.ts +3 -0
  21. package/dist/protocols/venice-chat.js +1 -1
  22. package/dist/protocols/zai-chat.d.ts +4 -0
  23. package/dist/protocols/zai-messages.d.ts +19 -19
  24. package/dist/providers/alibaba.d.ts +23 -19
  25. package/dist/providers/amazon-bedrock-mantle.d.ts +23 -19
  26. package/dist/providers/amazon-bedrock.d.ts +4 -4
  27. package/dist/providers/anthropic-compatible.d.ts +19 -19
  28. package/dist/providers/anthropic.d.ts +19 -19
  29. package/dist/providers/azure.d.ts +12 -0
  30. package/dist/providers/baseten.d.ts +8 -0
  31. package/dist/providers/cerebras.d.ts +8 -0
  32. package/dist/providers/cloudflare-ai-gateway.d.ts +54 -38
  33. package/dist/providers/cloudflare-workers-ai.d.ts +8 -0
  34. package/dist/providers/cohere.d.ts +8 -0
  35. package/dist/providers/deepinfra.d.ts +8 -0
  36. package/dist/providers/deepseek.d.ts +8 -0
  37. package/dist/providers/digitalocean.d.ts +12 -0
  38. package/dist/providers/fireworks.d.ts +8 -0
  39. package/dist/providers/google-vertex-chat.d.ts +4 -0
  40. package/dist/providers/google-vertex-messages.d.ts +19 -19
  41. package/dist/providers/groq.d.ts +8 -0
  42. package/dist/providers/meta.d.ts +23 -19
  43. package/dist/providers/minimax.d.ts +23 -19
  44. package/dist/providers/moonshot.d.ts +23 -19
  45. package/dist/providers/openai-compatible.d.ts +4 -0
  46. package/dist/providers/openai.d.ts +8 -0
  47. package/dist/providers/openrouter.d.ts +16 -0
  48. package/dist/providers/togetherai.d.ts +8 -0
  49. package/dist/providers/venice.d.ts +3 -0
  50. package/dist/providers/xai.d.ts +4 -0
  51. package/dist/providers/zai-coding-plan.d.ts +23 -19
  52. package/dist/providers/zai.d.ts +4 -0
  53. package/dist/schema/messages.d.ts +2 -2
  54. package/dist/schema/options.d.ts +5 -3
  55. package/dist/schema/options.js +8 -3
  56. package/package.json +3 -3
@@ -154,6 +154,10 @@ declare const OpenAIResponsesBody: Schema.Struct<{
154
154
  readonly top_p: Schema.optional<Schema.Number>;
155
155
  readonly presence_penalty: Schema.optional<Schema.Number>;
156
156
  readonly frequency_penalty: Schema.optional<Schema.Number>;
157
+ readonly prompt_cache_retention: Schema.optional<Schema.String>;
158
+ readonly prompt_cache_options: Schema.optional<Schema.Struct<{
159
+ readonly ttl: Schema.optional<Schema.String>;
160
+ }>>;
157
161
  readonly tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
158
162
  readonly type: Schema.tag<"function">;
159
163
  readonly name: Schema.String;
@@ -364,6 +368,10 @@ export declare const protocol: Protocol<{
364
368
  readonly top_p?: number | undefined;
365
369
  readonly presence_penalty?: number | undefined;
366
370
  readonly frequency_penalty?: number | undefined;
371
+ readonly prompt_cache_retention?: string | undefined;
372
+ readonly prompt_cache_options?: {
373
+ readonly ttl?: string | undefined;
374
+ } | undefined;
367
375
  readonly tools?: readonly ({
368
376
  readonly type: "namespace";
369
377
  readonly name: string;
@@ -631,6 +639,10 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
631
639
  readonly top_p?: number | undefined;
632
640
  readonly presence_penalty?: number | undefined;
633
641
  readonly frequency_penalty?: number | undefined;
642
+ readonly prompt_cache_retention?: string | undefined;
643
+ readonly prompt_cache_options?: {
644
+ readonly ttl?: string | undefined;
645
+ } | undefined;
634
646
  readonly tools?: readonly ({
635
647
  readonly type: "namespace";
636
648
  readonly name: string;
@@ -840,6 +852,10 @@ export declare const channelTransport: (options: import("./open-responses-channe
840
852
  readonly top_p?: number | undefined;
841
853
  readonly presence_penalty?: number | undefined;
842
854
  readonly frequency_penalty?: number | undefined;
855
+ readonly prompt_cache_retention?: string | undefined;
856
+ readonly prompt_cache_options?: {
857
+ readonly ttl?: string | undefined;
858
+ } | undefined;
843
859
  readonly tools?: readonly ({
844
860
  readonly type: "namespace";
845
861
  readonly name: string;
@@ -1049,6 +1065,10 @@ export declare const transport: import("../route/transport/index.js").Transport<
1049
1065
  readonly top_p?: number | undefined;
1050
1066
  readonly presence_penalty?: number | undefined;
1051
1067
  readonly frequency_penalty?: number | undefined;
1068
+ readonly prompt_cache_retention?: string | undefined;
1069
+ readonly prompt_cache_options?: {
1070
+ readonly ttl?: string | undefined;
1071
+ } | undefined;
1052
1072
  readonly tools?: readonly ({
1053
1073
  readonly type: "namespace";
1054
1074
  readonly name: string;
@@ -1258,6 +1278,10 @@ export declare const route: Route<{
1258
1278
  readonly top_p?: number | undefined;
1259
1279
  readonly presence_penalty?: number | undefined;
1260
1280
  readonly frequency_penalty?: number | undefined;
1281
+ readonly prompt_cache_retention?: string | undefined;
1282
+ readonly prompt_cache_options?: {
1283
+ readonly ttl?: string | undefined;
1284
+ } | undefined;
1261
1285
  readonly tools?: readonly ({
1262
1286
  readonly type: "namespace";
1263
1287
  readonly name: string;
@@ -7,6 +7,7 @@ import { Endpoint } from "../route/endpoint.js";
7
7
  import { Protocol } from "../route/protocol.js";
8
8
  import { HttpTransport } from "../route/transport/index.js";
9
9
  import { LLMRequest } from "../schema/index.js";
10
+ import { requestTTL } from "../cache-policy.js";
10
11
  import { resolveEffortUpdates } from "../effort-updates.js";
11
12
  import { OpenResponses } from "./open-responses.js";
12
13
  import { OpenResponsesOptions } from "./utils/open-responses-options.js";
@@ -15,6 +16,7 @@ import { ResponsesHostedTools } from "./utils/responses-hosted-tools.js";
15
16
  import { OpenResponsesChannel } from "./open-responses-channel.js";
16
17
  import { ResponsesCompaction } from "./utils/responses-compaction.js";
17
18
  import { ResponsesCheckpoint } from "./utils/responses-checkpoint.js";
19
+ import * as Cache from "./utils/cache.js";
18
20
  const ADAPTER = "openai-responses";
19
21
  const NAME = "OpenAI Responses";
20
22
  const WEBSOCKET_PROTOCOL_HEADER = "responses_websockets=2026-02-06";
@@ -90,6 +92,8 @@ const OpenAIResponsesToolChoice = Schema.Union([
90
92
  ]);
91
93
  const OpenAIResponsesCoreFields = {
92
94
  ...OpenResponses.coreFields,
95
+ prompt_cache_retention: Schema.optional(Schema.String),
96
+ prompt_cache_options: Schema.optional(Schema.Struct({ ttl: Schema.optional(Schema.String) })),
93
97
  tools: optionalArray(OpenAIResponsesTools),
94
98
  tool_choice: Schema.optional(OpenAIResponsesToolChoice),
95
99
  reasoning: Schema.optional(Schema.Struct({
@@ -182,6 +186,7 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request)
182
186
  return {
183
187
  ...(yield* OpenResponses.lowerConversation(updates.request, adapter)),
184
188
  ...generation,
189
+ ...Cache.openAIRequestTTL(requestTTL(request)),
185
190
  ...(generation.reasoning || reasoning.reasoningMode || reasoning.reasoningContext
186
191
  ? {
187
192
  reasoning: {
@@ -1,9 +1,9 @@
1
1
  import { Schema } from "effect";
2
- import type { CacheHint, LLMRequest } from "../../schema/index.js";
2
+ import { type CacheHint, type LLMRequest } from "../../schema/index.js";
3
3
  export declare const CachePointBlock: Schema.Struct<{
4
4
  readonly cachePoint: Schema.Struct<{
5
5
  readonly type: Schema.tag<"default">;
6
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
6
+ readonly ttl: Schema.optional<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>;
7
7
  }>;
8
8
  }>;
9
9
  export type CachePointBlock = Schema.Schema.Type<typeof CachePointBlock>;
@@ -1,12 +1,13 @@
1
1
  import { Schema } from "effect";
2
- import { newBreakpoints, ttlBucket } from "./cache.js";
2
+ import { CacheTTL } from "../../schema/index.js";
3
+ import { newBreakpoints } from "./cache.js";
3
4
  // Bedrock cache markers are positional: emit a `cachePoint` block immediately
4
5
  // after the content the caller wants treated as a cacheable prefix. Bedrock
5
- // accepts optional `ttl: "5m" | "1h"` on cachePoint.
6
+ // accepts an optional `ttl` such as "5m" or "1h" on cachePoint.
6
7
  export const CachePointBlock = Schema.Struct({
7
8
  cachePoint: Schema.Struct({
8
9
  type: Schema.tag("default"),
9
- ttl: Schema.optional(Schema.Literals(["5m", "1h"])),
10
+ ttl: Schema.optional(CacheTTL),
10
11
  }),
11
12
  });
12
13
  const LEGACY_CLAUDE = ["anthropic.claude-instant", "anthropic.claude-v1", "anthropic.claude-v2", "anthropic.claude-3-"];
@@ -34,8 +35,6 @@ export const breakpoints = (model) => {
34
35
  ttl1h: !short,
35
36
  };
36
37
  };
37
- const DEFAULT_5M = { cachePoint: { type: "default" } };
38
- const DEFAULT_1H = { cachePoint: { type: "default", ttl: "1h" } };
39
38
  export const block = (breakpoints, cache) => {
40
39
  if (!breakpoints.supported)
41
40
  return undefined;
@@ -46,6 +45,8 @@ export const block = (breakpoints, cache) => {
46
45
  return undefined;
47
46
  }
48
47
  breakpoints.remaining -= 1;
49
- return breakpoints.ttl1h && ttlBucket(cache.ttlSeconds) === "1h" ? DEFAULT_1H : DEFAULT_5M;
48
+ // Older Claude releases cache for five minutes only, so a one-hour request falls back to the default.
49
+ const ttl = cache.ttl === "1h" && !breakpoints.ttl1h ? undefined : cache.ttl;
50
+ return { cachePoint: { type: "default", ...(ttl === undefined ? {} : { ttl }) } };
50
51
  };
51
52
  export * as BedrockCache from "./bedrock-cache.js";
@@ -1,11 +1,22 @@
1
- import type { CacheHint } from "../../schema/index.js";
1
+ import type { CacheHint, CacheTTL } from "../../schema/index.js";
2
2
  export interface Breakpoints {
3
3
  remaining: number;
4
4
  dropped: number;
5
5
  }
6
6
  export declare const newBreakpoints: (cap: number) => Breakpoints;
7
- export declare const ttlBucket: (ttlSeconds: number | undefined) => "1h" | undefined;
8
7
  export declare const cacheControl: () => (cache: CacheHint | undefined) => {
9
8
  type: "ephemeral";
10
- ttl: "1h" | undefined;
9
+ ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
11
10
  } | undefined;
11
+ export declare const openAIRequestTTL: (ttl: CacheTTL | undefined) => {
12
+ prompt_cache_retention?: undefined;
13
+ prompt_cache_options?: undefined;
14
+ } | {
15
+ prompt_cache_retention: string;
16
+ prompt_cache_options?: undefined;
17
+ } | {
18
+ prompt_cache_retention?: undefined;
19
+ prompt_cache_options: {
20
+ ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s`;
21
+ };
22
+ };
@@ -1,13 +1,20 @@
1
1
  export const newBreakpoints = (cap) => ({ remaining: cap, dropped: 0 });
2
- // Requests of at least one hour use the explicit `"1h"` bucket; shorter
3
- // requests omit the wire TTL and use the provider default.
4
- export const ttlBucket = (ttlSeconds) => ttlSeconds !== undefined && ttlSeconds >= 3600 ? "1h" : undefined;
5
2
  export const cacheControl = () => {
6
3
  const breakpoints = newBreakpoints(4);
7
4
  return (cache) => {
8
5
  if (cache === undefined || breakpoints.remaining === 0)
9
6
  return undefined;
10
7
  breakpoints.remaining -= 1;
11
- return { type: "ephemeral", ttl: ttlBucket(cache.ttlSeconds) };
8
+ return { type: "ephemeral", ttl: cache.ttl };
12
9
  };
13
10
  };
11
+ // OpenAI's request-level lifetime. `prompt_cache_retention` takes only "24h" (or "in_memory") and is the only
12
+ // control before GPT-5.6; every other lifetime goes to `prompt_cache_options.ttl`, which GPT-5.6+, Kimi and
13
+ // DeepInfra read.
14
+ export const openAIRequestTTL = (ttl) => {
15
+ if (ttl === undefined)
16
+ return {};
17
+ if (ttl === "24h")
18
+ return { prompt_cache_retention: ttl };
19
+ return { prompt_cache_options: { ttl } };
20
+ };
@@ -79,6 +79,9 @@ export declare const protocol: Protocol<{
79
79
  } | undefined;
80
80
  readonly store?: boolean | undefined;
81
81
  readonly prompt_cache_key?: string | undefined;
82
+ readonly prompt_cache_options?: {
83
+ readonly ttl?: string | undefined;
84
+ } | undefined;
82
85
  readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
83
86
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
84
87
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
@@ -150,7 +150,7 @@ const fromRequest = Effect.fn("VeniceChat.fromRequest")(function* (request) {
150
150
  })
151
151
  .filter(([, value]) => value !== undefined)
152
152
  .map(([key, value]) => [key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), value])),
153
- prompt_cache_retention: options.promptCacheRetention,
153
+ prompt_cache_retention: options.promptCacheRetention ?? body.prompt_cache_retention,
154
154
  parallel_tool_calls: options.parallelToolCalls,
155
155
  min_p: options.minP,
156
156
  top_k: request.generation?.topK,
@@ -146,6 +146,10 @@ export declare const protocol: Protocol<{
146
146
  } | undefined;
147
147
  readonly store?: boolean | undefined;
148
148
  readonly prompt_cache_key?: string | undefined;
149
+ readonly prompt_cache_retention?: string | undefined;
150
+ readonly prompt_cache_options?: {
151
+ readonly ttl?: string | undefined;
152
+ } | undefined;
149
153
  readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
150
154
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
151
155
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
@@ -26,7 +26,7 @@ export declare const protocol: Protocol<{
26
26
  readonly text: string;
27
27
  readonly cache_control?: {
28
28
  readonly type: "ephemeral";
29
- readonly ttl?: "1h" | "5m" | undefined;
29
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
30
30
  } | undefined;
31
31
  }[] | undefined;
32
32
  readonly messages: readonly ({
@@ -36,7 +36,7 @@ export declare const protocol: Protocol<{
36
36
  readonly text: string;
37
37
  readonly cache_control?: {
38
38
  readonly type: "ephemeral";
39
- readonly ttl?: "1h" | "5m" | undefined;
39
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
40
40
  } | undefined;
41
41
  } | {
42
42
  readonly type: "image";
@@ -53,7 +53,7 @@ export declare const protocol: Protocol<{
53
53
  };
54
54
  readonly cache_control?: {
55
55
  readonly type: "ephemeral";
56
- readonly ttl?: "1h" | "5m" | undefined;
56
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
57
57
  } | undefined;
58
58
  readonly transformations?: {
59
59
  readonly oversized_image?: "downsize" | "error" | undefined;
@@ -73,7 +73,7 @@ export declare const protocol: Protocol<{
73
73
  };
74
74
  readonly cache_control?: {
75
75
  readonly type: "ephemeral";
76
- readonly ttl?: "1h" | "5m" | undefined;
76
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
77
77
  } | undefined;
78
78
  } | {
79
79
  readonly type: "document";
@@ -94,7 +94,7 @@ export declare const protocol: Protocol<{
94
94
  };
95
95
  readonly cache_control?: {
96
96
  readonly type: "ephemeral";
97
- readonly ttl?: "1h" | "5m" | undefined;
97
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
98
98
  } | undefined;
99
99
  readonly title?: string | undefined;
100
100
  readonly context?: string | undefined;
@@ -109,7 +109,7 @@ export declare const protocol: Protocol<{
109
109
  readonly text: string;
110
110
  readonly cache_control?: {
111
111
  readonly type: "ephemeral";
112
- readonly ttl?: "1h" | "5m" | undefined;
112
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
113
113
  } | undefined;
114
114
  } | {
115
115
  readonly type: "image";
@@ -126,7 +126,7 @@ export declare const protocol: Protocol<{
126
126
  };
127
127
  readonly cache_control?: {
128
128
  readonly type: "ephemeral";
129
- readonly ttl?: "1h" | "5m" | undefined;
129
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
130
130
  } | undefined;
131
131
  readonly transformations?: {
132
132
  readonly oversized_image?: "downsize" | "error" | undefined;
@@ -146,7 +146,7 @@ export declare const protocol: Protocol<{
146
146
  };
147
147
  readonly cache_control?: {
148
148
  readonly type: "ephemeral";
149
- readonly ttl?: "1h" | "5m" | undefined;
149
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
150
150
  } | undefined;
151
151
  } | {
152
152
  readonly type: "document";
@@ -167,7 +167,7 @@ export declare const protocol: Protocol<{
167
167
  };
168
168
  readonly cache_control?: {
169
169
  readonly type: "ephemeral";
170
- readonly ttl?: "1h" | "5m" | undefined;
170
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
171
171
  } | undefined;
172
172
  readonly title?: string | undefined;
173
173
  readonly context?: string | undefined;
@@ -178,7 +178,7 @@ export declare const protocol: Protocol<{
178
178
  readonly is_error?: boolean | undefined;
179
179
  readonly cache_control?: {
180
180
  readonly type: "ephemeral";
181
- readonly ttl?: "1h" | "5m" | undefined;
181
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
182
182
  } | undefined;
183
183
  })[];
184
184
  } | {
@@ -191,7 +191,7 @@ export declare const protocol: Protocol<{
191
191
  readonly text: string;
192
192
  readonly cache_control?: {
193
193
  readonly type: "ephemeral";
194
- readonly ttl?: "1h" | "5m" | undefined;
194
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
195
195
  } | undefined;
196
196
  } | {
197
197
  readonly type: "thinking";
@@ -199,14 +199,14 @@ export declare const protocol: Protocol<{
199
199
  readonly signature: string;
200
200
  readonly cache_control?: {
201
201
  readonly type: "ephemeral";
202
- readonly ttl?: "1h" | "5m" | undefined;
202
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
203
203
  } | undefined;
204
204
  } | {
205
205
  readonly type: "redacted_thinking";
206
206
  readonly data: string;
207
207
  readonly cache_control?: {
208
208
  readonly type: "ephemeral";
209
- readonly ttl?: "1h" | "5m" | undefined;
209
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
210
210
  } | undefined;
211
211
  } | {
212
212
  readonly type: "tool_use";
@@ -215,7 +215,7 @@ export declare const protocol: Protocol<{
215
215
  readonly input: unknown;
216
216
  readonly cache_control?: {
217
217
  readonly type: "ephemeral";
218
- readonly ttl?: "1h" | "5m" | undefined;
218
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
219
219
  } | undefined;
220
220
  } | {
221
221
  readonly type: "server_tool_use";
@@ -224,7 +224,7 @@ export declare const protocol: Protocol<{
224
224
  readonly input: unknown;
225
225
  readonly cache_control?: {
226
226
  readonly type: "ephemeral";
227
- readonly ttl?: "1h" | "5m" | undefined;
227
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
228
228
  } | undefined;
229
229
  } | {
230
230
  readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
@@ -232,7 +232,7 @@ export declare const protocol: Protocol<{
232
232
  readonly content: unknown;
233
233
  readonly cache_control?: {
234
234
  readonly type: "ephemeral";
235
- readonly ttl?: "1h" | "5m" | undefined;
235
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
236
236
  } | undefined;
237
237
  })[];
238
238
  } | {
@@ -242,7 +242,7 @@ export declare const protocol: Protocol<{
242
242
  readonly text: string;
243
243
  readonly cache_control?: {
244
244
  readonly type: "ephemeral";
245
- readonly ttl?: "1h" | "5m" | undefined;
245
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
246
246
  } | undefined;
247
247
  }[];
248
248
  readonly output_config?: {
@@ -257,7 +257,7 @@ export declare const protocol: Protocol<{
257
257
  };
258
258
  readonly cache_control?: {
259
259
  readonly type: "ephemeral";
260
- readonly ttl?: "1h" | "5m" | undefined;
260
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
261
261
  } | undefined;
262
262
  }[] | undefined;
263
263
  readonly tool_choice?: {
@@ -285,7 +285,7 @@ export declare const protocol: Protocol<{
285
285
  } | undefined;
286
286
  readonly cache_control?: {
287
287
  readonly type: "ephemeral";
288
- readonly ttl?: "1h" | "5m" | undefined;
288
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
289
289
  } | undefined;
290
290
  readonly container?: string | {
291
291
  readonly id?: string | null | undefined;
@@ -145,6 +145,10 @@ export declare const routes: (Route<{
145
145
  } | undefined;
146
146
  readonly store?: boolean | undefined;
147
147
  readonly prompt_cache_key?: string | undefined;
148
+ readonly prompt_cache_retention?: string | undefined;
149
+ readonly prompt_cache_options?: {
150
+ readonly ttl?: string | undefined;
151
+ } | undefined;
148
152
  readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
149
153
  readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
150
154
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
@@ -201,7 +205,7 @@ export declare const routes: (Route<{
201
205
  readonly text: string;
202
206
  readonly cache_control?: {
203
207
  readonly type: "ephemeral";
204
- readonly ttl?: "1h" | "5m" | undefined;
208
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
205
209
  } | undefined;
206
210
  }[] | undefined;
207
211
  readonly messages: readonly ({
@@ -211,7 +215,7 @@ export declare const routes: (Route<{
211
215
  readonly text: string;
212
216
  readonly cache_control?: {
213
217
  readonly type: "ephemeral";
214
- readonly ttl?: "1h" | "5m" | undefined;
218
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
215
219
  } | undefined;
216
220
  } | {
217
221
  readonly type: "image";
@@ -228,7 +232,7 @@ export declare const routes: (Route<{
228
232
  };
229
233
  readonly cache_control?: {
230
234
  readonly type: "ephemeral";
231
- readonly ttl?: "1h" | "5m" | undefined;
235
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
232
236
  } | undefined;
233
237
  readonly transformations?: {
234
238
  readonly oversized_image?: "downsize" | "error" | undefined;
@@ -248,7 +252,7 @@ export declare const routes: (Route<{
248
252
  };
249
253
  readonly cache_control?: {
250
254
  readonly type: "ephemeral";
251
- readonly ttl?: "1h" | "5m" | undefined;
255
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
252
256
  } | undefined;
253
257
  } | {
254
258
  readonly type: "document";
@@ -269,7 +273,7 @@ export declare const routes: (Route<{
269
273
  };
270
274
  readonly cache_control?: {
271
275
  readonly type: "ephemeral";
272
- readonly ttl?: "1h" | "5m" | undefined;
276
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
273
277
  } | undefined;
274
278
  readonly title?: string | undefined;
275
279
  readonly context?: string | undefined;
@@ -284,7 +288,7 @@ export declare const routes: (Route<{
284
288
  readonly text: string;
285
289
  readonly cache_control?: {
286
290
  readonly type: "ephemeral";
287
- readonly ttl?: "1h" | "5m" | undefined;
291
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
288
292
  } | undefined;
289
293
  } | {
290
294
  readonly type: "image";
@@ -301,7 +305,7 @@ export declare const routes: (Route<{
301
305
  };
302
306
  readonly cache_control?: {
303
307
  readonly type: "ephemeral";
304
- readonly ttl?: "1h" | "5m" | undefined;
308
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
305
309
  } | undefined;
306
310
  readonly transformations?: {
307
311
  readonly oversized_image?: "downsize" | "error" | undefined;
@@ -321,7 +325,7 @@ export declare const routes: (Route<{
321
325
  };
322
326
  readonly cache_control?: {
323
327
  readonly type: "ephemeral";
324
- readonly ttl?: "1h" | "5m" | undefined;
328
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
325
329
  } | undefined;
326
330
  } | {
327
331
  readonly type: "document";
@@ -342,7 +346,7 @@ export declare const routes: (Route<{
342
346
  };
343
347
  readonly cache_control?: {
344
348
  readonly type: "ephemeral";
345
- readonly ttl?: "1h" | "5m" | undefined;
349
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
346
350
  } | undefined;
347
351
  readonly title?: string | undefined;
348
352
  readonly context?: string | undefined;
@@ -353,7 +357,7 @@ export declare const routes: (Route<{
353
357
  readonly is_error?: boolean | undefined;
354
358
  readonly cache_control?: {
355
359
  readonly type: "ephemeral";
356
- readonly ttl?: "1h" | "5m" | undefined;
360
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
357
361
  } | undefined;
358
362
  })[];
359
363
  } | {
@@ -366,7 +370,7 @@ export declare const routes: (Route<{
366
370
  readonly text: string;
367
371
  readonly cache_control?: {
368
372
  readonly type: "ephemeral";
369
- readonly ttl?: "1h" | "5m" | undefined;
373
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
370
374
  } | undefined;
371
375
  } | {
372
376
  readonly type: "thinking";
@@ -374,14 +378,14 @@ export declare const routes: (Route<{
374
378
  readonly signature: string;
375
379
  readonly cache_control?: {
376
380
  readonly type: "ephemeral";
377
- readonly ttl?: "1h" | "5m" | undefined;
381
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
378
382
  } | undefined;
379
383
  } | {
380
384
  readonly type: "redacted_thinking";
381
385
  readonly data: string;
382
386
  readonly cache_control?: {
383
387
  readonly type: "ephemeral";
384
- readonly ttl?: "1h" | "5m" | undefined;
388
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
385
389
  } | undefined;
386
390
  } | {
387
391
  readonly type: "tool_use";
@@ -390,7 +394,7 @@ export declare const routes: (Route<{
390
394
  readonly input: unknown;
391
395
  readonly cache_control?: {
392
396
  readonly type: "ephemeral";
393
- readonly ttl?: "1h" | "5m" | undefined;
397
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
394
398
  } | undefined;
395
399
  } | {
396
400
  readonly type: "server_tool_use";
@@ -399,7 +403,7 @@ export declare const routes: (Route<{
399
403
  readonly input: unknown;
400
404
  readonly cache_control?: {
401
405
  readonly type: "ephemeral";
402
- readonly ttl?: "1h" | "5m" | undefined;
406
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
403
407
  } | undefined;
404
408
  } | {
405
409
  readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
@@ -407,7 +411,7 @@ export declare const routes: (Route<{
407
411
  readonly content: unknown;
408
412
  readonly cache_control?: {
409
413
  readonly type: "ephemeral";
410
- readonly ttl?: "1h" | "5m" | undefined;
414
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
411
415
  } | undefined;
412
416
  })[];
413
417
  } | {
@@ -417,7 +421,7 @@ export declare const routes: (Route<{
417
421
  readonly text: string;
418
422
  readonly cache_control?: {
419
423
  readonly type: "ephemeral";
420
- readonly ttl?: "1h" | "5m" | undefined;
424
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
421
425
  } | undefined;
422
426
  }[];
423
427
  readonly output_config?: {
@@ -432,7 +436,7 @@ export declare const routes: (Route<{
432
436
  };
433
437
  readonly cache_control?: {
434
438
  readonly type: "ephemeral";
435
- readonly ttl?: "1h" | "5m" | undefined;
439
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
436
440
  } | undefined;
437
441
  }[] | undefined;
438
442
  readonly tool_choice?: {
@@ -460,7 +464,7 @@ export declare const routes: (Route<{
460
464
  } | undefined;
461
465
  readonly cache_control?: {
462
466
  readonly type: "ephemeral";
463
- readonly ttl?: "1h" | "5m" | undefined;
467
+ readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
464
468
  } | undefined;
465
469
  readonly container?: string | {
466
470
  readonly id?: string | null | undefined;