@ai-sdk/gateway 4.0.0-beta.3 → 4.0.0-beta.30

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,182 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
+ ## 4.0.0-beta.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 4552cbf: chore(provider/gateway): update gateway model settings files
8
+
9
+ ## 4.0.0-beta.29
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [2e17091]
14
+ - @ai-sdk/provider-utils@5.0.0-beta.9
15
+
16
+ ## 4.0.0-beta.28
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [986c6fd]
21
+ - Updated dependencies [493295c]
22
+ - @ai-sdk/provider-utils@5.0.0-beta.8
23
+
24
+ ## 4.0.0-beta.27
25
+
26
+ ### Patch Changes
27
+
28
+ - 70a9aae: feat (provider/gateway): add disallowPromptTraining gateway provider option
29
+
30
+ ## 4.0.0-beta.26
31
+
32
+ ### Patch Changes
33
+
34
+ - 294cbe7: chore(provider/gateway): update gateway model settings files
35
+
36
+ ## 4.0.0-beta.25
37
+
38
+ ### Patch Changes
39
+
40
+ - 435895b: feat (provider/gateway): add get-generation support
41
+
42
+ ## 4.0.0-beta.24
43
+
44
+ ### Patch Changes
45
+
46
+ - d30466c: feat (provider/gateway): add spend reporting support
47
+
48
+ ## 4.0.0-beta.23
49
+
50
+ ### Patch Changes
51
+
52
+ - 4ec78cd: chore(provider/gateway): rename GatewayLanguageModelOptions back to GatewayProviderOptions
53
+
54
+ ## 4.0.0-beta.22
55
+
56
+ ### Patch Changes
57
+
58
+ - 7ceff62: chore(provider/gateway): update gateway model settings files
59
+
60
+ ## 4.0.0-beta.21
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [1f509d4]
65
+ - @ai-sdk/provider-utils@5.0.0-beta.7
66
+ - @ai-sdk/provider@4.0.0-beta.5
67
+
68
+ ## 4.0.0-beta.20
69
+
70
+ ### Patch Changes
71
+
72
+ - 4f91b5d: chore(provider/xai): update Grok 4.20 model IDs to their non-beta versions
73
+
74
+ ## 4.0.0-beta.19
75
+
76
+ ### Patch Changes
77
+
78
+ - 72889f8: chore(provider/gateway): update gateway model settings files
79
+
80
+ ## 4.0.0-beta.18
81
+
82
+ ### Patch Changes
83
+
84
+ - 165b97a: chore(provider/gateway): update gateway model settings files
85
+
86
+ ## 4.0.0-beta.17
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [3887c70]
91
+ - @ai-sdk/provider-utils@5.0.0-beta.6
92
+ - @ai-sdk/provider@4.0.0-beta.4
93
+
94
+ ## 4.0.0-beta.16
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [776b617]
99
+ - @ai-sdk/provider-utils@5.0.0-beta.5
100
+ - @ai-sdk/provider@4.0.0-beta.3
101
+
102
+ ## 4.0.0-beta.15
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [61753c3]
107
+ - @ai-sdk/provider-utils@5.0.0-beta.4
108
+
109
+ ## 4.0.0-beta.14
110
+
111
+ ### Patch Changes
112
+
113
+ - ead9144: chore(provider/gateway): update gateway model settings files
114
+
115
+ ## 4.0.0-beta.13
116
+
117
+ ### Patch Changes
118
+
119
+ - 2095655: chore(provider/gateway): update gateway model settings files
120
+
121
+ ## 4.0.0-beta.12
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [f7d4f01]
126
+ - @ai-sdk/provider-utils@5.0.0-beta.3
127
+ - @ai-sdk/provider@4.0.0-beta.2
128
+
129
+ ## 4.0.0-beta.11
130
+
131
+ ### Patch Changes
132
+
133
+ - Updated dependencies [5c2a5a2]
134
+ - @ai-sdk/provider@4.0.0-beta.1
135
+ - @ai-sdk/provider-utils@5.0.0-beta.2
136
+
137
+ ## 4.0.0-beta.10
138
+
139
+ ### Patch Changes
140
+
141
+ - 4d6ab9a: chore(provider/gateway): update gateway model settings files
142
+
143
+ ## 4.0.0-beta.9
144
+
145
+ ### Patch Changes
146
+
147
+ - 980f777: chore(provider/gateway): update gateway model settings files
148
+ - 7185ba2: bump `@vercel/oidc` dependency to 3.2.0
149
+
150
+ ## 4.0.0-beta.8
151
+
152
+ ### Patch Changes
153
+
154
+ - 4adc485: chore(provider/gateway): update gateway model settings files
155
+
156
+ ## 4.0.0-beta.7
157
+
158
+ ### Patch Changes
159
+
160
+ - e046ea3: chore(provider/gateway): update gateway model settings files
161
+
162
+ ## 4.0.0-beta.6
163
+
164
+ ### Patch Changes
165
+
166
+ - 82288b0: feat(provider/google): add `gemini-embedding-2-preview` and fix multimodal embedding support with `embedMany`
167
+
168
+ ## 4.0.0-beta.5
169
+
170
+ ### Patch Changes
171
+
172
+ - aa5a583: chore(provider/xai): remove obsolete Grok 2 models now that they are shut down in their API
173
+
174
+ ## 4.0.0-beta.4
175
+
176
+ ### Patch Changes
177
+
178
+ - f32d84a: chore(provider/gateway): update gateway model settings files
179
+
3
180
  ## 4.0.0-beta.3
4
181
 
5
182
  ### Patch Changes
@@ -489,13 +666,13 @@
489
666
  Before
490
667
 
491
668
  ```ts
492
- model.textEmbeddingModel('my-model-id');
669
+ model.textEmbeddingModel("my-model-id");
493
670
  ```
494
671
 
495
672
  After
496
673
 
497
674
  ```ts
498
- model.embeddingModel('my-model-id');
675
+ model.embeddingModel("my-model-id");
499
676
  ```
500
677
 
501
678
  - aaf5ebf: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete
@@ -777,13 +954,13 @@
777
954
  Before
778
955
 
779
956
  ```ts
780
- model.textEmbeddingModel('my-model-id');
957
+ model.textEmbeddingModel("my-model-id");
781
958
  ```
782
959
 
783
960
  After
784
961
 
785
962
  ```ts
786
- model.embeddingModel('my-model-id');
963
+ model.embeddingModel("my-model-id");
787
964
  ```
788
965
 
789
966
  - Updated dependencies [8d9e8ad]
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { LanguageModelV3, ProviderV3, EmbeddingModelV3, ImageModelV3, Experimental_VideoModelV3, TypeValidationError } from '@ai-sdk/provider';
1
+ import { LanguageModelV4, ProviderV4, EmbeddingModelV4, ImageModelV4, Experimental_VideoModelV4, 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' | '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-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' | '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-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' | 'kwaipilot/kat-coder-pro-v2' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | '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-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-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-5v-turbo' | (string & {});
6
6
 
7
7
  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
8
 
@@ -52,7 +52,7 @@ interface GatewayLanguageModelEntry {
52
52
  */
53
53
  modelType?: 'language' | 'embedding' | 'image' | 'video' | null;
54
54
  }
55
- type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
55
+ type GatewayLanguageModelSpecification = Pick<LanguageModelV4, 'specificationVersion' | 'provider' | 'modelId'>;
56
56
 
57
57
  interface GatewayFetchMetadataResponse {
58
58
  models: GatewayLanguageModelEntry[];
@@ -64,9 +64,108 @@ interface GatewayCreditsResponse {
64
64
  totalUsed: string;
65
65
  }
66
66
 
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 & {});
67
+ interface GatewaySpendReportParams {
68
+ /** Start date in YYYY-MM-DD format (inclusive) */
69
+ startDate: string;
70
+ /** End date in YYYY-MM-DD format (inclusive) */
71
+ endDate: string;
72
+ /** Primary aggregation dimension. Defaults to 'day'. */
73
+ groupBy?: 'day' | 'user' | 'model' | 'tag' | 'provider' | 'credential_type';
74
+ /** Time granularity when groupBy is 'day'. */
75
+ datePart?: 'day' | 'hour';
76
+ /** Filter to a specific user's spend. */
77
+ userId?: string;
78
+ /** Filter to a specific model (e.g. 'anthropic/claude-sonnet-4.5'). */
79
+ model?: string;
80
+ /** Filter to a specific provider (e.g. 'anthropic'). */
81
+ provider?: string;
82
+ /** Filter to BYOK or system credentials. */
83
+ credentialType?: 'byok' | 'system';
84
+ /** Filter to requests with these tags. */
85
+ tags?: string[];
86
+ }
87
+ interface GatewaySpendReportRow {
88
+ /** Date string (present when groupBy is 'day') */
89
+ day?: string;
90
+ /** Hour timestamp (present when groupBy is 'day' and datePart is 'hour') */
91
+ hour?: string;
92
+ /** User identifier (present when groupBy is 'user') */
93
+ user?: string;
94
+ /** Model identifier (present when groupBy is 'model') */
95
+ model?: string;
96
+ /** Tag value (present when groupBy is 'tag') */
97
+ tag?: string;
98
+ /** Provider name (present when groupBy is 'provider') */
99
+ provider?: string;
100
+ /** Credential type (present when groupBy is 'credential_type') */
101
+ credentialType?: 'byok' | 'system';
102
+ /** Total cost in USD */
103
+ totalCost: number;
104
+ /** Market cost in USD */
105
+ marketCost?: number;
106
+ /** Number of input tokens */
107
+ inputTokens?: number;
108
+ /** Number of output tokens */
109
+ outputTokens?: number;
110
+ /** Number of cached input tokens */
111
+ cachedInputTokens?: number;
112
+ /** Number of cache creation input tokens */
113
+ cacheCreationInputTokens?: number;
114
+ /** Number of reasoning tokens */
115
+ reasoningTokens?: number;
116
+ /** Number of requests */
117
+ requestCount?: number;
118
+ }
119
+ interface GatewaySpendReportResponse {
120
+ results: GatewaySpendReportRow[];
121
+ }
68
122
 
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 & {});
123
+ interface GatewayGenerationInfoParams {
124
+ /** The generation ID to look up (format: gen_<ulid>) */
125
+ id: string;
126
+ }
127
+ interface GatewayGenerationInfo {
128
+ /** The generation ID */
129
+ id: string;
130
+ /** Total cost in USD */
131
+ totalCost: number;
132
+ /** Upstream inference cost in USD (BYOK only) */
133
+ upstreamInferenceCost: number;
134
+ /** Usage cost in USD (same as totalCost) */
135
+ usage: number;
136
+ /** ISO 8601 timestamp when the generation was created */
137
+ createdAt: string;
138
+ /** Model identifier */
139
+ model: string;
140
+ /** Whether BYOK credentials were used */
141
+ isByok: boolean;
142
+ /** Provider that served this generation */
143
+ providerName: string;
144
+ /** Whether streaming was used */
145
+ streamed: boolean;
146
+ /** Finish reason (e.g. 'stop') */
147
+ finishReason: string;
148
+ /** Time to first token in milliseconds */
149
+ latency: number;
150
+ /** Total generation time in milliseconds */
151
+ generationTime: number;
152
+ /** Number of prompt tokens */
153
+ promptTokens: number;
154
+ /** Number of completion tokens */
155
+ completionTokens: number;
156
+ /** Reasoning tokens used */
157
+ reasoningTokens: number;
158
+ /** Cached tokens used */
159
+ cachedTokens: number;
160
+ /** Cache creation input tokens */
161
+ cacheCreationTokens: number;
162
+ /** Billable web search calls */
163
+ billableWebSearchCalls: number;
164
+ }
165
+
166
+ 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 & {});
167
+
168
+ 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
169
 
71
170
  interface PerplexitySearchConfig {
72
171
  /**
@@ -194,7 +293,7 @@ interface PerplexitySearchInput {
194
293
  search_recency_filter?: 'day' | 'week' | 'month' | 'year';
195
294
  }
196
295
  type PerplexitySearchOutput = PerplexitySearchResponse | PerplexitySearchError;
197
- declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<PerplexitySearchInput, PerplexitySearchOutput, PerplexitySearchConfig>;
296
+ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<PerplexitySearchInput, PerplexitySearchOutput, PerplexitySearchConfig, {}>;
198
297
 
199
298
  interface ParallelSearchSourcePolicy {
200
299
  /**
@@ -327,7 +426,7 @@ interface ParallelSearchInput {
327
426
  };
328
427
  }
329
428
  type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
330
- declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
429
+ declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig, {}>;
331
430
 
332
431
  /**
333
432
  * Gateway-specific provider-defined tools.
@@ -352,16 +451,16 @@ declare const gatewayTools: {
352
451
  perplexitySearch: (config?: PerplexitySearchConfig) => ReturnType<typeof perplexitySearchToolFactory>;
353
452
  };
354
453
 
355
- interface GatewayProvider extends ProviderV3 {
356
- (modelId: GatewayModelId): LanguageModelV3;
454
+ interface GatewayProvider extends ProviderV4 {
455
+ (modelId: GatewayModelId): LanguageModelV4;
357
456
  /**
358
457
  * Creates a model for text generation.
359
458
  */
360
- chat(modelId: GatewayModelId): LanguageModelV3;
459
+ chat(modelId: GatewayModelId): LanguageModelV4;
361
460
  /**
362
461
  * Creates a model for text generation.
363
462
  */
364
- languageModel(modelId: GatewayModelId): LanguageModelV3;
463
+ languageModel(modelId: GatewayModelId): LanguageModelV4;
365
464
  /**
366
465
  * Returns available providers and models for use with the remote provider.
367
466
  */
@@ -370,34 +469,44 @@ interface GatewayProvider extends ProviderV3 {
370
469
  * Returns credit information for the authenticated user.
371
470
  */
372
471
  getCredits(): Promise<GatewayCreditsResponse>;
472
+ /**
473
+ * Returns a spend report with cost, token, and request count data,
474
+ * aggregated by the specified dimension.
475
+ */
476
+ getSpendReport(params: GatewaySpendReportParams): Promise<GatewaySpendReportResponse>;
477
+ /**
478
+ * Returns detailed information about a specific generation by its ID,
479
+ * including cost, token usage, latency, and provider details.
480
+ */
481
+ getGenerationInfo(params: GatewayGenerationInfoParams): Promise<GatewayGenerationInfo>;
373
482
  /**
374
483
  * Creates a model for generating text embeddings.
375
484
  */
376
- embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
485
+ embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
377
486
  /**
378
487
  * Creates a model for generating text embeddings.
379
488
  */
380
- embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
489
+ embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
381
490
  /**
382
491
  * @deprecated Use `embeddingModel` instead.
383
492
  */
384
- textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
493
+ textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
385
494
  /**
386
495
  * Creates a model for generating images.
387
496
  */
388
- image(modelId: GatewayImageModelId): ImageModelV3;
497
+ image(modelId: GatewayImageModelId): ImageModelV4;
389
498
  /**
390
499
  * Creates a model for generating images.
391
500
  */
392
- imageModel(modelId: GatewayImageModelId): ImageModelV3;
501
+ imageModel(modelId: GatewayImageModelId): ImageModelV4;
393
502
  /**
394
503
  * Creates a model for generating videos.
395
504
  */
396
- video(modelId: GatewayVideoModelId): Experimental_VideoModelV3;
505
+ video(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
397
506
  /**
398
507
  * Creates a model for generating videos.
399
508
  */
400
- videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV3;
509
+ videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
401
510
  /**
402
511
  * Gateway-specific tools executed server-side.
403
512
  */
@@ -432,7 +541,7 @@ interface GatewayProviderSettings {
432
541
  declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
433
542
  declare const gateway: GatewayProvider;
434
543
 
435
- declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
544
+ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
436
545
  only?: string[] | undefined;
437
546
  order?: string[] | undefined;
438
547
  user?: string | undefined;
@@ -440,11 +549,12 @@ declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
440
549
  models?: string[] | undefined;
441
550
  byok?: Record<string, Record<string, unknown>[]> | undefined;
442
551
  zeroDataRetention?: boolean | undefined;
552
+ disallowPromptTraining?: boolean | undefined;
443
553
  providerTimeouts?: {
444
554
  byok?: Record<string, number> | undefined;
445
555
  } | undefined;
446
556
  }>;
447
- type GatewayLanguageModelOptions = InferSchema<typeof gatewayLanguageModelOptions>;
557
+ type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
448
558
 
449
559
  declare const symbol$6: unique symbol;
450
560
  declare abstract class GatewayError extends Error {
@@ -599,4 +709,4 @@ declare class GatewayResponseError extends GatewayError {
599
709
  static isInstance(error: unknown): error is GatewayResponseError;
600
710
  }
601
711
 
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 };
712
+ 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, GatewayResponseError, type GatewaySpendReportParams, type GatewaySpendReportResponse, type GatewaySpendReportRow, type GatewayVideoModelId, createGatewayProvider as createGateway, createGatewayProvider, gateway };