@ai-sdk/gateway 3.0.125 → 3.0.127

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,18 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
+ ## 3.0.127
4
+
5
+ ### Patch Changes
6
+
7
+ - 3851e29: Backport: chore(provider/gateway): update gateway model settings files
8
+ - 2a91a17: feat(provider/anthropic): add support for `claude-fable-5` and the `fallbacks` API parameter
9
+
10
+ ## 3.0.126
11
+
12
+ ### Patch Changes
13
+
14
+ - ff16d3b: feat(gateway): add GatewayFailedDependencyError (424)
15
+
3
16
  ## 3.0.125
4
17
 
5
18
  ### 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/qwen-3.6-max-preview' | '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-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | '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' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | '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' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | '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' | 'minimax/minimax-m3' | '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-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | '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-5.5' | 'openai/gpt-5.5-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' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | '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-4.3' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-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 & {});
5
+ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | '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-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-fable-5' | '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-opus-4.7' | 'anthropic/claude-opus-4.8' | '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' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | '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' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | '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' | 'minimax/minimax-m3' | '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-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | '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-5.5' | 'openai/gpt-5.5-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' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | '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-4.3' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-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
6
 
7
7
  type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
8
8
 
@@ -572,9 +572,9 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
572
572
  }>;
573
573
  type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
574
574
 
575
- declare const symbol$6: unique symbol;
575
+ declare const symbol$7: unique symbol;
576
576
  declare abstract class GatewayError extends Error {
577
- private readonly [symbol$6];
577
+ private readonly [symbol$7];
578
578
  abstract readonly name: string;
579
579
  abstract readonly type: string;
580
580
  readonly statusCode: number;
@@ -608,12 +608,12 @@ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
608
608
  }>;
609
609
  type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
610
610
 
611
- declare const symbol$5: unique symbol;
611
+ declare const symbol$6: unique symbol;
612
612
  /**
613
613
  * Authentication failed - invalid API key or OIDC token
614
614
  */
615
615
  declare class GatewayAuthenticationError extends GatewayError {
616
- private readonly [symbol$5];
616
+ private readonly [symbol$6];
617
617
  readonly name = "GatewayAuthenticationError";
618
618
  readonly type = "authentication_error";
619
619
  constructor({ message, statusCode, cause, generationId, }?: {
@@ -636,6 +636,25 @@ declare class GatewayAuthenticationError extends GatewayError {
636
636
  }): GatewayAuthenticationError;
637
637
  }
638
638
 
639
+ declare const symbol$5: unique symbol;
640
+ /**
641
+ * The request could not be fulfilled because a dependency it relied on was not
642
+ * available on the credentials or provider used to serve it (HTTP 424). Not
643
+ * retryable — the caller must change the request.
644
+ */
645
+ declare class GatewayFailedDependencyError extends GatewayError {
646
+ private readonly [symbol$5];
647
+ readonly name = "GatewayFailedDependencyError";
648
+ readonly type = "failed_dependency";
649
+ constructor({ message, statusCode, cause, generationId, }?: {
650
+ message?: string;
651
+ statusCode?: number;
652
+ cause?: unknown;
653
+ generationId?: string;
654
+ });
655
+ static isInstance(error: unknown): error is GatewayFailedDependencyError;
656
+ }
657
+
639
658
  declare const symbol$4: unique symbol;
640
659
  /**
641
660
  * Internal server error from the Gateway
@@ -727,4 +746,4 @@ declare class GatewayResponseError extends GatewayError {
727
746
  static isInstance(error: unknown): error is GatewayResponseError;
728
747
  }
729
748
 
730
- 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 };
749
+ export { GatewayAuthenticationError, type GatewayCreditsResponse, GatewayError, type GatewayErrorResponse, GatewayFailedDependencyError, 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 };
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/qwen-3.6-max-preview' | '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-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | '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' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | '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' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | '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' | 'minimax/minimax-m3' | '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-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | '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-5.5' | 'openai/gpt-5.5-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' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | '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-4.3' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-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 & {});
5
+ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | '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-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-fable-5' | '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-opus-4.7' | 'anthropic/claude-opus-4.8' | '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' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | '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' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-preview' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'interfaze/interfaze-beta' | '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' | 'minimax/minimax-m3' | '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-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-thinking-turbo' | 'moonshotai/kimi-k2-turbo' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | '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-5.5' | 'openai/gpt-5.5-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' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | '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-4.3' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2-flash' | 'xiaomi/mimo-v2-pro' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-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
6
 
7
7
  type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
8
8
 
@@ -572,9 +572,9 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
572
572
  }>;
573
573
  type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
574
574
 
575
- declare const symbol$6: unique symbol;
575
+ declare const symbol$7: unique symbol;
576
576
  declare abstract class GatewayError extends Error {
577
- private readonly [symbol$6];
577
+ private readonly [symbol$7];
578
578
  abstract readonly name: string;
579
579
  abstract readonly type: string;
580
580
  readonly statusCode: number;
@@ -608,12 +608,12 @@ declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazySchema<{
608
608
  }>;
609
609
  type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
610
610
 
611
- declare const symbol$5: unique symbol;
611
+ declare const symbol$6: unique symbol;
612
612
  /**
613
613
  * Authentication failed - invalid API key or OIDC token
614
614
  */
615
615
  declare class GatewayAuthenticationError extends GatewayError {
616
- private readonly [symbol$5];
616
+ private readonly [symbol$6];
617
617
  readonly name = "GatewayAuthenticationError";
618
618
  readonly type = "authentication_error";
619
619
  constructor({ message, statusCode, cause, generationId, }?: {
@@ -636,6 +636,25 @@ declare class GatewayAuthenticationError extends GatewayError {
636
636
  }): GatewayAuthenticationError;
637
637
  }
638
638
 
639
+ declare const symbol$5: unique symbol;
640
+ /**
641
+ * The request could not be fulfilled because a dependency it relied on was not
642
+ * available on the credentials or provider used to serve it (HTTP 424). Not
643
+ * retryable — the caller must change the request.
644
+ */
645
+ declare class GatewayFailedDependencyError extends GatewayError {
646
+ private readonly [symbol$5];
647
+ readonly name = "GatewayFailedDependencyError";
648
+ readonly type = "failed_dependency";
649
+ constructor({ message, statusCode, cause, generationId, }?: {
650
+ message?: string;
651
+ statusCode?: number;
652
+ cause?: unknown;
653
+ generationId?: string;
654
+ });
655
+ static isInstance(error: unknown): error is GatewayFailedDependencyError;
656
+ }
657
+
639
658
  declare const symbol$4: unique symbol;
640
659
  /**
641
660
  * Internal server error from the Gateway
@@ -727,4 +746,4 @@ declare class GatewayResponseError extends GatewayError {
727
746
  static isInstance(error: unknown): error is GatewayResponseError;
728
747
  }
729
748
 
730
- 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 };
749
+ export { GatewayAuthenticationError, type GatewayCreditsResponse, GatewayError, type GatewayErrorResponse, GatewayFailedDependencyError, 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 };
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __export = (target, all) => {
7
- for (var name8 in all)
8
- __defProp(target, name8, { get: all[name8], enumerable: true });
7
+ for (var name9 in all)
8
+ __defProp(target, name9, { get: all[name9], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
11
  if (from && typeof from === "object" || typeof from === "function") {
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  GatewayAuthenticationError: () => GatewayAuthenticationError,
24
24
  GatewayError: () => GatewayError,
25
+ GatewayFailedDependencyError: () => GatewayFailedDependencyError,
25
26
  GatewayInternalServerError: () => GatewayInternalServerError,
26
27
  GatewayInvalidRequestError: () => GatewayInvalidRequestError,
27
28
  GatewayModelNotFoundError: () => GatewayModelNotFoundError,
@@ -245,12 +246,35 @@ var GatewayInternalServerError = class extends (_b6 = GatewayError, _a6 = symbol
245
246
  }
246
247
  };
247
248
 
248
- // src/errors/gateway-response-error.ts
249
- var name6 = "GatewayResponseError";
249
+ // src/errors/gateway-failed-dependency-error.ts
250
+ var name6 = "GatewayFailedDependencyError";
250
251
  var marker7 = `vercel.ai.gateway.error.${name6}`;
251
252
  var symbol7 = Symbol.for(marker7);
252
253
  var _a7, _b7;
253
- var GatewayResponseError = class extends (_b7 = GatewayError, _a7 = symbol7, _b7) {
254
+ var GatewayFailedDependencyError = class extends (_b7 = GatewayError, _a7 = symbol7, _b7) {
255
+ constructor({
256
+ message = "Failed dependency",
257
+ statusCode = 424,
258
+ cause,
259
+ generationId
260
+ } = {}) {
261
+ super({ message, statusCode, cause, generationId });
262
+ this[_a7] = true;
263
+ // used in isInstance
264
+ this.name = name6;
265
+ this.type = "failed_dependency";
266
+ }
267
+ static isInstance(error) {
268
+ return GatewayError.hasMarker(error) && symbol7 in error;
269
+ }
270
+ };
271
+
272
+ // src/errors/gateway-response-error.ts
273
+ var name7 = "GatewayResponseError";
274
+ var marker8 = `vercel.ai.gateway.error.${name7}`;
275
+ var symbol8 = Symbol.for(marker8);
276
+ var _a8, _b8;
277
+ var GatewayResponseError = class extends (_b8 = GatewayError, _a8 = symbol8, _b8) {
254
278
  constructor({
255
279
  message = "Invalid response from Gateway",
256
280
  statusCode = 502,
@@ -260,15 +284,15 @@ var GatewayResponseError = class extends (_b7 = GatewayError, _a7 = symbol7, _b7
260
284
  generationId
261
285
  } = {}) {
262
286
  super({ message, statusCode, cause, generationId });
263
- this[_a7] = true;
287
+ this[_a8] = true;
264
288
  // used in isInstance
265
- this.name = name6;
289
+ this.name = name7;
266
290
  this.type = "response_error";
267
291
  this.response = response;
268
292
  this.validationError = validationError;
269
293
  }
270
294
  static isInstance(error) {
271
- return GatewayError.hasMarker(error) && symbol7 in error;
295
+ return GatewayError.hasMarker(error) && symbol8 in error;
272
296
  }
273
297
  };
274
298
 
@@ -281,7 +305,7 @@ async function createGatewayErrorFromResponse({
281
305
  cause,
282
306
  authMethod
283
307
  }) {
284
- var _a9;
308
+ var _a10;
285
309
  const parseResult = await (0, import_provider_utils2.safeValidateTypes)({
286
310
  value: response,
287
311
  schema: gatewayErrorResponseSchema
@@ -300,7 +324,7 @@ async function createGatewayErrorFromResponse({
300
324
  const validatedResponse = parseResult.value;
301
325
  const errorType = validatedResponse.error.type;
302
326
  const message = validatedResponse.error.message;
303
- const generationId = (_a9 = validatedResponse.generationId) != null ? _a9 : void 0;
327
+ const generationId = (_a10 = validatedResponse.generationId) != null ? _a10 : void 0;
304
328
  switch (errorType) {
305
329
  case "authentication_error":
306
330
  return GatewayAuthenticationError.createContextualError({
@@ -344,6 +368,13 @@ async function createGatewayErrorFromResponse({
344
368
  cause,
345
369
  generationId
346
370
  });
371
+ case "failed_dependency":
372
+ return new GatewayFailedDependencyError({
373
+ message,
374
+ statusCode,
375
+ cause,
376
+ generationId
377
+ });
347
378
  default:
348
379
  return new GatewayInternalServerError({
349
380
  message,
@@ -383,11 +414,11 @@ function extractApiCallResponse(error) {
383
414
  }
384
415
 
385
416
  // src/errors/gateway-timeout-error.ts
386
- var name7 = "GatewayTimeoutError";
387
- var marker8 = `vercel.ai.gateway.error.${name7}`;
388
- var symbol8 = Symbol.for(marker8);
389
- var _a8, _b8;
390
- var GatewayTimeoutError = class _GatewayTimeoutError extends (_b8 = GatewayError, _a8 = symbol8, _b8) {
417
+ var name8 = "GatewayTimeoutError";
418
+ var marker9 = `vercel.ai.gateway.error.${name8}`;
419
+ var symbol9 = Symbol.for(marker9);
420
+ var _a9, _b9;
421
+ var GatewayTimeoutError = class _GatewayTimeoutError extends (_b9 = GatewayError, _a9 = symbol9, _b9) {
391
422
  constructor({
392
423
  message = "Request timed out",
393
424
  statusCode = 408,
@@ -395,13 +426,13 @@ var GatewayTimeoutError = class _GatewayTimeoutError extends (_b8 = GatewayError
395
426
  generationId
396
427
  } = {}) {
397
428
  super({ message, statusCode, cause, generationId });
398
- this[_a8] = true;
429
+ this[_a9] = true;
399
430
  // used in isInstance
400
- this.name = name7;
431
+ this.name = name8;
401
432
  this.type = "timeout_error";
402
433
  }
403
434
  static isInstance(error) {
404
- return GatewayError.hasMarker(error) && symbol8 in error;
435
+ return GatewayError.hasMarker(error) && symbol9 in error;
405
436
  }
406
437
  /**
407
438
  * Creates a helpful timeout error message with troubleshooting guidance
@@ -441,7 +472,7 @@ function isTimeoutError(error) {
441
472
  return false;
442
473
  }
443
474
  async function asGatewayError(error, authMethod) {
444
- var _a9;
475
+ var _a10;
445
476
  if (GatewayError.isInstance(error)) {
446
477
  return error;
447
478
  }
@@ -460,7 +491,7 @@ async function asGatewayError(error, authMethod) {
460
491
  }
461
492
  return await createGatewayErrorFromResponse({
462
493
  response: extractApiCallResponse(error),
463
- statusCode: (_a9 = error.statusCode) != null ? _a9 : 500,
494
+ statusCode: (_a10 = error.statusCode) != null ? _a10 : 500,
464
495
  defaultMessage: "Gateway request failed",
465
496
  cause: error,
466
497
  authMethod
@@ -954,7 +985,7 @@ var GatewayEmbeddingModel = class {
954
985
  abortSignal,
955
986
  providerOptions
956
987
  }) {
957
- var _a9;
988
+ var _a10;
958
989
  const resolvedHeaders = await (0, import_provider_utils8.resolve)(this.config.headers());
959
990
  try {
960
991
  const {
@@ -985,7 +1016,7 @@ var GatewayEmbeddingModel = class {
985
1016
  });
986
1017
  return {
987
1018
  embeddings: responseBody.embeddings,
988
- usage: (_a9 = responseBody.usage) != null ? _a9 : void 0,
1019
+ usage: (_a10 = responseBody.usage) != null ? _a10 : void 0,
989
1020
  providerMetadata: responseBody.providerMetadata,
990
1021
  response: { headers: responseHeaders, body: rawValue },
991
1022
  warnings: []
@@ -1040,7 +1071,7 @@ var GatewayImageModel = class {
1040
1071
  headers,
1041
1072
  abortSignal
1042
1073
  }) {
1043
- var _a9, _b9, _c, _d;
1074
+ var _a10, _b10, _c, _d;
1044
1075
  const resolvedHeaders = await (0, import_provider_utils9.resolve)(this.config.headers());
1045
1076
  try {
1046
1077
  const {
@@ -1080,7 +1111,7 @@ var GatewayImageModel = class {
1080
1111
  return {
1081
1112
  images: responseBody.images,
1082
1113
  // Always base64 strings from server
1083
- warnings: (_a9 = responseBody.warnings) != null ? _a9 : [],
1114
+ warnings: (_a10 = responseBody.warnings) != null ? _a10 : [],
1084
1115
  providerMetadata: responseBody.providerMetadata,
1085
1116
  response: {
1086
1117
  timestamp: /* @__PURE__ */ new Date(),
@@ -1089,7 +1120,7 @@ var GatewayImageModel = class {
1089
1120
  },
1090
1121
  ...responseBody.usage != null && {
1091
1122
  usage: {
1092
- inputTokens: (_b9 = responseBody.usage.inputTokens) != null ? _b9 : void 0,
1123
+ inputTokens: (_b10 = responseBody.usage.inputTokens) != null ? _b10 : void 0,
1093
1124
  outputTokens: (_c = responseBody.usage.outputTokens) != null ? _c : void 0,
1094
1125
  totalTokens: (_d = responseBody.usage.totalTokens) != null ? _d : void 0
1095
1126
  }
@@ -1178,7 +1209,7 @@ var GatewayVideoModel = class {
1178
1209
  headers,
1179
1210
  abortSignal
1180
1211
  }) {
1181
- var _a9;
1212
+ var _a10;
1182
1213
  const resolvedHeaders = await (0, import_provider_utils10.resolve)(this.config.headers());
1183
1214
  try {
1184
1215
  const { responseHeaders, value: responseBody } = await (0, import_provider_utils10.postJsonToApi)({
@@ -1274,7 +1305,7 @@ var GatewayVideoModel = class {
1274
1305
  });
1275
1306
  return {
1276
1307
  videos: responseBody.videos,
1277
- warnings: (_a9 = responseBody.warnings) != null ? _a9 : [],
1308
+ warnings: (_a10 = responseBody.warnings) != null ? _a10 : [],
1278
1309
  providerMetadata: responseBody.providerMetadata,
1279
1310
  response: {
1280
1311
  timestamp: /* @__PURE__ */ new Date(),
@@ -1622,22 +1653,22 @@ var gatewayTools = {
1622
1653
  var import_oidc = require("@vercel/oidc");
1623
1654
  var import_oidc2 = require("@vercel/oidc");
1624
1655
  async function getVercelRequestId() {
1625
- var _a9;
1626
- return (_a9 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a9["x-vercel-id"];
1656
+ var _a10;
1657
+ return (_a10 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a10["x-vercel-id"];
1627
1658
  }
1628
1659
 
1629
1660
  // src/version.ts
1630
- var VERSION = true ? "3.0.125" : "0.0.0-test";
1661
+ var VERSION = true ? "3.0.127" : "0.0.0-test";
1631
1662
 
1632
1663
  // src/gateway-provider.ts
1633
1664
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
1634
1665
  function createGatewayProvider(options = {}) {
1635
- var _a9, _b9;
1666
+ var _a10, _b10;
1636
1667
  let pendingMetadata = null;
1637
1668
  let metadataCache = null;
1638
- const cacheRefreshMillis = (_a9 = options.metadataCacheRefreshMillis) != null ? _a9 : 1e3 * 60 * 5;
1669
+ const cacheRefreshMillis = (_a10 = options.metadataCacheRefreshMillis) != null ? _a10 : 1e3 * 60 * 5;
1639
1670
  let lastFetchTime = 0;
1640
- const baseURL = (_b9 = (0, import_provider_utils14.withoutTrailingSlash)(options.baseURL)) != null ? _b9 : "https://ai-gateway.vercel.sh/v3/ai";
1671
+ const baseURL = (_b10 = (0, import_provider_utils14.withoutTrailingSlash)(options.baseURL)) != null ? _b10 : "https://ai-gateway.vercel.sh/v3/ai";
1641
1672
  const getHeaders = async () => {
1642
1673
  try {
1643
1674
  const auth = await getGatewayAuthToken(options);
@@ -1697,8 +1728,8 @@ function createGatewayProvider(options = {}) {
1697
1728
  });
1698
1729
  };
1699
1730
  const getAvailableModels = async () => {
1700
- var _a10, _b10, _c;
1701
- const now = (_c = (_b10 = (_a10 = options._internal) == null ? void 0 : _a10.currentDate) == null ? void 0 : _b10.call(_a10).getTime()) != null ? _c : Date.now();
1731
+ var _a11, _b11, _c;
1732
+ const now = (_c = (_b11 = (_a11 = options._internal) == null ? void 0 : _a11.currentDate) == null ? void 0 : _b11.call(_a11).getTime()) != null ? _c : Date.now();
1702
1733
  if (!pendingMetadata || now - lastFetchTime > cacheRefreshMillis) {
1703
1734
  lastFetchTime = now;
1704
1735
  pendingMetadata = new GatewayFetchMetadata({
@@ -1836,6 +1867,7 @@ async function getGatewayAuthToken(options) {
1836
1867
  0 && (module.exports = {
1837
1868
  GatewayAuthenticationError,
1838
1869
  GatewayError,
1870
+ GatewayFailedDependencyError,
1839
1871
  GatewayInternalServerError,
1840
1872
  GatewayInvalidRequestError,
1841
1873
  GatewayModelNotFoundError,