@shop-os/modelkit 0.20.0 → 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
@@ -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[] | {
@@ -1590,6 +1608,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1590
1608
  }, z.core.$loose>>;
1591
1609
  }, z.core.$loose>>;
1592
1610
  audio: z.ZodOptional<z.ZodUnknown>;
1611
+ inputBilling: z.ZodOptional<z.ZodUnknown>;
1593
1612
  prompt: z.ZodOptional<z.ZodUnknown>;
1594
1613
  }, z.core.$loose>;
1595
1614
  defaults: z.ZodObject<{
@@ -2021,6 +2040,19 @@ declare function resetLiveCatalog(): void;
2021
2040
 
2022
2041
  declare function fileCatalogCache(path: string): CatalogCache;
2023
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
+
2024
2056
  type OnUnsupported = "error" | "coerce";
2025
2057
  interface ResolveResult<T> {
2026
2058
  request: T;
@@ -2581,4 +2613,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2581
2613
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2582
2614
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2583
2615
 
2584
- 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, 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, 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
@@ -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[] | {
@@ -1590,6 +1608,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1590
1608
  }, z.core.$loose>>;
1591
1609
  }, z.core.$loose>>;
1592
1610
  audio: z.ZodOptional<z.ZodUnknown>;
1611
+ inputBilling: z.ZodOptional<z.ZodUnknown>;
1593
1612
  prompt: z.ZodOptional<z.ZodUnknown>;
1594
1613
  }, z.core.$loose>;
1595
1614
  defaults: z.ZodObject<{
@@ -2021,6 +2040,19 @@ declare function resetLiveCatalog(): void;
2021
2040
 
2022
2041
  declare function fileCatalogCache(path: string): CatalogCache;
2023
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
+
2024
2056
  type OnUnsupported = "error" | "coerce";
2025
2057
  interface ResolveResult<T> {
2026
2058
  request: T;
@@ -2581,4 +2613,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2581
2613
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2582
2614
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2583
2615
 
2584
- 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, 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, 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.js CHANGED
@@ -5374,6 +5374,7 @@ var VIDEO_FAMILY_MODELS = [
5374
5374
  lifecycle: "active",
5375
5375
  exposure: ["cowork", "space_builder"],
5376
5376
  constraints: {
5377
+ inputBilling: "kling-v4",
5377
5378
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5378
5379
  resolutions: ["720p", "1080p"],
5379
5380
  durations: { min: 3, max: 30 },
@@ -5413,6 +5414,7 @@ var VIDEO_FAMILY_MODELS = [
5413
5414
  lifecycle: "active",
5414
5415
  exposure: ["cowork", "space_builder"],
5415
5416
  constraints: {
5417
+ inputBilling: "kling-v4",
5416
5418
  resolutions: ["720p", "1080p"],
5417
5419
  durations: { min: 3, max: 30 },
5418
5420
  references: { ...NO_REFERENCES, images: 10 },
@@ -5448,6 +5450,7 @@ var VIDEO_FAMILY_MODELS = [
5448
5450
  lifecycle: "active",
5449
5451
  exposure: ["cowork", "space_builder"],
5450
5452
  constraints: {
5453
+ inputBilling: "kling-v4",
5451
5454
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5452
5455
  resolutions: ["720p"],
5453
5456
  durations: { min: 3, max: 20 },
@@ -5486,6 +5489,7 @@ var VIDEO_FAMILY_MODELS = [
5486
5489
  lifecycle: "active",
5487
5490
  exposure: ["cowork", "space_builder"],
5488
5491
  constraints: {
5492
+ inputBilling: "kling-v4",
5489
5493
  resolutions: ["720p"],
5490
5494
  durations: { min: 3, max: 20 },
5491
5495
  references: {
@@ -5567,6 +5571,7 @@ var VIDEO_FAMILY_MODELS = [
5567
5571
  lifecycle: "active",
5568
5572
  exposure: ["cowork", "space_builder"],
5569
5573
  constraints: {
5574
+ inputBilling: "h3-max-reference",
5570
5575
  resolutions: ["480p", "768p"],
5571
5576
  durations: { min: 5, max: 13 },
5572
5577
  references: { images: 9, videos: 3, audios: 0 },
@@ -5804,6 +5809,7 @@ var VIDEO_FAMILY_MODELS = [
5804
5809
  lifecycle: "active",
5805
5810
  exposure: ["cowork", "space_builder"],
5806
5811
  constraints: {
5812
+ inputBilling: "grok-input-image",
5807
5813
  aspectRatios: [...GROK_15_RATIOS],
5808
5814
  resolutions: ["480p", "720p", "1080p"],
5809
5815
  durations: { min: 1, max: 15 },
@@ -6081,6 +6087,7 @@ var VIDEO_MODELS = [
6081
6087
  replacedBy: "gemini-omni-1.1-flash",
6082
6088
  exposure: [],
6083
6089
  constraints: {
6090
+ inputBilling: "omni",
6084
6091
  // 1.0 rejects `resolution`; it renders 720p. No defaults: the adapter
6085
6092
  // sends ratio and duration only when the caller set them, so a
6086
6093
  // reference clip keeps its own framing.
@@ -6112,6 +6119,7 @@ var VIDEO_MODELS = [
6112
6119
  lifecycle: "active",
6113
6120
  exposure: ["cowork", "space_builder"],
6114
6121
  constraints: {
6122
+ inputBilling: "omni",
6115
6123
  aspectRatios: [...OMNI_RATIOS],
6116
6124
  resolutions: ["360p", "720p", "1080p", "4k"],
6117
6125
  durations: [3, 4, 5, 6, 7, 8, 9, 10],
@@ -6156,6 +6164,7 @@ var VIDEO_MODELS = [
6156
6164
  lifecycle: "active",
6157
6165
  exposure: ["cowork", "space_builder"],
6158
6166
  constraints: {
6167
+ inputBilling: "omni",
6159
6168
  aspectRatios: [...OMNI_RATIOS],
6160
6169
  resolutions: ["360p", "720p", "1080p", "4k"],
6161
6170
  durations: { min: 3, max: 15 },
@@ -6332,6 +6341,7 @@ var VIDEO_MODELS = [
6332
6341
  lifecycle: "active",
6333
6342
  exposure: ["cowork", "space_builder"],
6334
6343
  constraints: {
6344
+ inputBilling: "grok-input-image",
6335
6345
  aspectRatios: [...GROK_RATIOS],
6336
6346
  resolutions: ["480p", "720p"],
6337
6347
  durations: { min: 1, max: 15 },
@@ -6533,6 +6543,7 @@ var VIDEO_MODELS = [
6533
6543
  lifecycle: "active",
6534
6544
  exposure: ["cowork", "space_builder"],
6535
6545
  constraints: {
6546
+ inputBilling: "h3-reference",
6536
6547
  aspectRatios: [...H3_REFERENCE_RATIOS],
6537
6548
  resolutions: ["480p", "768p", "2k", "4k"],
6538
6549
  durations: { min: 5, max: 15 },
@@ -6577,6 +6588,7 @@ var VIDEO_MODELS = [
6577
6588
  lifecycle: "active",
6578
6589
  exposure: ["cowork", "space_builder"],
6579
6590
  constraints: {
6591
+ inputBilling: "h3-max-reference",
6580
6592
  aspectRatios: [...H3_REFERENCE_RATIOS],
6581
6593
  resolutions: ["480p", "768p", "1080p"],
6582
6594
  durations: { min: 5, max: 15 },
@@ -6624,6 +6636,7 @@ var VIDEO_MODELS = [
6624
6636
  lifecycle: "active",
6625
6637
  exposure: ["cowork", "space_builder"],
6626
6638
  constraints: {
6639
+ inputBilling: "input-plus-output",
6627
6640
  aspectRatios: [...WAN_RATIOS],
6628
6641
  resolutions: ["480p", "720p", "1080p"],
6629
6642
  durations: { min: 2, max: 30 },
@@ -6665,6 +6678,7 @@ var VIDEO_MODELS = [
6665
6678
  lifecycle: "active",
6666
6679
  exposure: ["cowork", "space_builder"],
6667
6680
  constraints: {
6681
+ inputBilling: "input-plus-output",
6668
6682
  aspectRatios: [...WAN_RATIOS],
6669
6683
  resolutions: ["480p", "720p", "1080p"],
6670
6684
  durations: { min: 2, max: 30 },
@@ -7328,7 +7342,18 @@ var PromptConventionsSchema = z.strictObject({
7328
7342
  referenceSyntax: ReferenceSyntaxSchema,
7329
7343
  maxChars: MaxCharsSchema.optional()
7330
7344
  });
7345
+ var InputBillingSchema = z.enum([
7346
+ "seedance",
7347
+ "omni",
7348
+ "h3-max-reference",
7349
+ "h3-reference",
7350
+ "grok-input-image",
7351
+ "source-video-rate",
7352
+ "kling-v4",
7353
+ "input-plus-output"
7354
+ ]);
7331
7355
  var AUDIO_OUTPUTS = AudioOutputSchema.options;
7356
+ var INPUT_BILLINGS = InputBillingSchema.options;
7332
7357
  var REFERENCE_SYNTAXES = ReferenceSyntaxSchema.options;
7333
7358
  var ConstraintsReadView = z.looseObject({
7334
7359
  audio: AudioOutputSchema.optional().catch(void 0),
@@ -8241,6 +8266,7 @@ var ModelConstraintsSchema = z3.looseObject({
8241
8266
  // Loose on purpose: the read path keeps a row whose value is invalid (the accessors in
8242
8267
  // conventions.ts read it as "not set"); CatalogModelSchema below rejects it on write.
8243
8268
  audio: z3.unknown().optional(),
8269
+ inputBilling: z3.unknown().optional(),
8244
8270
  prompt: z3.unknown().optional()
8245
8271
  });
8246
8272
  var MediaRefSchema = z3.union([
@@ -8433,6 +8459,14 @@ var CatalogModelSchema = CatalogModelSchemaBase.superRefine(
8433
8459
  message: 'audio must be "always", "optional" or "never"'
8434
8460
  });
8435
8461
  }
8462
+ const inputBilling = row2.constraints.inputBilling;
8463
+ if (inputBilling !== void 0 && !InputBillingSchema.safeParse(inputBilling).success) {
8464
+ ctx.addIssue({
8465
+ code: "custom",
8466
+ path: ["constraints", "inputBilling"],
8467
+ message: `inputBilling must be one of ${INPUT_BILLINGS.join(", ")}`
8468
+ });
8469
+ }
8436
8470
  const refs = row2.constraints.references;
8437
8471
  for (const kind of ["images", "videos", "audios"]) {
8438
8472
  const least = refs?.min?.[kind];
@@ -18282,6 +18316,25 @@ function fileCatalogCache(path) {
18282
18316
  };
18283
18317
  }
18284
18318
 
18319
+ // src/catalog/input-billing.ts
18320
+ import { z as z36 } from "zod";
18321
+ var DATA_ONLY_INPUT_BILLING = /* @__PURE__ */ new Map([
18322
+ ["flux-3", "source-video-rate"]
18323
+ ]);
18324
+ var KIT_INPUT_BILLING = new Map(
18325
+ MODELS.flatMap(
18326
+ (row2) => row2.constraints.inputBilling ? [[row2.id, row2.constraints.inputBilling]] : []
18327
+ )
18328
+ );
18329
+ var ConstraintsReadView2 = z36.looseObject({
18330
+ inputBilling: InputBillingSchema.optional().catch(void 0)
18331
+ });
18332
+ function inputBillingOf(row2) {
18333
+ const view = ConstraintsReadView2.safeParse(row2.constraints);
18334
+ const own = view.success ? view.data.inputBilling : void 0;
18335
+ return own ?? KIT_INPUT_BILLING.get(row2.id) ?? (row2.adapter === "ark" ? "seedance" : void 0) ?? DATA_ONLY_INPUT_BILLING.get(row2.id) ?? null;
18336
+ }
18337
+
18285
18338
  // src/resolve-image-output.ts
18286
18339
  var BASE_FORMATS = ["png", "jpeg", "webp"];
18287
18340
  var ONE_K_FRAME_PIXELS = 288 * 512;
@@ -19733,7 +19786,7 @@ async function testProviderKey(provider, secret, opts = {}) {
19733
19786
 
19734
19787
  // src/text.ts
19735
19788
  import "ai";
19736
- import { z as z36 } from "zod";
19789
+ import { z as z37 } from "zod";
19737
19790
  function mergeTextProviderOptions(catalog, caller) {
19738
19791
  const merged = {};
19739
19792
  const catalogOptions = catalog.providerOptions ?? {};
@@ -19772,8 +19825,8 @@ function passthroughTextModel(model) {
19772
19825
  pricingKind: "token"
19773
19826
  };
19774
19827
  }
19775
- var perplexityCostSchema = z36.object({
19776
- perplexity: z36.object({ cost: z36.object({ totalCost: z36.number().finite().nonnegative() }) })
19828
+ var perplexityCostSchema = z37.object({
19829
+ perplexity: z37.object({ cost: z37.object({ totalCost: z37.number().finite().nonnegative() }) })
19777
19830
  });
19778
19831
  function reportedCostUsd(metadata) {
19779
19832
  const parsed = perplexityCostSchema.safeParse(metadata);
@@ -19851,7 +19904,7 @@ import {
19851
19904
  streamObject as aiStreamObject2,
19852
19905
  streamText as aiStreamText2
19853
19906
  } from "ai";
19854
- import { z as z37 } from "zod";
19907
+ import { z as z38 } from "zod";
19855
19908
 
19856
19909
  // src/generated-image.ts
19857
19910
  function toGeneratedImage(image) {
@@ -20270,10 +20323,10 @@ function textAbortOptions(sdk, context) {
20270
20323
  if (abortSignal) return { abortSignal };
20271
20324
  return {};
20272
20325
  }
20273
- var catalogId = z37.string();
20274
- var exactSize = z37.templateLiteral([z37.number(), "x", z37.number()]);
20275
- var sdkRatio = z37.templateLiteral([z37.number(), ":", z37.number()]);
20276
- var sizeTier = z37.enum(["512", "1K", "2K", "4K"]);
20326
+ var catalogId = z38.string();
20327
+ var exactSize = z38.templateLiteral([z38.number(), "x", z38.number()]);
20328
+ var sdkRatio = z38.templateLiteral([z38.number(), ":", z38.number()]);
20329
+ var sizeTier = z38.enum(["512", "1K", "2K", "4K"]);
20277
20330
  function isCatalogId(model) {
20278
20331
  return catalogId.safeParse(model).success;
20279
20332
  }
@@ -20995,6 +21048,7 @@ export {
20995
21048
  DEFAULT_ADAPTERS,
20996
21049
  ExposureSchema,
20997
21050
  IMAGE_INPUT_SPEC_KEYS,
21051
+ INPUT_BILLINGS,
20998
21052
  INPUT_SPEC_SUPPORTS_KEYS,
20999
21053
  InputSpecSchema,
21000
21054
  JsonObjectSchema,
@@ -21039,6 +21093,7 @@ export {
21039
21093
  hasAwsCredentials,
21040
21094
  higgsfieldAdapter,
21041
21095
  imageOutputFormats,
21096
+ inputBillingOf,
21042
21097
  isArrayInputSpecKey,
21043
21098
  isInputSpecKey,
21044
21099
  isListed,