@ai-sdk/gateway 4.0.0-beta.5 → 4.0.0-beta.51

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,5 +1,332 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
+ ## 4.0.0-beta.51
4
+
5
+ ### Patch Changes
6
+
7
+ - cdcdec2: chore(provider/gateway): update gateway model settings files
8
+
9
+ ## 4.0.0-beta.50
10
+
11
+ ### Patch Changes
12
+
13
+ - b3976a2: Add workflow serialization support to all provider models.
14
+
15
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
16
+
17
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
18
+
19
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
20
+
21
+ - Updated dependencies [b3976a2]
22
+ - Updated dependencies [ff5eba1]
23
+ - @ai-sdk/provider-utils@5.0.0-beta.20
24
+ - @ai-sdk/provider@4.0.0-beta.12
25
+
26
+ ## 4.0.0-beta.49
27
+
28
+ ### Major Changes
29
+
30
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [ef992f8]
35
+ - @ai-sdk/provider@4.0.0-beta.11
36
+ - @ai-sdk/provider-utils@5.0.0-beta.19
37
+
38
+ ## 4.0.0-beta.48
39
+
40
+ ### Patch Changes
41
+
42
+ - bdbd322: fix (packages/gateway): clarify sort docs
43
+ - 8f53ccf: chore(provider/gateway): update gateway model settings files
44
+
45
+ ## 4.0.0-beta.47
46
+
47
+ ### Patch Changes
48
+
49
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
50
+ - Updated dependencies [90e2d8a]
51
+ - @ai-sdk/provider-utils@5.0.0-beta.18
52
+
53
+ ## 4.0.0-beta.46
54
+
55
+ ### Patch Changes
56
+
57
+ - 6b0a40d: feat (provider/gateway): add sort options
58
+
59
+ ## 4.0.0-beta.45
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [3ae1786]
64
+ - @ai-sdk/provider-utils@5.0.0-beta.17
65
+
66
+ ## 4.0.0-beta.44
67
+
68
+ ### Patch Changes
69
+
70
+ - 7943a4b: chore(provider/gateway): update gateway model settings files
71
+
72
+ ## 4.0.0-beta.43
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [176466a]
77
+ - @ai-sdk/provider@4.0.0-beta.10
78
+ - @ai-sdk/provider-utils@5.0.0-beta.16
79
+
80
+ ## 4.0.0-beta.42
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [e311194]
85
+ - @ai-sdk/provider@4.0.0-beta.9
86
+ - @ai-sdk/provider-utils@5.0.0-beta.15
87
+
88
+ ## 4.0.0-beta.41
89
+
90
+ ### Patch Changes
91
+
92
+ - 1464561: chore(provider/gateway): update gateway model settings files
93
+
94
+ ## 4.0.0-beta.40
95
+
96
+ ### Patch Changes
97
+
98
+ - 939171f: feat (provider/gateway): add reranking model support with `rerankingModel()` and `reranking()` methods
99
+
100
+ ## 4.0.0-beta.39
101
+
102
+ ### Patch Changes
103
+
104
+ - 0694029: chore(provider/gateway): update gateway model settings files
105
+
106
+ ## 4.0.0-beta.38
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies [34bd95d]
111
+ - Updated dependencies [008271d]
112
+ - @ai-sdk/provider@4.0.0-beta.8
113
+ - @ai-sdk/provider-utils@5.0.0-beta.14
114
+
115
+ ## 4.0.0-beta.37
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies [b0c2869]
120
+ - Updated dependencies [7e26e81]
121
+ - @ai-sdk/provider-utils@5.0.0-beta.13
122
+
123
+ ## 4.0.0-beta.36
124
+
125
+ ### Patch Changes
126
+
127
+ - fb0c233: chore(provider/gateway): update gateway model settings files
128
+ - d1f0d2b: feat (provider/gateway): add quotaEntityId gateway provider option
129
+
130
+ ## 4.0.0-beta.35
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [46d1149]
135
+ - @ai-sdk/provider-utils@5.0.0-beta.12
136
+
137
+ ## 4.0.0-beta.34
138
+
139
+ ### Patch Changes
140
+
141
+ - 71b0e7d: feat (provider/gateway): add hipaaCompliant gateway provider option
142
+
143
+ ## 4.0.0-beta.33
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [6fd51c0]
148
+ - @ai-sdk/provider-utils@5.0.0-beta.11
149
+ - @ai-sdk/provider@4.0.0-beta.7
150
+
151
+ ## 4.0.0-beta.32
152
+
153
+ ### Patch Changes
154
+
155
+ - 11746ca: chore(provider/gateway): update gateway model settings files
156
+
157
+ ## 4.0.0-beta.31
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies [c29a26f]
162
+ - @ai-sdk/provider-utils@5.0.0-beta.10
163
+ - @ai-sdk/provider@4.0.0-beta.6
164
+
165
+ ## 4.0.0-beta.30
166
+
167
+ ### Patch Changes
168
+
169
+ - 4552cbf: chore(provider/gateway): update gateway model settings files
170
+
171
+ ## 4.0.0-beta.29
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [2e17091]
176
+ - @ai-sdk/provider-utils@5.0.0-beta.9
177
+
178
+ ## 4.0.0-beta.28
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [986c6fd]
183
+ - Updated dependencies [493295c]
184
+ - @ai-sdk/provider-utils@5.0.0-beta.8
185
+
186
+ ## 4.0.0-beta.27
187
+
188
+ ### Patch Changes
189
+
190
+ - 70a9aae: feat (provider/gateway): add disallowPromptTraining gateway provider option
191
+
192
+ ## 4.0.0-beta.26
193
+
194
+ ### Patch Changes
195
+
196
+ - 294cbe7: chore(provider/gateway): update gateway model settings files
197
+
198
+ ## 4.0.0-beta.25
199
+
200
+ ### Patch Changes
201
+
202
+ - 435895b: feat (provider/gateway): add get-generation support
203
+
204
+ ## 4.0.0-beta.24
205
+
206
+ ### Patch Changes
207
+
208
+ - d30466c: feat (provider/gateway): add spend reporting support
209
+
210
+ ## 4.0.0-beta.23
211
+
212
+ ### Patch Changes
213
+
214
+ - 4ec78cd: chore(provider/gateway): rename GatewayLanguageModelOptions back to GatewayProviderOptions
215
+
216
+ ## 4.0.0-beta.22
217
+
218
+ ### Patch Changes
219
+
220
+ - 7ceff62: chore(provider/gateway): update gateway model settings files
221
+
222
+ ## 4.0.0-beta.21
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [1f509d4]
227
+ - @ai-sdk/provider-utils@5.0.0-beta.7
228
+ - @ai-sdk/provider@4.0.0-beta.5
229
+
230
+ ## 4.0.0-beta.20
231
+
232
+ ### Patch Changes
233
+
234
+ - 4f91b5d: chore(provider/xai): update Grok 4.20 model IDs to their non-beta versions
235
+
236
+ ## 4.0.0-beta.19
237
+
238
+ ### Patch Changes
239
+
240
+ - 72889f8: chore(provider/gateway): update gateway model settings files
241
+
242
+ ## 4.0.0-beta.18
243
+
244
+ ### Patch Changes
245
+
246
+ - 165b97a: chore(provider/gateway): update gateway model settings files
247
+
248
+ ## 4.0.0-beta.17
249
+
250
+ ### Patch Changes
251
+
252
+ - Updated dependencies [3887c70]
253
+ - @ai-sdk/provider-utils@5.0.0-beta.6
254
+ - @ai-sdk/provider@4.0.0-beta.4
255
+
256
+ ## 4.0.0-beta.16
257
+
258
+ ### Patch Changes
259
+
260
+ - Updated dependencies [776b617]
261
+ - @ai-sdk/provider-utils@5.0.0-beta.5
262
+ - @ai-sdk/provider@4.0.0-beta.3
263
+
264
+ ## 4.0.0-beta.15
265
+
266
+ ### Patch Changes
267
+
268
+ - Updated dependencies [61753c3]
269
+ - @ai-sdk/provider-utils@5.0.0-beta.4
270
+
271
+ ## 4.0.0-beta.14
272
+
273
+ ### Patch Changes
274
+
275
+ - ead9144: chore(provider/gateway): update gateway model settings files
276
+
277
+ ## 4.0.0-beta.13
278
+
279
+ ### Patch Changes
280
+
281
+ - 2095655: chore(provider/gateway): update gateway model settings files
282
+
283
+ ## 4.0.0-beta.12
284
+
285
+ ### Patch Changes
286
+
287
+ - Updated dependencies [f7d4f01]
288
+ - @ai-sdk/provider-utils@5.0.0-beta.3
289
+ - @ai-sdk/provider@4.0.0-beta.2
290
+
291
+ ## 4.0.0-beta.11
292
+
293
+ ### Patch Changes
294
+
295
+ - Updated dependencies [5c2a5a2]
296
+ - @ai-sdk/provider@4.0.0-beta.1
297
+ - @ai-sdk/provider-utils@5.0.0-beta.2
298
+
299
+ ## 4.0.0-beta.10
300
+
301
+ ### Patch Changes
302
+
303
+ - 4d6ab9a: chore(provider/gateway): update gateway model settings files
304
+
305
+ ## 4.0.0-beta.9
306
+
307
+ ### Patch Changes
308
+
309
+ - 980f777: chore(provider/gateway): update gateway model settings files
310
+ - 7185ba2: bump `@vercel/oidc` dependency to 3.2.0
311
+
312
+ ## 4.0.0-beta.8
313
+
314
+ ### Patch Changes
315
+
316
+ - 4adc485: chore(provider/gateway): update gateway model settings files
317
+
318
+ ## 4.0.0-beta.7
319
+
320
+ ### Patch Changes
321
+
322
+ - e046ea3: chore(provider/gateway): update gateway model settings files
323
+
324
+ ## 4.0.0-beta.6
325
+
326
+ ### Patch Changes
327
+
328
+ - 82288b0: feat(provider/google): add `gemini-embedding-2-preview` and fix multimodal embedding support with `embedMany`
329
+
3
330
  ## 4.0.0-beta.5
4
331
 
5
332
  ### Patch Changes
@@ -501,13 +828,13 @@
501
828
  Before
502
829
 
503
830
  ```ts
504
- model.textEmbeddingModel('my-model-id');
831
+ model.textEmbeddingModel("my-model-id");
505
832
  ```
506
833
 
507
834
  After
508
835
 
509
836
  ```ts
510
- model.embeddingModel('my-model-id');
837
+ model.embeddingModel("my-model-id");
511
838
  ```
512
839
 
513
840
  - aaf5ebf: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete
@@ -789,13 +1116,13 @@
789
1116
  Before
790
1117
 
791
1118
  ```ts
792
- model.textEmbeddingModel('my-model-id');
1119
+ model.textEmbeddingModel("my-model-id");
793
1120
  ```
794
1121
 
795
1122
  After
796
1123
 
797
1124
  ```ts
798
- model.embeddingModel('my-model-id');
1125
+ model.embeddingModel("my-model-id");
799
1126
  ```
800
1127
 
801
1128
  - Updated dependencies [8d9e8ad]
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- import { LanguageModelV3, ProviderV3, EmbeddingModelV3, ImageModelV3, Experimental_VideoModelV3, TypeValidationError } from '@ai-sdk/provider';
1
+ import { LanguageModelV4, ProviderV4, EmbeddingModelV4, ImageModelV4, Experimental_VideoModelV4, RerankingModelV4, TypeValidationError } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { FetchFunction, InferSchema } 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-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'amazon/nova-2-lite' | '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.5-sonnet-20240620' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'arcee-ai/trinity-large-preview' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'kwaipilot/kat-coder-pro-v1' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | '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' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/codex-mini' | '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-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-chat' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'prime-intellect/intellect-3' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-code-fast-1' | 'xiaomi/mimo-v2-flash' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | (string & {});
5
+ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'arcee-ai/trinity-large-preview' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking-2601' | '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' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | '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-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-chat' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'prime-intellect/intellect-3' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-code-fast-1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5v-turbo' | (string & {});
6
+
7
+ type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
6
8
 
7
9
  type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'bytedance/seedance-v1.0-lite-i2v' | 'bytedance/seedance-v1.0-lite-t2v' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-t2v' | 'xai/grok-imagine-video' | (string & {});
8
10
 
@@ -52,7 +54,7 @@ interface GatewayLanguageModelEntry {
52
54
  */
53
55
  modelType?: 'language' | 'embedding' | 'image' | 'video' | null;
54
56
  }
55
- type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
57
+ type GatewayLanguageModelSpecification = Pick<LanguageModelV4, 'specificationVersion' | 'provider' | 'modelId'>;
56
58
 
57
59
  interface GatewayFetchMetadataResponse {
58
60
  models: GatewayLanguageModelEntry[];
@@ -64,9 +66,108 @@ interface GatewayCreditsResponse {
64
66
  totalUsed: string;
65
67
  }
66
68
 
67
- type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | '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-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
69
+ interface GatewaySpendReportParams {
70
+ /** Start date in YYYY-MM-DD format (inclusive) */
71
+ startDate: string;
72
+ /** End date in YYYY-MM-DD format (inclusive) */
73
+ endDate: string;
74
+ /** Primary aggregation dimension. Defaults to 'day'. */
75
+ groupBy?: 'day' | 'user' | 'model' | 'tag' | 'provider' | 'credential_type';
76
+ /** Time granularity when groupBy is 'day'. */
77
+ datePart?: 'day' | 'hour';
78
+ /** Filter to a specific user's spend. */
79
+ userId?: string;
80
+ /** Filter to a specific model (e.g. 'anthropic/claude-sonnet-4.5'). */
81
+ model?: string;
82
+ /** Filter to a specific provider (e.g. 'anthropic'). */
83
+ provider?: string;
84
+ /** Filter to BYOK or system credentials. */
85
+ credentialType?: 'byok' | 'system';
86
+ /** Filter to requests with these tags. */
87
+ tags?: string[];
88
+ }
89
+ interface GatewaySpendReportRow {
90
+ /** Date string (present when groupBy is 'day') */
91
+ day?: string;
92
+ /** Hour timestamp (present when groupBy is 'day' and datePart is 'hour') */
93
+ hour?: string;
94
+ /** User identifier (present when groupBy is 'user') */
95
+ user?: string;
96
+ /** Model identifier (present when groupBy is 'model') */
97
+ model?: string;
98
+ /** Tag value (present when groupBy is 'tag') */
99
+ tag?: string;
100
+ /** Provider name (present when groupBy is 'provider') */
101
+ provider?: string;
102
+ /** Credential type (present when groupBy is 'credential_type') */
103
+ credentialType?: 'byok' | 'system';
104
+ /** Total cost in USD */
105
+ totalCost: number;
106
+ /** Market cost in USD */
107
+ marketCost?: number;
108
+ /** Number of input tokens */
109
+ inputTokens?: number;
110
+ /** Number of output tokens */
111
+ outputTokens?: number;
112
+ /** Number of cached input tokens */
113
+ cachedInputTokens?: number;
114
+ /** Number of cache creation input tokens */
115
+ cacheCreationInputTokens?: number;
116
+ /** Number of reasoning tokens */
117
+ reasoningTokens?: number;
118
+ /** Number of requests */
119
+ requestCount?: number;
120
+ }
121
+ interface GatewaySpendReportResponse {
122
+ results: GatewaySpendReportRow[];
123
+ }
124
+
125
+ interface GatewayGenerationInfoParams {
126
+ /** The generation ID to look up (format: gen_<ulid>) */
127
+ id: string;
128
+ }
129
+ interface GatewayGenerationInfo {
130
+ /** The generation ID */
131
+ id: string;
132
+ /** Total cost in USD */
133
+ totalCost: number;
134
+ /** Upstream inference cost in USD (BYOK only) */
135
+ upstreamInferenceCost: number;
136
+ /** Usage cost in USD (same as totalCost) */
137
+ usage: number;
138
+ /** ISO 8601 timestamp when the generation was created */
139
+ createdAt: string;
140
+ /** Model identifier */
141
+ model: string;
142
+ /** Whether BYOK credentials were used */
143
+ isByok: boolean;
144
+ /** Provider that served this generation */
145
+ providerName: string;
146
+ /** Whether streaming was used */
147
+ streamed: boolean;
148
+ /** Finish reason (e.g. 'stop') */
149
+ finishReason: string;
150
+ /** Time to first token in milliseconds */
151
+ latency: number;
152
+ /** Total generation time in milliseconds */
153
+ generationTime: number;
154
+ /** Number of prompt tokens */
155
+ promptTokens: number;
156
+ /** Number of completion tokens */
157
+ completionTokens: number;
158
+ /** Reasoning tokens used */
159
+ reasoningTokens: number;
160
+ /** Cached tokens used */
161
+ cachedTokens: number;
162
+ /** Cache creation input tokens */
163
+ cacheCreationTokens: number;
164
+ /** Billable web search calls */
165
+ billableWebSearchCalls: number;
166
+ }
167
+
168
+ type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | '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-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
68
169
 
69
- type GatewayImageModelId = 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'google/imagen-4.0-fast-generate-001' | 'google/imagen-4.0-generate-001' | 'google/imagen-4.0-ultra-generate-001' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'xai/grok-imagine-image' | 'xai/grok-imagine-image-pro' | (string & {});
170
+ type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'google/imagen-4.0-fast-generate-001' | 'google/imagen-4.0-generate-001' | 'google/imagen-4.0-ultra-generate-001' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'prodia/flux-fast-schnell' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'xai/grok-imagine-image' | 'xai/grok-imagine-image-pro' | (string & {});
70
171
 
71
172
  interface PerplexitySearchConfig {
72
173
  /**
@@ -194,7 +295,7 @@ interface PerplexitySearchInput {
194
295
  search_recency_filter?: 'day' | 'week' | 'month' | 'year';
195
296
  }
196
297
  type PerplexitySearchOutput = PerplexitySearchResponse | PerplexitySearchError;
197
- declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<PerplexitySearchInput, PerplexitySearchOutput, PerplexitySearchConfig>;
298
+ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<PerplexitySearchInput, PerplexitySearchOutput, PerplexitySearchConfig, {}>;
198
299
 
199
300
  interface ParallelSearchSourcePolicy {
200
301
  /**
@@ -327,7 +428,7 @@ interface ParallelSearchInput {
327
428
  };
328
429
  }
329
430
  type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
330
- declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
431
+ declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig, {}>;
331
432
 
332
433
  /**
333
434
  * Gateway-specific provider-defined tools.
@@ -352,16 +453,16 @@ declare const gatewayTools: {
352
453
  perplexitySearch: (config?: PerplexitySearchConfig) => ReturnType<typeof perplexitySearchToolFactory>;
353
454
  };
354
455
 
355
- interface GatewayProvider extends ProviderV3 {
356
- (modelId: GatewayModelId): LanguageModelV3;
456
+ interface GatewayProvider extends ProviderV4 {
457
+ (modelId: GatewayModelId): LanguageModelV4;
357
458
  /**
358
459
  * Creates a model for text generation.
359
460
  */
360
- chat(modelId: GatewayModelId): LanguageModelV3;
461
+ chat(modelId: GatewayModelId): LanguageModelV4;
361
462
  /**
362
463
  * Creates a model for text generation.
363
464
  */
364
- languageModel(modelId: GatewayModelId): LanguageModelV3;
465
+ languageModel(modelId: GatewayModelId): LanguageModelV4;
365
466
  /**
366
467
  * Returns available providers and models for use with the remote provider.
367
468
  */
@@ -370,34 +471,52 @@ interface GatewayProvider extends ProviderV3 {
370
471
  * Returns credit information for the authenticated user.
371
472
  */
372
473
  getCredits(): Promise<GatewayCreditsResponse>;
474
+ /**
475
+ * Returns a spend report with cost, token, and request count data,
476
+ * aggregated by the specified dimension.
477
+ */
478
+ getSpendReport(params: GatewaySpendReportParams): Promise<GatewaySpendReportResponse>;
479
+ /**
480
+ * Returns detailed information about a specific generation by its ID,
481
+ * including cost, token usage, latency, and provider details.
482
+ */
483
+ getGenerationInfo(params: GatewayGenerationInfoParams): Promise<GatewayGenerationInfo>;
373
484
  /**
374
485
  * Creates a model for generating text embeddings.
375
486
  */
376
- embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
487
+ embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
377
488
  /**
378
489
  * Creates a model for generating text embeddings.
379
490
  */
380
- embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
491
+ embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
381
492
  /**
382
493
  * @deprecated Use `embeddingModel` instead.
383
494
  */
384
- textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
495
+ textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
385
496
  /**
386
497
  * Creates a model for generating images.
387
498
  */
388
- image(modelId: GatewayImageModelId): ImageModelV3;
499
+ image(modelId: GatewayImageModelId): ImageModelV4;
389
500
  /**
390
501
  * Creates a model for generating images.
391
502
  */
392
- imageModel(modelId: GatewayImageModelId): ImageModelV3;
503
+ imageModel(modelId: GatewayImageModelId): ImageModelV4;
393
504
  /**
394
505
  * Creates a model for generating videos.
395
506
  */
396
- video(modelId: GatewayVideoModelId): Experimental_VideoModelV3;
507
+ video(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
397
508
  /**
398
509
  * Creates a model for generating videos.
399
510
  */
400
- videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV3;
511
+ videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
512
+ /**
513
+ * Creates a model for reranking documents.
514
+ */
515
+ reranking(modelId: GatewayRerankingModelId): RerankingModelV4;
516
+ /**
517
+ * Creates a model for reranking documents.
518
+ */
519
+ rerankingModel(modelId: GatewayRerankingModelId): RerankingModelV4;
401
520
  /**
402
521
  * Gateway-specific tools executed server-side.
403
522
  */
@@ -432,19 +551,23 @@ interface GatewayProviderSettings {
432
551
  declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
433
552
  declare const gateway: GatewayProvider;
434
553
 
435
- declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
554
+ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
436
555
  only?: string[] | undefined;
437
556
  order?: string[] | undefined;
557
+ sort?: "cost" | "ttft" | "tps" | undefined;
438
558
  user?: string | undefined;
439
559
  tags?: string[] | undefined;
440
560
  models?: string[] | undefined;
441
561
  byok?: Record<string, Record<string, unknown>[]> | undefined;
442
562
  zeroDataRetention?: boolean | undefined;
563
+ disallowPromptTraining?: boolean | undefined;
564
+ hipaaCompliant?: boolean | undefined;
565
+ quotaEntityId?: string | undefined;
443
566
  providerTimeouts?: {
444
567
  byok?: Record<string, number> | undefined;
445
568
  } | undefined;
446
569
  }>;
447
- type GatewayLanguageModelOptions = InferSchema<typeof gatewayLanguageModelOptions>;
570
+ type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
448
571
 
449
572
  declare const symbol$6: unique symbol;
450
573
  declare abstract class GatewayError extends Error {
@@ -498,7 +621,7 @@ declare class GatewayAuthenticationError extends GatewayError {
498
621
  /**
499
622
  * Creates a contextual error message when authentication fails
500
623
  */
501
- static createContextualError({ apiKeyProvided, oidcTokenProvided, message, statusCode, cause, generationId, }: {
624
+ static createContextualError({ apiKeyProvided, oidcTokenProvided, statusCode, cause, generationId, }: {
502
625
  apiKeyProvided: boolean;
503
626
  oidcTokenProvided: boolean;
504
627
  message?: string;
@@ -599,4 +722,4 @@ declare class GatewayResponseError extends GatewayError {
599
722
  static isInstance(error: unknown): error is GatewayResponseError;
600
723
  }
601
724
 
602
- export { GatewayAuthenticationError, type GatewayCreditsResponse, GatewayError, type GatewayErrorResponse, GatewayInternalServerError, GatewayInvalidRequestError, type GatewayLanguageModelEntry, type GatewayLanguageModelOptions, type GatewayLanguageModelSpecification, type GatewayLanguageModelEntry as GatewayModelEntry, type GatewayModelId, GatewayModelNotFoundError, type GatewayProvider, type GatewayLanguageModelOptions as GatewayProviderOptions, type GatewayProviderSettings, GatewayRateLimitError, GatewayResponseError, type GatewayVideoModelId, createGatewayProvider as createGateway, createGatewayProvider, gateway };
725
+ export { GatewayAuthenticationError, type GatewayCreditsResponse, GatewayError, type GatewayErrorResponse, type GatewayGenerationInfo, type GatewayGenerationInfoParams, GatewayInternalServerError, GatewayInvalidRequestError, type GatewayLanguageModelEntry, type GatewayProviderOptions as GatewayLanguageModelOptions, type GatewayLanguageModelSpecification, type GatewayLanguageModelEntry as GatewayModelEntry, type GatewayModelId, GatewayModelNotFoundError, type GatewayProvider, type GatewayProviderOptions, type GatewayProviderSettings, GatewayRateLimitError, type GatewayRerankingModelId, GatewayResponseError, type GatewaySpendReportParams, type GatewaySpendReportResponse, type GatewaySpendReportRow, type GatewayVideoModelId, createGatewayProvider as createGateway, createGatewayProvider, gateway };