@ai-sdk/gateway 4.0.0-beta.4 → 4.0.0-beta.41

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,253 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
+ ## 4.0.0-beta.41
4
+
5
+ ### Patch Changes
6
+
7
+ - 1464561: chore(provider/gateway): update gateway model settings files
8
+
9
+ ## 4.0.0-beta.40
10
+
11
+ ### Patch Changes
12
+
13
+ - 939171f: feat (provider/gateway): add reranking model support with `rerankingModel()` and `reranking()` methods
14
+
15
+ ## 4.0.0-beta.39
16
+
17
+ ### Patch Changes
18
+
19
+ - 0694029: chore(provider/gateway): update gateway model settings files
20
+
21
+ ## 4.0.0-beta.38
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [34bd95d]
26
+ - Updated dependencies [008271d]
27
+ - @ai-sdk/provider@4.0.0-beta.8
28
+ - @ai-sdk/provider-utils@5.0.0-beta.14
29
+
30
+ ## 4.0.0-beta.37
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [b0c2869]
35
+ - Updated dependencies [7e26e81]
36
+ - @ai-sdk/provider-utils@5.0.0-beta.13
37
+
38
+ ## 4.0.0-beta.36
39
+
40
+ ### Patch Changes
41
+
42
+ - fb0c233: chore(provider/gateway): update gateway model settings files
43
+ - d1f0d2b: feat (provider/gateway): add quotaEntityId gateway provider option
44
+
45
+ ## 4.0.0-beta.35
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [46d1149]
50
+ - @ai-sdk/provider-utils@5.0.0-beta.12
51
+
52
+ ## 4.0.0-beta.34
53
+
54
+ ### Patch Changes
55
+
56
+ - 71b0e7d: feat (provider/gateway): add hipaaCompliant gateway provider option
57
+
58
+ ## 4.0.0-beta.33
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [6fd51c0]
63
+ - @ai-sdk/provider-utils@5.0.0-beta.11
64
+ - @ai-sdk/provider@4.0.0-beta.7
65
+
66
+ ## 4.0.0-beta.32
67
+
68
+ ### Patch Changes
69
+
70
+ - 11746ca: chore(provider/gateway): update gateway model settings files
71
+
72
+ ## 4.0.0-beta.31
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [c29a26f]
77
+ - @ai-sdk/provider-utils@5.0.0-beta.10
78
+ - @ai-sdk/provider@4.0.0-beta.6
79
+
80
+ ## 4.0.0-beta.30
81
+
82
+ ### Patch Changes
83
+
84
+ - 4552cbf: chore(provider/gateway): update gateway model settings files
85
+
86
+ ## 4.0.0-beta.29
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [2e17091]
91
+ - @ai-sdk/provider-utils@5.0.0-beta.9
92
+
93
+ ## 4.0.0-beta.28
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies [986c6fd]
98
+ - Updated dependencies [493295c]
99
+ - @ai-sdk/provider-utils@5.0.0-beta.8
100
+
101
+ ## 4.0.0-beta.27
102
+
103
+ ### Patch Changes
104
+
105
+ - 70a9aae: feat (provider/gateway): add disallowPromptTraining gateway provider option
106
+
107
+ ## 4.0.0-beta.26
108
+
109
+ ### Patch Changes
110
+
111
+ - 294cbe7: chore(provider/gateway): update gateway model settings files
112
+
113
+ ## 4.0.0-beta.25
114
+
115
+ ### Patch Changes
116
+
117
+ - 435895b: feat (provider/gateway): add get-generation support
118
+
119
+ ## 4.0.0-beta.24
120
+
121
+ ### Patch Changes
122
+
123
+ - d30466c: feat (provider/gateway): add spend reporting support
124
+
125
+ ## 4.0.0-beta.23
126
+
127
+ ### Patch Changes
128
+
129
+ - 4ec78cd: chore(provider/gateway): rename GatewayLanguageModelOptions back to GatewayProviderOptions
130
+
131
+ ## 4.0.0-beta.22
132
+
133
+ ### Patch Changes
134
+
135
+ - 7ceff62: chore(provider/gateway): update gateway model settings files
136
+
137
+ ## 4.0.0-beta.21
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies [1f509d4]
142
+ - @ai-sdk/provider-utils@5.0.0-beta.7
143
+ - @ai-sdk/provider@4.0.0-beta.5
144
+
145
+ ## 4.0.0-beta.20
146
+
147
+ ### Patch Changes
148
+
149
+ - 4f91b5d: chore(provider/xai): update Grok 4.20 model IDs to their non-beta versions
150
+
151
+ ## 4.0.0-beta.19
152
+
153
+ ### Patch Changes
154
+
155
+ - 72889f8: chore(provider/gateway): update gateway model settings files
156
+
157
+ ## 4.0.0-beta.18
158
+
159
+ ### Patch Changes
160
+
161
+ - 165b97a: chore(provider/gateway): update gateway model settings files
162
+
163
+ ## 4.0.0-beta.17
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies [3887c70]
168
+ - @ai-sdk/provider-utils@5.0.0-beta.6
169
+ - @ai-sdk/provider@4.0.0-beta.4
170
+
171
+ ## 4.0.0-beta.16
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [776b617]
176
+ - @ai-sdk/provider-utils@5.0.0-beta.5
177
+ - @ai-sdk/provider@4.0.0-beta.3
178
+
179
+ ## 4.0.0-beta.15
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [61753c3]
184
+ - @ai-sdk/provider-utils@5.0.0-beta.4
185
+
186
+ ## 4.0.0-beta.14
187
+
188
+ ### Patch Changes
189
+
190
+ - ead9144: chore(provider/gateway): update gateway model settings files
191
+
192
+ ## 4.0.0-beta.13
193
+
194
+ ### Patch Changes
195
+
196
+ - 2095655: chore(provider/gateway): update gateway model settings files
197
+
198
+ ## 4.0.0-beta.12
199
+
200
+ ### Patch Changes
201
+
202
+ - Updated dependencies [f7d4f01]
203
+ - @ai-sdk/provider-utils@5.0.0-beta.3
204
+ - @ai-sdk/provider@4.0.0-beta.2
205
+
206
+ ## 4.0.0-beta.11
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [5c2a5a2]
211
+ - @ai-sdk/provider@4.0.0-beta.1
212
+ - @ai-sdk/provider-utils@5.0.0-beta.2
213
+
214
+ ## 4.0.0-beta.10
215
+
216
+ ### Patch Changes
217
+
218
+ - 4d6ab9a: chore(provider/gateway): update gateway model settings files
219
+
220
+ ## 4.0.0-beta.9
221
+
222
+ ### Patch Changes
223
+
224
+ - 980f777: chore(provider/gateway): update gateway model settings files
225
+ - 7185ba2: bump `@vercel/oidc` dependency to 3.2.0
226
+
227
+ ## 4.0.0-beta.8
228
+
229
+ ### Patch Changes
230
+
231
+ - 4adc485: chore(provider/gateway): update gateway model settings files
232
+
233
+ ## 4.0.0-beta.7
234
+
235
+ ### Patch Changes
236
+
237
+ - e046ea3: chore(provider/gateway): update gateway model settings files
238
+
239
+ ## 4.0.0-beta.6
240
+
241
+ ### Patch Changes
242
+
243
+ - 82288b0: feat(provider/google): add `gemini-embedding-2-preview` and fix multimodal embedding support with `embedMany`
244
+
245
+ ## 4.0.0-beta.5
246
+
247
+ ### Patch Changes
248
+
249
+ - aa5a583: chore(provider/xai): remove obsolete Grok 2 models now that they are shut down in their API
250
+
3
251
  ## 4.0.0-beta.4
4
252
 
5
253
  ### Patch Changes
@@ -495,13 +743,13 @@
495
743
  Before
496
744
 
497
745
  ```ts
498
- model.textEmbeddingModel('my-model-id');
746
+ model.textEmbeddingModel("my-model-id");
499
747
  ```
500
748
 
501
749
  After
502
750
 
503
751
  ```ts
504
- model.embeddingModel('my-model-id');
752
+ model.embeddingModel("my-model-id");
505
753
  ```
506
754
 
507
755
  - aaf5ebf: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete
@@ -783,13 +1031,13 @@
783
1031
  Before
784
1032
 
785
1033
  ```ts
786
- model.textEmbeddingModel('my-model-id');
1034
+ model.textEmbeddingModel("my-model-id");
787
1035
  ```
788
1036
 
789
1037
  After
790
1038
 
791
1039
  ```ts
792
- model.embeddingModel('my-model-id');
1040
+ model.embeddingModel("my-model-id");
793
1041
  ```
794
1042
 
795
1043
  - Updated dependencies [8d9e8ad]
package/dist/index.d.mts 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-2-vision' | '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-opus' | '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' | (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' | '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,7 +551,7 @@ 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;
438
557
  user?: string | undefined;
@@ -440,11 +559,14 @@ declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
440
559
  models?: string[] | undefined;
441
560
  byok?: Record<string, Record<string, unknown>[]> | undefined;
442
561
  zeroDataRetention?: boolean | undefined;
562
+ disallowPromptTraining?: boolean | undefined;
563
+ hipaaCompliant?: boolean | undefined;
564
+ quotaEntityId?: string | undefined;
443
565
  providerTimeouts?: {
444
566
  byok?: Record<string, number> | undefined;
445
567
  } | undefined;
446
568
  }>;
447
- type GatewayLanguageModelOptions = InferSchema<typeof gatewayLanguageModelOptions>;
569
+ type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
448
570
 
449
571
  declare const symbol$6: unique symbol;
450
572
  declare abstract class GatewayError extends Error {
@@ -599,4 +721,4 @@ declare class GatewayResponseError extends GatewayError {
599
721
  static isInstance(error: unknown): error is GatewayResponseError;
600
722
  }
601
723
 
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 };
724
+ 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 };