@ai-sdk/gateway 2.0.0-beta.38 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,295 +1,133 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
- ## 2.0.0-beta.38
3
+ ## 2.0.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [293a6b7]
8
- - @ai-sdk/provider-utils@4.0.0-beta.21
7
+ - f1a8734: feat (provider/gateway): add models provider option for model routing
9
8
 
10
- ## 2.0.0-beta.37
11
-
12
- ### Patch Changes
13
-
14
- - 2b6a848: feat (provider/gateway): add models provider option for model routing
15
-
16
- ## 2.0.0-beta.36
17
-
18
- ### Patch Changes
19
-
20
- - Updated dependencies [fca786b]
21
- - @ai-sdk/provider-utils@4.0.0-beta.20
22
-
23
- ## 2.0.0-beta.35
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [3794514]
28
- - @ai-sdk/provider-utils@4.0.0-beta.19
29
- - @ai-sdk/provider@3.0.0-beta.8
30
-
31
- ## 2.0.0-beta.34
9
+ ## 2.0.0
32
10
 
33
11
  ### Major Changes
34
12
 
35
- - 2f8b0c8: fix(gateway): bump `@vercel/oidc` to latest
36
-
37
- ## 2.0.0-beta.33
38
-
39
- ### Patch Changes
40
-
41
- - 1890317: feat (provider/gateway): improve auth error messages
13
+ - 76678cd: fix(gateway): bump `@vercel/oidc` to latest
42
14
 
43
- ## 2.0.0-beta.32
15
+ ## 1.0.41
44
16
 
45
17
  ### Patch Changes
46
18
 
47
- - Updated dependencies [81d4308]
48
- - @ai-sdk/provider@3.0.0-beta.7
49
- - @ai-sdk/provider-utils@4.0.0-beta.18
19
+ - 11a8867: feat (provider/gateway): improve auth error messages
50
20
 
51
- ## 2.0.0-beta.31
21
+ ## 1.0.40
52
22
 
53
23
  ### Patch Changes
54
24
 
55
- - Updated dependencies [703459a]
56
- - @ai-sdk/provider-utils@4.0.0-beta.17
25
+ - f6a9bf3: feat (provider/gateway): add user and tags provider options
57
26
 
58
- ## 2.0.0-beta.30
27
+ ## 1.0.39
59
28
 
60
29
  ### Patch Changes
61
30
 
62
- - 0a2ff8a: feat (provider/gateway): add user and tags provider options
31
+ - Updated dependencies [17f9872]
32
+ - @ai-sdk/provider-utils@3.0.12
63
33
 
64
- ## 2.0.0-beta.29
34
+ ## 1.0.38
65
35
 
66
36
  ### Patch Changes
67
37
 
68
- - Updated dependencies [6306603]
69
- - @ai-sdk/provider-utils@4.0.0-beta.16
38
+ - 227ca94: fix: revert zod import change
70
39
 
71
- ## 2.0.0-beta.28
40
+ ## 1.0.37
72
41
 
73
42
  ### Patch Changes
74
43
 
75
- - f0b2157: fix: revert zod import change
76
- - Updated dependencies [f0b2157]
77
- - @ai-sdk/provider-utils@4.0.0-beta.15
44
+ - ec5a0a0: chore(provider/gateway): lazy schema loading
78
45
 
79
- ## 2.0.0-beta.27
46
+ ## 1.0.36
80
47
 
81
48
  ### Patch Changes
82
49
 
83
- - Updated dependencies [3b1d015]
84
- - @ai-sdk/provider-utils@4.0.0-beta.14
50
+ - 638a561: feat (provider/gateway): add 'only' to provider options
85
51
 
86
- ## 2.0.0-beta.26
52
+ ## 1.0.35
87
53
 
88
54
  ### Patch Changes
89
55
 
90
- - Updated dependencies [d116b4b]
91
- - @ai-sdk/provider-utils@4.0.0-beta.13
56
+ - 6f0644c: chore: use import \* from zod/v4
57
+ - Updated dependencies [6f0644c]
58
+ - Updated dependencies [6f0644c]
59
+ - @ai-sdk/provider-utils@3.0.11
92
60
 
93
- ## 2.0.0-beta.25
61
+ ## 1.0.34
94
62
 
95
63
  ### Patch Changes
96
64
 
97
- - Updated dependencies [7e32fea]
98
- - @ai-sdk/provider-utils@4.0.0-beta.12
99
-
100
- ## 2.0.0-beta.24
101
-
102
- ### Patch Changes
103
-
104
- - 0e29b8b: chore(provider/gateway): lazy schema loading
105
-
106
- ## 2.0.0-beta.23
107
-
108
- ### Patch Changes
109
-
110
- - acc14d8: feat (provider/gateway): add 'only' to provider options
111
-
112
- ## 2.0.0-beta.22
113
-
114
- ### Patch Changes
115
-
116
- - 95f65c2: chore: use import \* from zod/v4
117
- - Updated dependencies [95f65c2]
118
- - Updated dependencies [95f65c2]
119
- - @ai-sdk/provider-utils@4.0.0-beta.11
120
-
121
- ## 2.0.0-beta.21
122
-
123
- ### Patch Changes
124
-
125
- - 7b1b1b1: fix(provider/gateway): add "react-native" as export condition for browser behavior
65
+ - 143f65b: fix(provider/gateway): add "react-native" as export condition for browser behavior
126
66
 
127
67
  This avoids the use of native Node APIs in bundles created for React Native / Expo apps
128
68
 
129
- ## 2.0.0-beta.20
130
-
131
- ### Major Changes
132
-
133
- - dee8b05: ai SDK 6 beta
134
-
135
- ### Patch Changes
136
-
137
- - Updated dependencies [dee8b05]
138
- - @ai-sdk/provider@3.0.0-beta.6
139
- - @ai-sdk/provider-utils@4.0.0-beta.10
140
-
141
- ## 1.1.0-beta.19
69
+ ## 1.0.33
142
70
 
143
71
  ### Patch Changes
144
72
 
145
- - Updated dependencies [521c537]
146
- - @ai-sdk/provider-utils@3.1.0-beta.9
73
+ - cffad55: feat(gateway): oidc refresh with `@vercel/oidc`
147
74
 
148
- ## 1.1.0-beta.18
75
+ ## 1.0.32
149
76
 
150
77
  ### Patch Changes
151
78
 
152
- - Updated dependencies [e06565c]
153
- - @ai-sdk/provider-utils@3.1.0-beta.8
79
+ - bcdba23: feat(provider/gateway): Update DeepSeek model string autocomplete
154
80
 
155
- ## 1.1.0-beta.17
81
+ ## 1.0.31
156
82
 
157
83
  ### Patch Changes
158
84
 
159
- - 1d8ea2c: feat(provider/gateway): Add GPT-5 pro to Gateway model string autocomplete
85
+ - 094685f: feat(provider/gateway): Add DeepSeek V3.2 Exp to Gateway language model settings
160
86
 
161
- ## 1.1.0-beta.16
87
+ ## 1.0.30
162
88
 
163
89
  ### Patch Changes
164
90
 
165
- - Updated dependencies [046aa3b]
166
- - Updated dependencies [e8109d3]
167
- - @ai-sdk/provider@2.1.0-beta.5
168
- - @ai-sdk/provider-utils@3.1.0-beta.7
91
+ - bc5ed71: chore: update zod peer depenedency version
92
+ - Updated dependencies [bc5ed71]
93
+ - @ai-sdk/provider-utils@3.0.10
169
94
 
170
- ## 1.1.0-beta.15
95
+ ## 1.0.29
171
96
 
172
97
  ### Patch Changes
173
98
 
174
- - ef62178: feat(gateway): oidc refresh with `@vercel/oidc`
99
+ - 7ca78f1: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete
175
100
 
176
- ## 1.1.0-beta.14
101
+ ## 1.0.28
177
102
 
178
103
  ### Patch Changes
179
104
 
180
- - a90dca6: feat(provider/gateway): Add zAI GLM 4.6 to Gateway language model settings
105
+ - 322901b: feat: add provider version to user-agent header
181
106
 
182
- ## 1.1.0-beta.13
107
+ ## 1.0.27
183
108
 
184
109
  ### Patch Changes
185
110
 
186
- - 0adc679: feat(provider): shared spec v3
187
- - Updated dependencies [0adc679]
188
- - Updated dependencies [2b0caef]
189
- - @ai-sdk/provider-utils@3.1.0-beta.6
190
- - @ai-sdk/provider@2.1.0-beta.4
111
+ - c5f403a: feat(provider/gateway): Add gpt-5-codex to Gateway model string autocomplete
191
112
 
192
- ## 1.1.0-beta.12
113
+ ## 1.0.26
193
114
 
194
115
  ### Patch Changes
195
116
 
196
- - e6bfe91: feat(provider/gateway): Update DeepSeek model string autocomplete
117
+ - e304478: feat(provider/gateway): Add LongCat Thinking model to Gateway autocomplete
197
118
 
198
- ## 1.1.0-beta.11
119
+ ## 1.0.25
199
120
 
200
121
  ### Patch Changes
201
122
 
202
- - 636e614: feat(provider/gateway): Add DeepSeek V3.2 Exp to Gateway language model settings
203
-
204
- ## 1.1.0-beta.10
205
-
206
- ### Patch Changes
207
-
208
- - 9f6149e: feat(provider/gateway): Add Sonnet 4.5 to Gateway model string autocomplete
209
-
210
- ## 1.1.0-beta.9
211
-
212
- ### Patch Changes
213
-
214
- - 8dac895: feat: `LanguageModelV3`
215
- - Updated dependencies [8dac895]
216
- - @ai-sdk/provider-utils@3.1.0-beta.5
217
- - @ai-sdk/provider@2.1.0-beta.3
218
-
219
- ## 1.1.0-beta.8
220
-
221
- ### Patch Changes
222
-
223
- - c823faf: feat(provider/gateway): Add new Gemini preview models to Gateway model string autocomplete
224
-
225
- ## 1.1.0-beta.7
226
-
227
- ### Patch Changes
228
-
229
- - 4616b86: chore: update zod peer depenedency version
230
- - Updated dependencies [4616b86]
231
- - @ai-sdk/provider-utils@3.1.0-beta.4
232
-
233
- ## 1.1.0-beta.6
234
-
235
- ### Patch Changes
236
-
237
- - aaf5ebf: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete
238
- - ed329cb: feat: `Provider-V3`
239
- - Updated dependencies [ed329cb]
240
- - Updated dependencies [522f6b8]
241
- - @ai-sdk/provider@2.1.0-beta.2
242
- - @ai-sdk/provider-utils@3.1.0-beta.3
243
-
244
- ## 1.1.0-beta.5
245
-
246
- ### Patch Changes
247
-
248
- - 5d21222: feat(provider/gateway): Add gpt-5-codex to Gateway model string autocomplete
249
- - 0c4822d: feat: `EmbeddingModelV3`
250
- - 1cad0ab: feat: add provider version to user-agent header
251
- - Updated dependencies [0c4822d]
252
- - @ai-sdk/provider@2.1.0-beta.1
253
- - @ai-sdk/provider-utils@3.1.0-beta.2
254
-
255
- ## 1.1.0-beta.4
256
-
257
- ### Patch Changes
258
-
259
- - 7ccb36f: feat(provider/gateway): Add LongCat Thinking model to Gateway autocomplete
260
- - 6c766ef: feat(provider/gateway): Add DeepSeek V3.1 Terminus to Gateway autocomplete
261
-
262
- ## 1.1.0-beta.3
263
-
264
- ### Patch Changes
265
-
266
- - ea9ca31: feat(provider/gateway): Add new xAI models
267
-
268
- ## 1.1.0-beta.2
269
-
270
- ### Patch Changes
271
-
272
- - 3e83633: add getCredits() gateway method
273
- - f83903d: getCredits style improvements
274
-
275
- ## 1.1.0-beta.1
276
-
277
- ### Patch Changes
278
-
279
- - Updated dependencies [cbb1d35]
280
- - @ai-sdk/provider-utils@3.1.0-beta.1
281
-
282
- ## 1.1.0-beta.0
283
-
284
- ### Minor Changes
123
+ - 4d3ff64: feat(provider/gateway): Add new xAI models
285
124
 
286
- - 78928cb: release: start 5.1 beta
125
+ ## 1.0.24
287
126
 
288
127
  ### Patch Changes
289
128
 
290
- - Updated dependencies [78928cb]
291
- - @ai-sdk/provider@2.1.0-beta.0
292
- - @ai-sdk/provider-utils@3.1.0-beta.0
129
+ - c86e0f7: add getCredits() gateway method
130
+ - 6bbae01: getCredits style improvements
293
131
 
294
132
  ## 1.0.23
295
133
 
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { LanguageModelV3, ProviderV3, EmbeddingModelV3, TypeValidationError } from '@ai-sdk/provider';
1
+ import { LanguageModelV2, ProviderV2, EmbeddingModelV2, TypeValidationError } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
+ import { FetchFunction, InferValidator } from '@ai-sdk/provider-utils';
4
4
 
5
- type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-haiku-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | (string & {});
5
+ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-haiku-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | (string & {});
6
6
 
7
7
  interface GatewayLanguageModelEntry {
8
8
  /**
@@ -50,7 +50,7 @@ interface GatewayLanguageModelEntry {
50
50
  */
51
51
  modelType?: 'language' | 'embedding' | 'image' | null;
52
52
  }
53
- type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
53
+ type GatewayLanguageModelSpecification = Pick<LanguageModelV2, 'specificationVersion' | 'provider' | 'modelId'>;
54
54
 
55
55
  interface GatewayFetchMetadataResponse {
56
56
  models: GatewayLanguageModelEntry[];
@@ -64,12 +64,12 @@ interface GatewayCreditsResponse {
64
64
 
65
65
  type GatewayEmbeddingModelId = 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | 'voyage/voyage-code-2' | (string & {});
66
66
 
67
- interface GatewayProvider extends ProviderV3 {
68
- (modelId: GatewayModelId): LanguageModelV3;
67
+ interface GatewayProvider extends ProviderV2 {
68
+ (modelId: GatewayModelId): LanguageModelV2;
69
69
  /**
70
70
  Creates a model for text generation.
71
71
  */
72
- languageModel(modelId: GatewayModelId): LanguageModelV3;
72
+ languageModel(modelId: GatewayModelId): LanguageModelV2;
73
73
  /**
74
74
  Returns available providers and models for use with the remote provider.
75
75
  */
@@ -81,7 +81,7 @@ interface GatewayProvider extends ProviderV3 {
81
81
  /**
82
82
  Creates a model for generating text embeddings.
83
83
  */
84
- textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3<string>;
84
+ textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV2<string>;
85
85
  }
86
86
  interface GatewayProviderSettings {
87
87
  /**
@@ -112,14 +112,14 @@ Create a remote provider instance.
112
112
  declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
113
113
  declare const gateway: GatewayProvider;
114
114
 
115
- declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
115
+ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
116
116
  only?: string[] | undefined;
117
117
  order?: string[] | undefined;
118
118
  user?: string | undefined;
119
119
  tags?: string[] | undefined;
120
120
  models?: string[] | undefined;
121
121
  }>;
122
- type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
122
+ type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
123
123
 
124
124
  declare const symbol$6: unique symbol;
125
125
  declare abstract class GatewayError extends Error {
@@ -142,7 +142,7 @@ declare abstract class GatewayError extends Error {
142
142
  static hasMarker(error: unknown): error is GatewayError;
143
143
  }
144
144
 
145
- declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
145
+ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazyValidator<{
146
146
  error: {
147
147
  message: string;
148
148
  type?: string | null | undefined;
@@ -150,7 +150,7 @@ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
150
150
  code?: string | number | null | undefined;
151
151
  };
152
152
  }>;
153
- type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
153
+ type GatewayErrorResponse = InferValidator<typeof gatewayErrorResponseSchema>;
154
154
 
155
155
  declare const symbol$5: unique symbol;
156
156
  /**
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { LanguageModelV3, ProviderV3, EmbeddingModelV3, TypeValidationError } from '@ai-sdk/provider';
1
+ import { LanguageModelV2, ProviderV2, EmbeddingModelV2, TypeValidationError } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
+ import { FetchFunction, InferValidator } from '@ai-sdk/provider-utils';
4
4
 
5
- type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-haiku-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | (string & {});
5
+ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-haiku-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | (string & {});
6
6
 
7
7
  interface GatewayLanguageModelEntry {
8
8
  /**
@@ -50,7 +50,7 @@ interface GatewayLanguageModelEntry {
50
50
  */
51
51
  modelType?: 'language' | 'embedding' | 'image' | null;
52
52
  }
53
- type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
53
+ type GatewayLanguageModelSpecification = Pick<LanguageModelV2, 'specificationVersion' | 'provider' | 'modelId'>;
54
54
 
55
55
  interface GatewayFetchMetadataResponse {
56
56
  models: GatewayLanguageModelEntry[];
@@ -64,12 +64,12 @@ interface GatewayCreditsResponse {
64
64
 
65
65
  type GatewayEmbeddingModelId = 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | 'voyage/voyage-code-2' | (string & {});
66
66
 
67
- interface GatewayProvider extends ProviderV3 {
68
- (modelId: GatewayModelId): LanguageModelV3;
67
+ interface GatewayProvider extends ProviderV2 {
68
+ (modelId: GatewayModelId): LanguageModelV2;
69
69
  /**
70
70
  Creates a model for text generation.
71
71
  */
72
- languageModel(modelId: GatewayModelId): LanguageModelV3;
72
+ languageModel(modelId: GatewayModelId): LanguageModelV2;
73
73
  /**
74
74
  Returns available providers and models for use with the remote provider.
75
75
  */
@@ -81,7 +81,7 @@ interface GatewayProvider extends ProviderV3 {
81
81
  /**
82
82
  Creates a model for generating text embeddings.
83
83
  */
84
- textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3<string>;
84
+ textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV2<string>;
85
85
  }
86
86
  interface GatewayProviderSettings {
87
87
  /**
@@ -112,14 +112,14 @@ Create a remote provider instance.
112
112
  declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
113
113
  declare const gateway: GatewayProvider;
114
114
 
115
- declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
115
+ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
116
116
  only?: string[] | undefined;
117
117
  order?: string[] | undefined;
118
118
  user?: string | undefined;
119
119
  tags?: string[] | undefined;
120
120
  models?: string[] | undefined;
121
121
  }>;
122
- type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
122
+ type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
123
123
 
124
124
  declare const symbol$6: unique symbol;
125
125
  declare abstract class GatewayError extends Error {
@@ -142,7 +142,7 @@ declare abstract class GatewayError extends Error {
142
142
  static hasMarker(error: unknown): error is GatewayError;
143
143
  }
144
144
 
145
- declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
145
+ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazyValidator<{
146
146
  error: {
147
147
  message: string;
148
148
  type?: string | null | undefined;
@@ -150,7 +150,7 @@ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
150
150
  code?: string | number | null | undefined;
151
151
  };
152
152
  }>;
153
- type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
153
+ type GatewayErrorResponse = InferValidator<typeof gatewayErrorResponseSchema>;
154
154
 
155
155
  declare const symbol$5: unique symbol;
156
156
  /**
package/dist/index.js CHANGED
@@ -182,7 +182,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
182
182
  var name4 = "GatewayModelNotFoundError";
183
183
  var marker5 = `vercel.ai.gateway.error.${name4}`;
184
184
  var symbol5 = Symbol.for(marker5);
185
- var modelNotFoundParamSchema = (0, import_provider_utils.lazySchema)(
185
+ var modelNotFoundParamSchema = (0, import_provider_utils.lazyValidator)(
186
186
  () => (0, import_provider_utils.zodSchema)(
187
187
  import_v4.z.object({
188
188
  modelId: import_v4.z.string()
@@ -312,7 +312,7 @@ async function createGatewayErrorFromResponse({
312
312
  return new GatewayInternalServerError({ message, statusCode, cause });
313
313
  }
314
314
  }
315
- var gatewayErrorResponseSchema = (0, import_provider_utils2.lazySchema)(
315
+ var gatewayErrorResponseSchema = (0, import_provider_utils2.lazyValidator)(
316
316
  () => (0, import_provider_utils2.zodSchema)(
317
317
  import_v42.z.object({
318
318
  error: import_v42.z.object({
@@ -375,7 +375,7 @@ async function parseAuthMethod(headers) {
375
375
  });
376
376
  return result.success ? result.value : void 0;
377
377
  }
378
- var gatewayAuthMethodSchema = (0, import_provider_utils3.lazySchema)(
378
+ var gatewayAuthMethodSchema = (0, import_provider_utils3.lazyValidator)(
379
379
  () => (0, import_provider_utils3.zodSchema)(import_v43.z.union([import_v43.z.literal("api-key"), import_v43.z.literal("oidc")]))
380
380
  );
381
381
 
@@ -426,7 +426,7 @@ var GatewayFetchMetadata = class {
426
426
  }
427
427
  }
428
428
  };
429
- var gatewayAvailableModelsResponseSchema = (0, import_provider_utils4.lazySchema)(
429
+ var gatewayAvailableModelsResponseSchema = (0, import_provider_utils4.lazyValidator)(
430
430
  () => (0, import_provider_utils4.zodSchema)(
431
431
  import_v44.z.object({
432
432
  models: import_v44.z.array(
@@ -448,7 +448,7 @@ var gatewayAvailableModelsResponseSchema = (0, import_provider_utils4.lazySchema
448
448
  })
449
449
  ).nullish(),
450
450
  specification: import_v44.z.object({
451
- specificationVersion: import_v44.z.literal("v3"),
451
+ specificationVersion: import_v44.z.literal("v2"),
452
452
  provider: import_v44.z.string(),
453
453
  modelId: import_v44.z.string()
454
454
  }),
@@ -458,7 +458,7 @@ var gatewayAvailableModelsResponseSchema = (0, import_provider_utils4.lazySchema
458
458
  })
459
459
  )
460
460
  );
461
- var gatewayCreditsResponseSchema = (0, import_provider_utils4.lazySchema)(
461
+ var gatewayCreditsResponseSchema = (0, import_provider_utils4.lazyValidator)(
462
462
  () => (0, import_provider_utils4.zodSchema)(
463
463
  import_v44.z.object({
464
464
  balance: import_v44.z.string(),
@@ -477,7 +477,7 @@ var GatewayLanguageModel = class {
477
477
  constructor(modelId, config) {
478
478
  this.modelId = modelId;
479
479
  this.config = config;
480
- this.specificationVersion = "v3";
480
+ this.specificationVersion = "v2";
481
481
  this.supportedUrls = { "*/*": [/.*/] };
482
482
  }
483
483
  get provider() {
@@ -626,7 +626,7 @@ var GatewayEmbeddingModel = class {
626
626
  constructor(modelId, config) {
627
627
  this.modelId = modelId;
628
628
  this.config = config;
629
- this.specificationVersion = "v3";
629
+ this.specificationVersion = "v2";
630
630
  this.maxEmbeddingsPerCall = 2048;
631
631
  this.supportsParallelCalls = true;
632
632
  }
@@ -688,7 +688,7 @@ var GatewayEmbeddingModel = class {
688
688
  };
689
689
  }
690
690
  };
691
- var gatewayEmbeddingResponseSchema = (0, import_provider_utils6.lazySchema)(
691
+ var gatewayEmbeddingResponseSchema = (0, import_provider_utils6.lazyValidator)(
692
692
  () => (0, import_provider_utils6.zodSchema)(
693
693
  import_v46.z.object({
694
694
  embeddings: import_v46.z.array(import_v46.z.array(import_v46.z.number())),
@@ -710,7 +710,7 @@ async function getVercelRequestId() {
710
710
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
711
711
 
712
712
  // src/version.ts
713
- var VERSION = true ? "2.0.0-beta.38" : "0.0.0-test";
713
+ var VERSION = true ? "2.0.1" : "0.0.0-test";
714
714
 
715
715
  // src/gateway-provider.ts
716
716
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";