@ai-sdk/gateway 4.0.136 → 4.0.137

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": "4.0.136",
4
+ "version": "4.0.137",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "sideEffects": false,
@@ -23,6 +23,8 @@ export type GatewayImageModelId =
23
23
  | 'openai/gpt-image-2'
24
24
  | 'openai/gpt-image-2.5-flare'
25
25
  | 'openai/gpt-image-2.5-sunburst'
26
+ | 'openai/gpt-image-2.6-flare'
27
+ | 'openai/gpt-image-2.6-sunburst'
26
28
  | 'prodia/flux-fast-schnell'
27
29
  | 'recraft/recraft-v2'
28
30
  | 'recraft/recraft-v3'
@@ -90,23 +90,21 @@ export type GatewayModelId =
90
90
  | 'google/gemini-3-flash-batch'
91
91
  | 'google/gemini-3-pro-image'
92
92
  | 'google/gemini-3.1-flash-image'
93
- | 'google/gemini-3.1-flash-image-preview'
94
93
  | 'google/gemini-3.1-flash-lite'
95
94
  | 'google/gemini-3.1-flash-lite-batch'
96
95
  | 'google/gemini-3.1-flash-lite-image'
97
96
  | 'google/gemini-3.1-pro-preview'
98
97
  | 'google/gemini-3.1-pro-preview-batch'
99
98
  | 'google/gemini-3.5-flash'
100
- | 'google/gemini-3.5-flash-batch'
101
99
  | 'google/gemini-3.5-flash-lite'
102
100
  | 'google/gemini-3.5-flash-lite-batch'
103
101
  | 'google/gemini-3.6-flash'
104
102
  | 'google/gemini-3.6-flash-batch'
105
103
  | 'google/gemini-3.7-flash'
106
- | 'google/gemini-3.7-flash-batch'
107
104
  | 'google/gemini-3.8-flash'
108
105
  | 'google/gemini-4-argon'
109
106
  | 'google/gemini-nano-banana-2.1'
107
+ | 'google/gemini-omni-1.2-flash'
110
108
  | 'google/gemini-omni-flash-preview'
111
109
  | 'google/gemma-4-26b-a4b-it'
112
110
  | 'google/gemma-4-31b-it'
@@ -310,6 +310,14 @@ export interface GatewayProviderSettings {
310
310
  * API key or Vercel access token that is being sent using the `Authorization`
311
311
  * header. It defaults to the `AI_GATEWAY_API_KEY` environment variable.
312
312
  * A callback is resolved before each request and must return a non-empty key.
313
+ *
314
+ * If neither `apiKey` nor `AI_GATEWAY_API_KEY` is set to a non-empty value,
315
+ * the provider authenticates with the Vercel OIDC token instead, resolved for
316
+ * each request. On Vercel deployments this requires no configuration. For
317
+ * local development, run `vercel env pull` or `vercel dev` to get a token.
318
+ * A non-empty configured API key is always used instead of OIDC, even if the
319
+ * key is invalid. If no OIDC token is available either, requests fail with a
320
+ * `GatewayAuthenticationError` ("No authentication provided").
313
321
  */
314
322
  apiKey?: Resolvable<string>;
315
323
 
@@ -792,6 +800,20 @@ export function createGateway(
792
800
 
793
801
  export const gateway = createGateway();
794
802
 
803
+ /**
804
+ * Resolves the credential for a Gateway request, in this order:
805
+ *
806
+ * 1. The `apiKey` setting (a string, or a callback resolved per request).
807
+ * 2. The `AI_GATEWAY_API_KEY` environment variable.
808
+ * 3. The Vercel OIDC token from `getVercelOidcToken()`. It is available
809
+ * automatically on Vercel deployments, and locally after `vercel env pull`
810
+ * or under `vercel dev`.
811
+ *
812
+ * A non-empty configured API key is never replaced by OIDC, even if the key is
813
+ * invalid. An empty string option or environment variable falls through to
814
+ * OIDC; a callback must return a non-empty key. Callers wrap a failure here in a
815
+ * `GatewayAuthenticationError` ("No authentication provided").
816
+ */
795
817
  export async function getGatewayAuthToken(
796
818
  options: GatewayProviderSettings,
797
819
  ): Promise<{ token: string; authMethod: 'api-key' | 'oidc' }> {
@@ -9,5 +9,4 @@ export type GatewayRealtimeModelId =
9
9
  | 'openai/gpt-realtime-2.1'
10
10
  | 'openai/gpt-realtime-mini'
11
11
  | 'spacexai/grok-voice-3.0'
12
- | 'spacexai/grok-voice-think-fast-2.0'
13
12
  | (string & {});
@@ -17,8 +17,6 @@ export type GatewayVideoModelId =
17
17
  | 'bytedance/seedance-v1.0-pro'
18
18
  | 'bytedance/seedance-v1.0-pro-fast'
19
19
  | 'bytedance/seedance-v1.5-pro'
20
- | 'google/veo-3.0-fast-generate-001'
21
- | 'google/veo-3.0-generate-001'
22
20
  | 'google/veo-3.1-fast-generate-001'
23
21
  | 'google/veo-3.1-generate-001'
24
22
  | 'google/veo-3.1-lite-generate-001'