@ai-sdk/gateway 3.0.83 → 3.0.85
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 +12 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/00-ai-gateway.mdx +50 -28
- package/package.json +1 -1
- package/src/gateway-language-model-settings.ts +2 -0
- package/src/gateway-provider-options.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 3.0.85
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 85e476d: feat (provider/gateway): add disallowPromptTraining gateway provider option
|
|
8
|
+
|
|
9
|
+
## 3.0.84
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 70322b4: Backport: chore(provider/gateway): update gateway model settings files
|
|
14
|
+
|
|
3
15
|
## 3.0.83
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV3, ProviderV3, EmbeddingModelV3, ImageModelV3, Experiment
|
|
|
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-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' | '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-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' | (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' | (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
|
|
|
@@ -549,6 +549,7 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
549
549
|
models?: string[] | undefined;
|
|
550
550
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
551
551
|
zeroDataRetention?: boolean | undefined;
|
|
552
|
+
disallowPromptTraining?: boolean | undefined;
|
|
552
553
|
providerTimeouts?: {
|
|
553
554
|
byok?: Record<string, number> | undefined;
|
|
554
555
|
} | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV3, ProviderV3, EmbeddingModelV3, ImageModelV3, Experiment
|
|
|
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-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' | '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-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' | (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' | (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
|
|
|
@@ -549,6 +549,7 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
549
549
|
models?: string[] | undefined;
|
|
550
550
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
551
551
|
zeroDataRetention?: boolean | undefined;
|
|
552
|
+
disallowPromptTraining?: boolean | undefined;
|
|
552
553
|
providerTimeouts?: {
|
|
553
554
|
byok?: Record<string, number> | undefined;
|
|
554
555
|
} | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1525,7 +1525,7 @@ async function getVercelRequestId() {
|
|
|
1525
1525
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
1526
1526
|
|
|
1527
1527
|
// src/version.ts
|
|
1528
|
-
var VERSION = true ? "3.0.
|
|
1528
|
+
var VERSION = true ? "3.0.85" : "0.0.0-test";
|
|
1529
1529
|
|
|
1530
1530
|
// src/gateway-provider.ts
|
|
1531
1531
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/dist/index.mjs
CHANGED
|
@@ -1559,7 +1559,7 @@ async function getVercelRequestId() {
|
|
|
1559
1559
|
import { withUserAgentSuffix } from "@ai-sdk/provider-utils";
|
|
1560
1560
|
|
|
1561
1561
|
// src/version.ts
|
|
1562
|
-
var VERSION = true ? "3.0.
|
|
1562
|
+
var VERSION = true ? "3.0.85" : "0.0.0-test";
|
|
1563
1563
|
|
|
1564
1564
|
// src/gateway-provider.ts
|
|
1565
1565
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/docs/00-ai-gateway.mdx
CHANGED
|
@@ -29,7 +29,7 @@ For most use cases, you can use the AI Gateway directly with a model string:
|
|
|
29
29
|
import { generateText } from 'ai';
|
|
30
30
|
|
|
31
31
|
const { text } = await generateText({
|
|
32
|
-
model: 'openai/gpt-5',
|
|
32
|
+
model: 'openai/gpt-5.4',
|
|
33
33
|
prompt: 'Hello world',
|
|
34
34
|
});
|
|
35
35
|
```
|
|
@@ -39,7 +39,7 @@ const { text } = await generateText({
|
|
|
39
39
|
import { generateText, gateway } from 'ai';
|
|
40
40
|
|
|
41
41
|
const { text } = await generateText({
|
|
42
|
-
model: gateway('openai/gpt-5'),
|
|
42
|
+
model: gateway('openai/gpt-5.4'),
|
|
43
43
|
prompt: 'Hello world',
|
|
44
44
|
});
|
|
45
45
|
```
|
|
@@ -169,7 +169,7 @@ You can create language models using a provider instance. The first argument is
|
|
|
169
169
|
import { generateText } from 'ai';
|
|
170
170
|
|
|
171
171
|
const { text } = await generateText({
|
|
172
|
-
model: 'openai/gpt-5',
|
|
172
|
+
model: 'openai/gpt-5.4',
|
|
173
173
|
prompt: 'Explain quantum computing in simple terms',
|
|
174
174
|
});
|
|
175
175
|
```
|
|
@@ -215,7 +215,7 @@ availableModels.models.forEach(model => {
|
|
|
215
215
|
|
|
216
216
|
// Use any discovered model with plain string
|
|
217
217
|
const { text } = await generateText({
|
|
218
|
-
model: availableModels.models[0].id, // e.g., 'openai/gpt-
|
|
218
|
+
model: availableModels.models[0].id, // e.g., 'openai/gpt-5.4'
|
|
219
219
|
prompt: 'Hello world',
|
|
220
220
|
});
|
|
221
221
|
```
|
|
@@ -326,7 +326,7 @@ It returns a `GatewayGenerationInfo` object with the following fields:
|
|
|
326
326
|
import { generateText } from 'ai';
|
|
327
327
|
|
|
328
328
|
const { text } = await generateText({
|
|
329
|
-
model: 'anthropic/claude-sonnet-4',
|
|
329
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
330
330
|
prompt: 'Write a haiku about programming',
|
|
331
331
|
});
|
|
332
332
|
|
|
@@ -339,7 +339,7 @@ console.log(text);
|
|
|
339
339
|
import { streamText } from 'ai';
|
|
340
340
|
|
|
341
341
|
const { textStream } = await streamText({
|
|
342
|
-
model: 'openai/gpt-5',
|
|
342
|
+
model: 'openai/gpt-5.4',
|
|
343
343
|
prompt: 'Explain the benefits of serverless architecture',
|
|
344
344
|
});
|
|
345
345
|
|
|
@@ -381,7 +381,7 @@ import { generateText, stepCountIs } from 'ai';
|
|
|
381
381
|
import { openai } from '@ai-sdk/openai';
|
|
382
382
|
|
|
383
383
|
const result = await generateText({
|
|
384
|
-
model: 'openai/gpt-5-mini',
|
|
384
|
+
model: 'openai/gpt-5.4-mini',
|
|
385
385
|
prompt: 'What is the Vercel AI Gateway?',
|
|
386
386
|
stopWhen: stepCountIs(10),
|
|
387
387
|
tools: {
|
|
@@ -410,7 +410,7 @@ The Perplexity Search tool enables models to search the web using [Perplexity's
|
|
|
410
410
|
import { gateway, generateText } from 'ai';
|
|
411
411
|
|
|
412
412
|
const result = await generateText({
|
|
413
|
-
model: 'openai/gpt-5-nano',
|
|
413
|
+
model: 'openai/gpt-5.4-nano',
|
|
414
414
|
prompt: 'Search for news about AI regulations in January 2025.',
|
|
415
415
|
tools: {
|
|
416
416
|
perplexity_search: gateway.tools.perplexitySearch(),
|
|
@@ -428,7 +428,7 @@ You can also configure the search with optional parameters:
|
|
|
428
428
|
import { gateway, generateText } from 'ai';
|
|
429
429
|
|
|
430
430
|
const result = await generateText({
|
|
431
|
-
model: 'openai/gpt-5-nano',
|
|
431
|
+
model: 'openai/gpt-5.4-nano',
|
|
432
432
|
prompt:
|
|
433
433
|
'Search for news about AI regulations from the first week of January 2025.',
|
|
434
434
|
tools: {
|
|
@@ -482,7 +482,7 @@ The tool works with both `generateText` and `streamText`:
|
|
|
482
482
|
import { gateway, streamText } from 'ai';
|
|
483
483
|
|
|
484
484
|
const result = streamText({
|
|
485
|
-
model: 'openai/gpt-5-nano',
|
|
485
|
+
model: 'openai/gpt-5.4-nano',
|
|
486
486
|
prompt: 'Search for the latest news about AI regulations.',
|
|
487
487
|
tools: {
|
|
488
488
|
perplexity_search: gateway.tools.perplexitySearch(),
|
|
@@ -512,7 +512,7 @@ The Parallel Search tool enables models to search the web using [Parallel AI's S
|
|
|
512
512
|
import { gateway, generateText } from 'ai';
|
|
513
513
|
|
|
514
514
|
const result = await generateText({
|
|
515
|
-
model: 'openai/gpt-5-nano',
|
|
515
|
+
model: 'openai/gpt-5.4-nano',
|
|
516
516
|
prompt: 'Research the latest developments in quantum computing.',
|
|
517
517
|
tools: {
|
|
518
518
|
parallel_search: gateway.tools.parallelSearch(),
|
|
@@ -530,7 +530,7 @@ You can also configure the search with optional parameters:
|
|
|
530
530
|
import { gateway, generateText } from 'ai';
|
|
531
531
|
|
|
532
532
|
const result = await generateText({
|
|
533
|
-
model: 'openai/gpt-5-nano',
|
|
533
|
+
model: 'openai/gpt-5.4-nano',
|
|
534
534
|
prompt: 'Find detailed information about TypeScript 5.0 features.',
|
|
535
535
|
tools: {
|
|
536
536
|
parallel_search: gateway.tools.parallelSearch({
|
|
@@ -591,7 +591,7 @@ The tool works with both `generateText` and `streamText`:
|
|
|
591
591
|
import { gateway, streamText } from 'ai';
|
|
592
592
|
|
|
593
593
|
const result = streamText({
|
|
594
|
-
model: 'openai/gpt-5-nano',
|
|
594
|
+
model: 'openai/gpt-5.4-nano',
|
|
595
595
|
prompt: 'Research the latest AI safety guidelines.',
|
|
596
596
|
tools: {
|
|
597
597
|
parallel_search: gateway.tools.parallelSearch(),
|
|
@@ -622,7 +622,7 @@ import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
|
622
622
|
import { generateText } from 'ai';
|
|
623
623
|
|
|
624
624
|
const { text } = await generateText({
|
|
625
|
-
model: 'openai/gpt-5',
|
|
625
|
+
model: 'openai/gpt-5.4',
|
|
626
626
|
prompt: 'Summarize this document...',
|
|
627
627
|
providerOptions: {
|
|
628
628
|
gateway: {
|
|
@@ -723,7 +723,7 @@ import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
|
723
723
|
import { generateText } from 'ai';
|
|
724
724
|
|
|
725
725
|
const { text } = await generateText({
|
|
726
|
-
model: 'anthropic/claude-sonnet-4',
|
|
726
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
727
727
|
prompt: 'Explain quantum computing',
|
|
728
728
|
providerOptions: {
|
|
729
729
|
gateway: {
|
|
@@ -752,7 +752,7 @@ The following gateway provider options are available:
|
|
|
752
752
|
|
|
753
753
|
Specifies fallback models to use when the primary model fails or is unavailable. The gateway will try the primary model first (specified in the `model` parameter), then try each model in this array in order until one succeeds.
|
|
754
754
|
|
|
755
|
-
Example: `models: ['openai/gpt-5-nano', 'gemini-
|
|
755
|
+
Example: `models: ['openai/gpt-5.4-nano', 'gemini-3-flash-preview']` will try the fallback models in order if the primary model fails.
|
|
756
756
|
|
|
757
757
|
- **user** _string_
|
|
758
758
|
|
|
@@ -780,7 +780,12 @@ The following gateway provider options are available:
|
|
|
780
780
|
|
|
781
781
|
- **zeroDataRetention** _boolean_
|
|
782
782
|
|
|
783
|
-
Restricts routing requests to providers that have zero data retention
|
|
783
|
+
Restricts routing requests to providers that have zero data retention agreements with Vercel for AI Gateway. If there are no providers available for the model with zero data retention, the request will fail. BYOK credentials are skipped when `zeroDataRetention` is set to `true` to ensure that requests are only routed to providers that support ZDR compliance. Request-level ZDR is only available for Vercel Pro and Enterprise plans.
|
|
784
|
+
|
|
785
|
+
- **disallowPromptTraining** _boolean_
|
|
786
|
+
|
|
787
|
+
Restricts routing requests to providers that have agreements with Vercel for AI Gateway to not use prompts for model training. If there are no providers available for the model that disallow prompt training, the request will fail. BYOK credentials are skipped when `disallowPromptTraining` is set to `true` to ensure that requests are only routed to providers that do not train on prompt data.
|
|
788
|
+
|
|
784
789
|
|
|
785
790
|
- **providerTimeouts** _object_
|
|
786
791
|
|
|
@@ -797,7 +802,7 @@ import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
|
797
802
|
import { generateText } from 'ai';
|
|
798
803
|
|
|
799
804
|
const { text } = await generateText({
|
|
800
|
-
model: 'anthropic/claude-sonnet-4',
|
|
805
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
801
806
|
prompt: 'Write a haiku about programming',
|
|
802
807
|
providerOptions: {
|
|
803
808
|
gateway: {
|
|
@@ -817,34 +822,32 @@ import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
|
817
822
|
import { generateText } from 'ai';
|
|
818
823
|
|
|
819
824
|
const { text } = await generateText({
|
|
820
|
-
model: 'openai/gpt-
|
|
825
|
+
model: 'openai/gpt-5.4', // Primary model
|
|
821
826
|
prompt: 'Write a TypeScript haiku',
|
|
822
827
|
providerOptions: {
|
|
823
828
|
gateway: {
|
|
824
|
-
models: ['openai/gpt-5-nano', 'gemini-
|
|
829
|
+
models: ['openai/gpt-5.4-nano', 'gemini-3-flash-preview'], // Fallback models
|
|
825
830
|
} satisfies GatewayProviderOptions,
|
|
826
831
|
},
|
|
827
832
|
});
|
|
828
833
|
|
|
829
834
|
// This will:
|
|
830
|
-
// 1. Try openai/gpt-
|
|
831
|
-
// 2. If it fails, try openai/gpt-5-nano
|
|
832
|
-
// 3. If that fails, try gemini-
|
|
835
|
+
// 1. Try openai/gpt-5.4 first
|
|
836
|
+
// 2. If it fails, try openai/gpt-5.4-nano
|
|
837
|
+
// 3. If that fails, try gemini-3-flash-preview
|
|
833
838
|
// 4. Return the result from the first model that succeeds
|
|
834
839
|
```
|
|
835
840
|
|
|
836
841
|
#### Zero Data Retention Example
|
|
837
842
|
|
|
838
|
-
Set `zeroDataRetention` to true to ensure requests are only routed to providers
|
|
839
|
-
that have zero data retention policies. When `zeroDataRetention` is `false` or not
|
|
840
|
-
specified, there is no enforcement of restricting routing.
|
|
843
|
+
Set `zeroDataRetention` to true to route requests to providers that have zero data retention agreements with Vercel for AI Gateway. If there are no providers available for the model with zero data retention, the request will fail. When `zeroDataRetention` is `false` or not specified, there is no enforcement of restricting routing. BYOK credentials are skipped when `zeroDataRetention` is set to `true` to ensure that requests are only routed to providers that support ZDR compliance. Request-level ZDR is only available for Vercel Pro and Enterprise plans.
|
|
841
844
|
|
|
842
845
|
```ts
|
|
843
846
|
import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
844
847
|
import { generateText } from 'ai';
|
|
845
848
|
|
|
846
849
|
const { text } = await generateText({
|
|
847
|
-
model: 'anthropic/claude-sonnet-4.
|
|
850
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
848
851
|
prompt: 'Analyze this sensitive document...',
|
|
849
852
|
providerOptions: {
|
|
850
853
|
gateway: {
|
|
@@ -854,6 +857,25 @@ const { text } = await generateText({
|
|
|
854
857
|
});
|
|
855
858
|
```
|
|
856
859
|
|
|
860
|
+
#### Disallow Prompt Training Example
|
|
861
|
+
|
|
862
|
+
Set `disallowPromptTraining` to true to route requests to providers that have agreements with Vercel for AI Gateway to not use prompts for model training. If there are no providers available for the model that disallow prompt training, the request will fail. When `disallowPromptTraining` is `false` or not specified, there is no enforcement of restricting routing. BYOK credentials are skipped when `disallowPromptTraining` is set to `true` to ensure that requests are only routed to providers that do not train on prompt data.
|
|
863
|
+
|
|
864
|
+
```ts
|
|
865
|
+
import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
866
|
+
import { generateText } from 'ai';
|
|
867
|
+
|
|
868
|
+
const { text } = await generateText({
|
|
869
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
870
|
+
prompt: 'Analyze this proprietary business data...',
|
|
871
|
+
providerOptions: {
|
|
872
|
+
gateway: {
|
|
873
|
+
disallowPromptTraining: true,
|
|
874
|
+
} satisfies GatewayProviderOptions,
|
|
875
|
+
},
|
|
876
|
+
});
|
|
877
|
+
```
|
|
878
|
+
|
|
857
879
|
### Provider-Specific Options
|
|
858
880
|
|
|
859
881
|
When using provider-specific options through AI Gateway, use the actual provider name (e.g. `anthropic`, `openai`, not `gateway`) as the key:
|
|
@@ -864,7 +886,7 @@ import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
|
864
886
|
import { generateText } from 'ai';
|
|
865
887
|
|
|
866
888
|
const { text } = await generateText({
|
|
867
|
-
model: 'anthropic/claude-sonnet-4',
|
|
889
|
+
model: 'anthropic/claude-sonnet-4.6',
|
|
868
890
|
prompt: 'Explain quantum computing',
|
|
869
891
|
providerOptions: {
|
|
870
892
|
gateway: {
|
package/package.json
CHANGED
|
@@ -61,6 +61,7 @@ export type GatewayModelId =
|
|
|
61
61
|
| 'inception/mercury-2'
|
|
62
62
|
| 'inception/mercury-coder-small'
|
|
63
63
|
| 'kwaipilot/kat-coder-pro-v1'
|
|
64
|
+
| 'kwaipilot/kat-coder-pro-v2'
|
|
64
65
|
| 'meituan/longcat-flash-chat'
|
|
65
66
|
| 'meituan/longcat-flash-thinking'
|
|
66
67
|
| 'meituan/longcat-flash-thinking-2601'
|
|
@@ -105,6 +106,7 @@ export type GatewayModelId =
|
|
|
105
106
|
| 'morph/morph-v3-fast'
|
|
106
107
|
| 'morph/morph-v3-large'
|
|
107
108
|
| 'nvidia/nemotron-3-nano-30b-a3b'
|
|
109
|
+
| 'nvidia/nemotron-3-super-120b-a12b'
|
|
108
110
|
| 'nvidia/nemotron-nano-12b-v2-vl'
|
|
109
111
|
| 'nvidia/nemotron-nano-9b-v2'
|
|
110
112
|
| 'openai/gpt-3.5-turbo'
|
|
@@ -59,6 +59,12 @@ const gatewayProviderOptions = lazySchema(() =>
|
|
|
59
59
|
* used.
|
|
60
60
|
*/
|
|
61
61
|
zeroDataRetention: z.boolean().optional(),
|
|
62
|
+
/**
|
|
63
|
+
* Whether to filter by only providers that do not train on prompt data.
|
|
64
|
+
* When enabled, only providers that have agreements with Vercel AI Gateway
|
|
65
|
+
* to not use prompts for model training will be used.
|
|
66
|
+
*/
|
|
67
|
+
disallowPromptTraining: z.boolean().optional(),
|
|
62
68
|
/**
|
|
63
69
|
* Per-provider timeouts for BYOK credentials in milliseconds.
|
|
64
70
|
* Controls how long to wait for a provider to start responding
|