@shop-os/modelkit 0.19.1 → 0.21.0

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/dist/index.d.cts CHANGED
@@ -171,7 +171,7 @@ type Lifecycle = "active" | "deprecated" | "retired";
171
171
  type Surface = "cowork" | "space_builder";
172
172
  /** @deprecated use Surface[] */
173
173
  type Exposure = Surface[];
174
- type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma" | "fish" | "elevenlabs";
174
+ type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "alibaba" | "luma" | "fish" | "elevenlabs";
175
175
  /** Gemini image safety threshold, per category, sent only when the caller opts in. */
176
176
  type ImageSafetySetting = {
177
177
  category: string;
@@ -856,7 +856,25 @@ interface ModelConstraints {
856
856
  audio?: AudioOutput;
857
857
  /** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
858
858
  prompt?: PromptConventions;
859
+ /**
860
+ * Video rows whose provider bills what the request sends (input video, reference images)
861
+ * on top of what it renders. Read it through `inputBillingOf(row)`, which also covers
862
+ * Seedance (`ark`) rows and data-only rows. Kits before 0.21.0 ignore it.
863
+ */
864
+ inputBilling?: InputBilling;
859
865
  }
866
+ /**
867
+ * How a provider bills a request's inputs. The apps own the rates; this names the rule.
868
+ * - `seedance`: input plus output seconds at the row's video-input rate.
869
+ * - `omni`: input video as input tokens, billed as equivalent output seconds.
870
+ * - `h3-max-reference`: reference image, video and audio tokens past a shared allowance.
871
+ * - `h3-reference`: a fee for each reference image past the fifth.
872
+ * - `grok-input-image`: a fee for each input image, frames included.
873
+ * - `source-video-rate`: the output alone, at the row's video-input rate.
874
+ * - `kling-v4`: output plus max(input, output) seconds at the row's video-input rate.
875
+ * - `input-plus-output`: input plus output seconds at the row's base rate.
876
+ */
877
+ type InputBilling = "seedance" | "omni" | "h3-max-reference" | "h3-reference" | "grok-input-image" | "source-video-rate" | "kling-v4" | "input-plus-output";
860
878
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
861
879
  type JsonPrimitive = string | number | boolean | null;
862
880
  type JsonValue = JsonPrimitive | JsonValue[] | {
@@ -1069,10 +1087,12 @@ interface UsageEvent {
1069
1087
  keySource?: KeySource;
1070
1088
  raw?: unknown;
1071
1089
  }
1072
- type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "elevenlabs" | "cloudflare";
1090
+ type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "alibaba" | "luma" | "fish" | "elevenlabs" | "cloudflare";
1073
1091
  type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
1074
1092
  /** Higgsfield needs the pair; both switch together. */
1075
1093
  higgsfieldSecret?: string;
1094
+ /** Model Studio workspace the `alibaba` key belongs to; its endpoint takes keys of that workspace only. */
1095
+ alibabaWorkspace?: string;
1076
1096
  /** Bedrock runtime credentials for Anthropic models when routing.anthropic = "bedrock". */
1077
1097
  aws?: {
1078
1098
  /** Bedrock region. Must serve the chosen inference profile (us-east-1 for "us"). */
@@ -1122,6 +1142,8 @@ interface AdapterEndpoints {
1122
1142
  ark?: string;
1123
1143
  /** Luma Agents API. Defaults to https://agents.lumalabs.ai. */
1124
1144
  luma?: string;
1145
+ /** Alibaba Model Studio API base (ending in /api/v1). Defaults to the workspace endpoint in US (Virginia). */
1146
+ alibaba?: string;
1125
1147
  /** Fish Audio API. Defaults to https://api.fish.audio. */
1126
1148
  fish?: string;
1127
1149
  /** ElevenLabs API. Defaults to https://api.elevenlabs.io. */
@@ -1246,7 +1268,7 @@ declare function isListed(row: CatalogModel): boolean;
1246
1268
  */
1247
1269
  declare const MODELS: CatalogModel[];
1248
1270
 
1249
- declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "fish", "elevenlabs"];
1271
+ declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "alibaba", "fish", "elevenlabs"];
1250
1272
  declare const SurfaceSchema: z.ZodEnum<{
1251
1273
  cowork: "cowork";
1252
1274
  space_builder: "space_builder";
@@ -1296,6 +1318,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1296
1318
  prodia: "prodia";
1297
1319
  higgsfield: "higgsfield";
1298
1320
  "xai-video": "xai-video";
1321
+ alibaba: "alibaba";
1299
1322
  luma: "luma";
1300
1323
  fish: "fish";
1301
1324
  elevenlabs: "elevenlabs";
@@ -1585,6 +1608,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1585
1608
  }, z.core.$loose>>;
1586
1609
  }, z.core.$loose>>;
1587
1610
  audio: z.ZodOptional<z.ZodUnknown>;
1611
+ inputBilling: z.ZodOptional<z.ZodUnknown>;
1588
1612
  prompt: z.ZodOptional<z.ZodUnknown>;
1589
1613
  }, z.core.$loose>;
1590
1614
  defaults: z.ZodObject<{
@@ -2016,6 +2040,19 @@ declare function resetLiveCatalog(): void;
2016
2040
 
2017
2041
  declare function fileCatalogCache(path: string): CatalogCache;
2018
2042
 
2043
+ /**
2044
+ * The input-billing rule of a row, or null when the provider bills only what it renders. The
2045
+ * row's own `constraints.inputBilling` wins. A live row an older seed wrote, without the field,
2046
+ * takes the kit row of the same id; an `ark` (Seedance) row is `seedance`.
2047
+ */
2048
+ declare function inputBillingOf(row: {
2049
+ id: string;
2050
+ adapter: string;
2051
+ constraints?: unknown;
2052
+ }): InputBilling | null;
2053
+
2054
+ declare const INPUT_BILLINGS: ("seedance" | "omni" | "h3-max-reference" | "h3-reference" | "grok-input-image" | "source-video-rate" | "kling-v4" | "input-plus-output")[];
2055
+
2019
2056
  type OnUnsupported = "error" | "coerce";
2020
2057
  interface ResolveResult<T> {
2021
2058
  request: T;
@@ -2406,6 +2443,9 @@ declare function createModelKit(config: ModelKitConfig, adapters: AdapterRegistr
2406
2443
 
2407
2444
  declare const aiSdkTextAdapter: Adapter;
2408
2445
 
2446
+ /** Alibaba Model Studio direct: Wan 3 and Happy Horse 1.1 video, Qwen Image 3 Pro. */
2447
+ declare const alibabaAdapter: Adapter;
2448
+
2409
2449
  declare const arkAdapter: Adapter;
2410
2450
 
2411
2451
  declare const falAdapter: Adapter;
@@ -2573,4 +2613,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2573
2613
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2574
2614
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2575
2615
 
2576
- export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2616
+ export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_BILLINGS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputBilling, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, alibabaAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, inputBillingOf, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
package/dist/index.d.ts CHANGED
@@ -171,7 +171,7 @@ type Lifecycle = "active" | "deprecated" | "retired";
171
171
  type Surface = "cowork" | "space_builder";
172
172
  /** @deprecated use Surface[] */
173
173
  type Exposure = Surface[];
174
- type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma" | "fish" | "elevenlabs";
174
+ type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "alibaba" | "luma" | "fish" | "elevenlabs";
175
175
  /** Gemini image safety threshold, per category, sent only when the caller opts in. */
176
176
  type ImageSafetySetting = {
177
177
  category: string;
@@ -856,7 +856,25 @@ interface ModelConstraints {
856
856
  audio?: AudioOutput;
857
857
  /** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
858
858
  prompt?: PromptConventions;
859
+ /**
860
+ * Video rows whose provider bills what the request sends (input video, reference images)
861
+ * on top of what it renders. Read it through `inputBillingOf(row)`, which also covers
862
+ * Seedance (`ark`) rows and data-only rows. Kits before 0.21.0 ignore it.
863
+ */
864
+ inputBilling?: InputBilling;
859
865
  }
866
+ /**
867
+ * How a provider bills a request's inputs. The apps own the rates; this names the rule.
868
+ * - `seedance`: input plus output seconds at the row's video-input rate.
869
+ * - `omni`: input video as input tokens, billed as equivalent output seconds.
870
+ * - `h3-max-reference`: reference image, video and audio tokens past a shared allowance.
871
+ * - `h3-reference`: a fee for each reference image past the fifth.
872
+ * - `grok-input-image`: a fee for each input image, frames included.
873
+ * - `source-video-rate`: the output alone, at the row's video-input rate.
874
+ * - `kling-v4`: output plus max(input, output) seconds at the row's video-input rate.
875
+ * - `input-plus-output`: input plus output seconds at the row's base rate.
876
+ */
877
+ type InputBilling = "seedance" | "omni" | "h3-max-reference" | "h3-reference" | "grok-input-image" | "source-video-rate" | "kling-v4" | "input-plus-output";
860
878
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
861
879
  type JsonPrimitive = string | number | boolean | null;
862
880
  type JsonValue = JsonPrimitive | JsonValue[] | {
@@ -1069,10 +1087,12 @@ interface UsageEvent {
1069
1087
  keySource?: KeySource;
1070
1088
  raw?: unknown;
1071
1089
  }
1072
- type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "elevenlabs" | "cloudflare";
1090
+ type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "alibaba" | "luma" | "fish" | "elevenlabs" | "cloudflare";
1073
1091
  type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
1074
1092
  /** Higgsfield needs the pair; both switch together. */
1075
1093
  higgsfieldSecret?: string;
1094
+ /** Model Studio workspace the `alibaba` key belongs to; its endpoint takes keys of that workspace only. */
1095
+ alibabaWorkspace?: string;
1076
1096
  /** Bedrock runtime credentials for Anthropic models when routing.anthropic = "bedrock". */
1077
1097
  aws?: {
1078
1098
  /** Bedrock region. Must serve the chosen inference profile (us-east-1 for "us"). */
@@ -1122,6 +1142,8 @@ interface AdapterEndpoints {
1122
1142
  ark?: string;
1123
1143
  /** Luma Agents API. Defaults to https://agents.lumalabs.ai. */
1124
1144
  luma?: string;
1145
+ /** Alibaba Model Studio API base (ending in /api/v1). Defaults to the workspace endpoint in US (Virginia). */
1146
+ alibaba?: string;
1125
1147
  /** Fish Audio API. Defaults to https://api.fish.audio. */
1126
1148
  fish?: string;
1127
1149
  /** ElevenLabs API. Defaults to https://api.elevenlabs.io. */
@@ -1246,7 +1268,7 @@ declare function isListed(row: CatalogModel): boolean;
1246
1268
  */
1247
1269
  declare const MODELS: CatalogModel[];
1248
1270
 
1249
- declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "fish", "elevenlabs"];
1271
+ declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "alibaba", "fish", "elevenlabs"];
1250
1272
  declare const SurfaceSchema: z.ZodEnum<{
1251
1273
  cowork: "cowork";
1252
1274
  space_builder: "space_builder";
@@ -1296,6 +1318,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1296
1318
  prodia: "prodia";
1297
1319
  higgsfield: "higgsfield";
1298
1320
  "xai-video": "xai-video";
1321
+ alibaba: "alibaba";
1299
1322
  luma: "luma";
1300
1323
  fish: "fish";
1301
1324
  elevenlabs: "elevenlabs";
@@ -1585,6 +1608,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1585
1608
  }, z.core.$loose>>;
1586
1609
  }, z.core.$loose>>;
1587
1610
  audio: z.ZodOptional<z.ZodUnknown>;
1611
+ inputBilling: z.ZodOptional<z.ZodUnknown>;
1588
1612
  prompt: z.ZodOptional<z.ZodUnknown>;
1589
1613
  }, z.core.$loose>;
1590
1614
  defaults: z.ZodObject<{
@@ -2016,6 +2040,19 @@ declare function resetLiveCatalog(): void;
2016
2040
 
2017
2041
  declare function fileCatalogCache(path: string): CatalogCache;
2018
2042
 
2043
+ /**
2044
+ * The input-billing rule of a row, or null when the provider bills only what it renders. The
2045
+ * row's own `constraints.inputBilling` wins. A live row an older seed wrote, without the field,
2046
+ * takes the kit row of the same id; an `ark` (Seedance) row is `seedance`.
2047
+ */
2048
+ declare function inputBillingOf(row: {
2049
+ id: string;
2050
+ adapter: string;
2051
+ constraints?: unknown;
2052
+ }): InputBilling | null;
2053
+
2054
+ declare const INPUT_BILLINGS: ("seedance" | "omni" | "h3-max-reference" | "h3-reference" | "grok-input-image" | "source-video-rate" | "kling-v4" | "input-plus-output")[];
2055
+
2019
2056
  type OnUnsupported = "error" | "coerce";
2020
2057
  interface ResolveResult<T> {
2021
2058
  request: T;
@@ -2406,6 +2443,9 @@ declare function createModelKit(config: ModelKitConfig, adapters: AdapterRegistr
2406
2443
 
2407
2444
  declare const aiSdkTextAdapter: Adapter;
2408
2445
 
2446
+ /** Alibaba Model Studio direct: Wan 3 and Happy Horse 1.1 video, Qwen Image 3 Pro. */
2447
+ declare const alibabaAdapter: Adapter;
2448
+
2409
2449
  declare const arkAdapter: Adapter;
2410
2450
 
2411
2451
  declare const falAdapter: Adapter;
@@ -2573,4 +2613,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2573
2613
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2574
2614
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2575
2615
 
2576
- export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2616
+ export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_BILLINGS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputBilling, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, alibabaAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, inputBillingOf, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };