@shop-os/modelkit 0.15.1 → 0.17.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/CHANGELOG.md +25 -0
- package/README.md +29 -2
- package/dist/catalog.cjs +90 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +30 -2
- package/dist/catalog.d.ts +30 -2
- package/dist/catalog.js +90 -1
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +413 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -2
- package/dist/index.d.ts +92 -2
- package/dist/index.js +408 -100
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -984,6 +984,12 @@ interface UsageEvent {
|
|
|
984
984
|
* submission carries no `submittedAt`).
|
|
985
985
|
*/
|
|
986
986
|
latencyMs?: number;
|
|
987
|
+
/**
|
|
988
|
+
* Whose provider account paid: "byok" when any required key came from the call's
|
|
989
|
+
* `keyOverride`, else the tier that served (an enterprise call that fell back to pro is
|
|
990
|
+
* "pro"). Unset on pass-through provider instances, whose keys the kit never sees.
|
|
991
|
+
*/
|
|
992
|
+
keySource?: KeySource;
|
|
987
993
|
raw?: unknown;
|
|
988
994
|
}
|
|
989
995
|
type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "elevenlabs" | "cloudflare";
|
|
@@ -1009,6 +1015,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
|
|
|
1009
1015
|
};
|
|
1010
1016
|
/** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
|
|
1011
1017
|
type KeyTier = "pro" | "enterprise" | "sloosh";
|
|
1018
|
+
/** Which key set paid for a call; "byok" is the customer's own key (`CallContext.keyOverride`). */
|
|
1019
|
+
type KeySource = KeyTier | "byok";
|
|
1012
1020
|
/** Key names a call can require, including the Bedrock credentials object. */
|
|
1013
1021
|
type RequiredKeyName = ProviderKeyName | "aws";
|
|
1014
1022
|
/** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
|
|
@@ -1061,6 +1069,21 @@ interface ModelKitConfig {
|
|
|
1061
1069
|
interface CallContext {
|
|
1062
1070
|
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. "sloosh" uses keys.sloosh only and never falls back. */
|
|
1063
1071
|
tier?: KeyTier;
|
|
1072
|
+
/**
|
|
1073
|
+
* Customer keys for this one call (BYOK). A required name held here is used instead of
|
|
1074
|
+
* the tier's key and never falls back to it; names it does not hold resolve through
|
|
1075
|
+
* `tier` as usual. A blank value counts as absent. Higgsfield needs key and secret
|
|
1076
|
+
* together. `aws` is ignored: BYOK never covers Bedrock. A call served from these keys
|
|
1077
|
+
* goes direct to the provider, never through the Cloudflare gateway.
|
|
1078
|
+
*/
|
|
1079
|
+
keyOverride?: Partial<ProviderKeys>;
|
|
1080
|
+
/**
|
|
1081
|
+
* The call was billed at the customer-key price, so it must not run on our key. When no
|
|
1082
|
+
* required key name comes from `keyOverride`, the call throws `byok_key_missing` before any
|
|
1083
|
+
* provider request. A call on a model outside the catalog always throws: the kit resolves no
|
|
1084
|
+
* key for it.
|
|
1085
|
+
*/
|
|
1086
|
+
requireOverride?: boolean;
|
|
1064
1087
|
signal?: AbortSignal;
|
|
1065
1088
|
/** Media retries after the initial request. Set 0 when a durable host owns recovery.
|
|
1066
1089
|
* Unset preserves adapter defaults. Successful pending-job polls are not retries.
|
|
@@ -1811,7 +1834,12 @@ declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest,
|
|
|
1811
1834
|
type ProviderErrorBody = string | JsonValue;
|
|
1812
1835
|
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1813
1836
|
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1814
|
-
| "provider_billing" | "timeout" | "auth"
|
|
1837
|
+
| "provider_billing" | "timeout" | "auth"
|
|
1838
|
+
/**
|
|
1839
|
+
* A call with `requireOverride` had no required key in `keyOverride`. Never retried, and not a
|
|
1840
|
+
* provider auth failure: the customer's key was never sent, so it says nothing about that key.
|
|
1841
|
+
*/
|
|
1842
|
+
| "byok_key_missing" | "network" | "rate_limited";
|
|
1815
1843
|
interface ModelKitErrorInit {
|
|
1816
1844
|
code: ModelKitErrorCode;
|
|
1817
1845
|
message: string;
|
|
@@ -1968,4 +1996,4 @@ declare function promptConventions(row: {
|
|
|
1968
1996
|
constraints: unknown;
|
|
1969
1997
|
}): PromptConventions;
|
|
1970
1998
|
|
|
1971
|
-
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
|
|
1999
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
|
package/dist/catalog.d.ts
CHANGED
|
@@ -984,6 +984,12 @@ interface UsageEvent {
|
|
|
984
984
|
* submission carries no `submittedAt`).
|
|
985
985
|
*/
|
|
986
986
|
latencyMs?: number;
|
|
987
|
+
/**
|
|
988
|
+
* Whose provider account paid: "byok" when any required key came from the call's
|
|
989
|
+
* `keyOverride`, else the tier that served (an enterprise call that fell back to pro is
|
|
990
|
+
* "pro"). Unset on pass-through provider instances, whose keys the kit never sees.
|
|
991
|
+
*/
|
|
992
|
+
keySource?: KeySource;
|
|
987
993
|
raw?: unknown;
|
|
988
994
|
}
|
|
989
995
|
type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "elevenlabs" | "cloudflare";
|
|
@@ -1009,6 +1015,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
|
|
|
1009
1015
|
};
|
|
1010
1016
|
/** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
|
|
1011
1017
|
type KeyTier = "pro" | "enterprise" | "sloosh";
|
|
1018
|
+
/** Which key set paid for a call; "byok" is the customer's own key (`CallContext.keyOverride`). */
|
|
1019
|
+
type KeySource = KeyTier | "byok";
|
|
1012
1020
|
/** Key names a call can require, including the Bedrock credentials object. */
|
|
1013
1021
|
type RequiredKeyName = ProviderKeyName | "aws";
|
|
1014
1022
|
/** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
|
|
@@ -1061,6 +1069,21 @@ interface ModelKitConfig {
|
|
|
1061
1069
|
interface CallContext {
|
|
1062
1070
|
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. "sloosh" uses keys.sloosh only and never falls back. */
|
|
1063
1071
|
tier?: KeyTier;
|
|
1072
|
+
/**
|
|
1073
|
+
* Customer keys for this one call (BYOK). A required name held here is used instead of
|
|
1074
|
+
* the tier's key and never falls back to it; names it does not hold resolve through
|
|
1075
|
+
* `tier` as usual. A blank value counts as absent. Higgsfield needs key and secret
|
|
1076
|
+
* together. `aws` is ignored: BYOK never covers Bedrock. A call served from these keys
|
|
1077
|
+
* goes direct to the provider, never through the Cloudflare gateway.
|
|
1078
|
+
*/
|
|
1079
|
+
keyOverride?: Partial<ProviderKeys>;
|
|
1080
|
+
/**
|
|
1081
|
+
* The call was billed at the customer-key price, so it must not run on our key. When no
|
|
1082
|
+
* required key name comes from `keyOverride`, the call throws `byok_key_missing` before any
|
|
1083
|
+
* provider request. A call on a model outside the catalog always throws: the kit resolves no
|
|
1084
|
+
* key for it.
|
|
1085
|
+
*/
|
|
1086
|
+
requireOverride?: boolean;
|
|
1064
1087
|
signal?: AbortSignal;
|
|
1065
1088
|
/** Media retries after the initial request. Set 0 when a durable host owns recovery.
|
|
1066
1089
|
* Unset preserves adapter defaults. Successful pending-job polls are not retries.
|
|
@@ -1811,7 +1834,12 @@ declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest,
|
|
|
1811
1834
|
type ProviderErrorBody = string | JsonValue;
|
|
1812
1835
|
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1813
1836
|
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1814
|
-
| "provider_billing" | "timeout" | "auth"
|
|
1837
|
+
| "provider_billing" | "timeout" | "auth"
|
|
1838
|
+
/**
|
|
1839
|
+
* A call with `requireOverride` had no required key in `keyOverride`. Never retried, and not a
|
|
1840
|
+
* provider auth failure: the customer's key was never sent, so it says nothing about that key.
|
|
1841
|
+
*/
|
|
1842
|
+
| "byok_key_missing" | "network" | "rate_limited";
|
|
1815
1843
|
interface ModelKitErrorInit {
|
|
1816
1844
|
code: ModelKitErrorCode;
|
|
1817
1845
|
message: string;
|
|
@@ -1968,4 +1996,4 @@ declare function promptConventions(row: {
|
|
|
1968
1996
|
constraints: unknown;
|
|
1969
1997
|
}): PromptConventions;
|
|
1970
1998
|
|
|
1971
|
-
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
|
|
1999
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
|
package/dist/catalog.js
CHANGED
|
@@ -5063,6 +5063,7 @@ var KLING_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
|
|
|
5063
5063
|
var H3_PROMPT = { referenceSyntax: "numbered", maxChars: 5e4 };
|
|
5064
5064
|
var KLING_V4_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
|
|
5065
5065
|
var KLING_V4_AUDIO = "always";
|
|
5066
|
+
var KLING_V4_FLASH_PROMPT = { referenceSyntax: "numbered", maxChars: 26e3 };
|
|
5066
5067
|
var NO_REFERENCES = { images: 0, videos: 0, audios: 0 };
|
|
5067
5068
|
function klingMotionControl(tier) {
|
|
5068
5069
|
const label = tier === "pro" ? "Pro" : "Standard";
|
|
@@ -5240,6 +5241,85 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5240
5241
|
},
|
|
5241
5242
|
capabilities: { acceptsSourceVideo: true, videoEdit: true }
|
|
5242
5243
|
},
|
|
5244
|
+
{
|
|
5245
|
+
// https://fal.ai/models/kling/v4/flash/reference-to-video/api (+ /text-to-video,
|
|
5246
|
+
// /image-to-video): routed like kling-4.0, at 720p only and 3-20 s. image-to-video takes
|
|
5247
|
+
// a start frame (300 px min, ratio 0.40-2.50) and no end frame; its prompt is optional.
|
|
5248
|
+
// Reference images: 10, the start frame included. Reference videos: 5, 3-20.05 s each
|
|
5249
|
+
// and 20 s combined, 700 px min. Prompts up to 26,000 characters. No sound switch.
|
|
5250
|
+
id: "kling-4.0-flash",
|
|
5251
|
+
aliases: ["kling-4-flash", "kling-v4-flash"],
|
|
5252
|
+
label: "Kling 4.0 Flash",
|
|
5253
|
+
type: "video",
|
|
5254
|
+
adapter: "fal",
|
|
5255
|
+
providerModelId: "kling/v4/flash",
|
|
5256
|
+
lifecycle: "active",
|
|
5257
|
+
exposure: ["cowork", "space_builder"],
|
|
5258
|
+
constraints: {
|
|
5259
|
+
aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
|
|
5260
|
+
resolutions: ["720p"],
|
|
5261
|
+
durations: { min: 3, max: 20 },
|
|
5262
|
+
durationPresets: [5, 10, 15, 20],
|
|
5263
|
+
references: {
|
|
5264
|
+
...NO_REFERENCES,
|
|
5265
|
+
images: 10,
|
|
5266
|
+
videos: 5,
|
|
5267
|
+
videoSeconds: { min: 3, max: 20.05, total: 20 },
|
|
5268
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5269
|
+
},
|
|
5270
|
+
supports: [],
|
|
5271
|
+
prompt: KLING_V4_FLASH_PROMPT,
|
|
5272
|
+
audio: KLING_V4_AUDIO
|
|
5273
|
+
},
|
|
5274
|
+
defaults: { durationSeconds: 5, resolution: "720p", aspectRatio: "16:9" },
|
|
5275
|
+
usage: { ...VIDEO_USAGE },
|
|
5276
|
+
pricingKind: "video_per_second",
|
|
5277
|
+
display: {
|
|
5278
|
+
provider: "kuaishou",
|
|
5279
|
+
logo: KLING_LOGO,
|
|
5280
|
+
description: "Kuaishou Kling 4.0 Flash: fast text-to-video, a start frame, or reference-to-video from up to 10 images and 5 videos (20 seconds combined), 3 to 20 seconds at 720p. Prompts name references @Image1, @Video1."
|
|
5281
|
+
}
|
|
5282
|
+
},
|
|
5283
|
+
{
|
|
5284
|
+
// https://fal.ai/models/kling/v4/flash/video-to-video/api: source 3-20.05 s (700 px
|
|
5285
|
+
// min, 23.9-60.05 fps), up to 10 reference images and 4 reference videos; the source
|
|
5286
|
+
// and reference videos total 20 s at most. duration 3-20, or left out for the source's
|
|
5287
|
+
// length. The prompt names the source @Video1, reference videos @Video2 on, images @Image1.
|
|
5288
|
+
id: "kling-4.0-flash-edit",
|
|
5289
|
+
aliases: ["kling-4-flash-edit", "kling-v4-flash-edit"],
|
|
5290
|
+
label: "Kling 4.0 Flash Edit",
|
|
5291
|
+
type: "video",
|
|
5292
|
+
adapter: "fal",
|
|
5293
|
+
providerModelId: "kling/v4/flash/video-to-video",
|
|
5294
|
+
lifecycle: "active",
|
|
5295
|
+
exposure: ["cowork", "space_builder"],
|
|
5296
|
+
constraints: {
|
|
5297
|
+
resolutions: ["720p"],
|
|
5298
|
+
durations: { min: 3, max: 20 },
|
|
5299
|
+
references: {
|
|
5300
|
+
...NO_REFERENCES,
|
|
5301
|
+
images: 10,
|
|
5302
|
+
videos: 4,
|
|
5303
|
+
videoSeconds: { min: 3, max: 20.05, total: 20 },
|
|
5304
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5305
|
+
},
|
|
5306
|
+
requires: ["sourceVideo"],
|
|
5307
|
+
sourceVideoSeconds: { min: 3, max: 20.05, inReferenceTotal: true },
|
|
5308
|
+
sourceVideoPixels: { minWidth: 700, minHeight: 700 },
|
|
5309
|
+
supports: [],
|
|
5310
|
+
prompt: KLING_V4_FLASH_PROMPT,
|
|
5311
|
+
audio: KLING_V4_AUDIO
|
|
5312
|
+
},
|
|
5313
|
+
defaults: { resolution: "720p" },
|
|
5314
|
+
usage: { ...VIDEO_USAGE },
|
|
5315
|
+
pricingKind: "video_per_second",
|
|
5316
|
+
display: {
|
|
5317
|
+
provider: "kuaishou",
|
|
5318
|
+
logo: KLING_LOGO,
|
|
5319
|
+
description: "Kuaishou Kling 4.0 Flash video edit: change a 3-20 second clip with a prompt, up to 10 reference images and 4 reference videos (20 seconds in all with the source), at 720p, as long as the source or a set 3-20 seconds. Prompts name the source @Video1."
|
|
5320
|
+
},
|
|
5321
|
+
capabilities: { acceptsSourceVideo: true, videoEdit: true }
|
|
5322
|
+
},
|
|
5243
5323
|
{
|
|
5244
5324
|
// https://fal.ai/models/minimax/h3-max-turbo/text-to-video/api (+ /image-to-video).
|
|
5245
5325
|
// image-to-video takes a start frame, an end frame, or both, and no aspect_ratio.
|
|
@@ -8999,6 +9079,8 @@ var O3_REFERENCE = "fal-ai/kling-video/o3/pro/reference-to-video";
|
|
|
8999
9079
|
var O3_EDIT = "fal-ai/kling-video/o3/pro/video-to-video/edit";
|
|
9000
9080
|
var KLING_V4 = "kling/v4";
|
|
9001
9081
|
var KLING_V4_EDIT = "kling/v4/video-to-video/edit";
|
|
9082
|
+
var KLING_V4_FLASH = "kling/v4/flash";
|
|
9083
|
+
var KLING_V4_FLASH_EDIT = "kling/v4/flash/video-to-video";
|
|
9002
9084
|
var H3_TURBO = "minimax/h3-max-turbo";
|
|
9003
9085
|
var H3_RECAST = "minimax/h3-max/recast";
|
|
9004
9086
|
var H3_RELIGHT = "minimax/h3-max/relight";
|
|
@@ -9080,6 +9162,11 @@ function klingV4(req) {
|
|
|
9080
9162
|
}
|
|
9081
9163
|
return needsPrompt(req);
|
|
9082
9164
|
}
|
|
9165
|
+
function klingV4Flash(req) {
|
|
9166
|
+
if (req.lastFrame !== void 0) return unsupported2("takes no end frame");
|
|
9167
|
+
if (!hasReferences(req) && req.firstFrame !== void 0) return void 0;
|
|
9168
|
+
return klingV4(req);
|
|
9169
|
+
}
|
|
9083
9170
|
function h3Turbo(req) {
|
|
9084
9171
|
if (count(req.referenceImages) + count(req.referenceVideos) > 0) {
|
|
9085
9172
|
return unsupported2("takes no reference images or videos");
|
|
@@ -9160,6 +9247,8 @@ var RULES = /* @__PURE__ */ new Map([
|
|
|
9160
9247
|
[O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9161
9248
|
[KLING_V4, klingV4],
|
|
9162
9249
|
[KLING_V4_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9250
|
+
[KLING_V4_FLASH, klingV4Flash],
|
|
9251
|
+
[KLING_V4_FLASH_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9163
9252
|
[H3_TURBO, h3Turbo],
|
|
9164
9253
|
[MINIMAX_H3_INSERT, h3Insert],
|
|
9165
9254
|
[H3_RECAST, h3Recast],
|
|
@@ -9209,7 +9298,7 @@ function applyFalVideoRules(model, req, callerRatio, warnings) {
|
|
|
9209
9298
|
warnings.push(viduSilentWarning(model));
|
|
9210
9299
|
req.generateAudio = false;
|
|
9211
9300
|
}
|
|
9212
|
-
if (id === KLING_V4 && req.firstFrame !== void 0 && !hasReferences(req)) {
|
|
9301
|
+
if ((id === KLING_V4 || id === KLING_V4_FLASH) && req.firstFrame !== void 0 && !hasReferences(req)) {
|
|
9213
9302
|
if (req.aspectRatio !== void 0) {
|
|
9214
9303
|
if (callerRatio !== void 0) {
|
|
9215
9304
|
warnings.push({
|