@ai-sdk/gateway 3.0.139 → 3.0.141

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-sdk/gateway",
3
3
  "private": false,
4
- "version": "3.0.139",
4
+ "version": "3.0.141",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@vercel/oidc": "3.2.0",
34
- "@ai-sdk/provider": "3.0.12",
35
- "@ai-sdk/provider-utils": "4.0.33"
34
+ "@ai-sdk/provider": "3.0.13",
35
+ "@ai-sdk/provider-utils": "4.0.34"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "18.15.11",
@@ -20,6 +20,7 @@ export type GatewayImageModelId =
20
20
  | 'openai/gpt-image-1.5'
21
21
  | 'openai/gpt-image-2'
22
22
  | 'prodia/flux-fast-schnell'
23
+ | 'quiverai/arrow-1.1'
23
24
  | 'recraft/recraft-v2'
24
25
  | 'recraft/recraft-v3'
25
26
  | 'recraft/recraft-v4'
@@ -39,6 +39,7 @@ export type GatewayModelId =
39
39
  | 'anthropic/claude-sonnet-4'
40
40
  | 'anthropic/claude-sonnet-4.5'
41
41
  | 'anthropic/claude-sonnet-4.6'
42
+ | 'anthropic/claude-sonnet-5'
42
43
  | 'arcee-ai/trinity-large-preview'
43
44
  | 'arcee-ai/trinity-large-thinking'
44
45
  | 'arcee-ai/trinity-mini'
@@ -63,6 +64,7 @@ export type GatewayModelId =
63
64
  | 'google/gemini-3.1-flash-image'
64
65
  | 'google/gemini-3.1-flash-image-preview'
65
66
  | 'google/gemini-3.1-flash-lite'
67
+ | 'google/gemini-3.1-flash-lite-image'
66
68
  | 'google/gemini-3.1-flash-lite-preview'
67
69
  | 'google/gemini-3.1-pro-preview'
68
70
  | 'google/gemini-3.5-flash'
@@ -108,6 +108,15 @@ const gatewayProviderOptions = lazySchema(() =>
108
108
  * default.
109
109
  */
110
110
  serviceTier: z.enum(['flex', 'priority']).optional(),
111
+ /**
112
+ * Enables automatic prompt caching across providers. When set to
113
+ * `'auto'`, the gateway applies the appropriate caching strategy for
114
+ * the routed provider: it adds a `cache_control` breakpoint to static
115
+ * content for providers that require explicit markers (such as
116
+ * Anthropic), while providers with implicit caching cache
117
+ * automatically. Leave unset to pass requests through unmodified.
118
+ */
119
+ caching: z.literal('auto').optional(),
111
120
  }),
112
121
  ),
113
122
  );
@@ -48,6 +48,8 @@ export class GatewayVideoModel implements Experimental_VideoModelV3 {
48
48
  seed,
49
49
  generateAudio,
50
50
  image,
51
+ frameImages,
52
+ inputReferences,
51
53
  providerOptions,
52
54
  headers,
53
55
  abortSignal,
@@ -83,6 +85,17 @@ export class GatewayVideoModel implements Experimental_VideoModelV3 {
83
85
  ...(generateAudio !== undefined && { generateAudio }),
84
86
  ...(providerOptions && { providerOptions }),
85
87
  ...(image && { image: maybeEncodeVideoFile(image) }),
88
+ ...(frameImages && {
89
+ frameImages: frameImages.map(frame => ({
90
+ ...frame,
91
+ image: maybeEncodeVideoFile(frame.image),
92
+ })),
93
+ }),
94
+ ...(inputReferences && {
95
+ inputReferences: inputReferences.map(reference =>
96
+ maybeEncodeVideoFile(reference),
97
+ ),
98
+ }),
86
99
  },
87
100
  successfulResponseHandler: async ({
88
101
  response,