Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

51 changes: 50 additions & 1 deletion src/resources/image-to-video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export type ImageToVideoCreateParams =
| ImageToVideoCreateParams.Wan3Prime
| ImageToVideoCreateParams.H3Max
| ImageToVideoCreateParams.Seedance2_5
| ImageToVideoCreateParams.GrokImagine1_5Lite;
| ImageToVideoCreateParams.GrokImagine1_5Lite
| ImageToVideoCreateParams.Kling4;

export declare namespace ImageToVideoCreateParams {
export interface Gen4_5 {
Expand Down Expand Up @@ -1975,6 +1976,54 @@ export declare namespace ImageToVideoCreateParams {
uri: string;
}
}

export interface Kling4 {
model: 'kling_4';

/**
* The first frame of the video, or an array with a first frame and optional middle
* and last frames. The video follows the first frame’s aspect ratio.
*/
promptImage: string | Array<unknown>;

/**
* The duration of the output video in seconds.
*/
duration?: number;

/**
* A text prompt describing what should happen in the video.
*/
promptText?: string;

/**
* Output quality tier. The video keeps the input media framing.
*/
ratio?: 'auto_720p' | 'auto_1080p';

/**
* Images of characters, objects or styles to use in the video. Up to 10 images in
* total, frames included.
*/
references?: Array<Kling4.Reference>;

/**
* Up to 5 videos whose style, motion or camera work should guide the output,
* together at most 30 seconds long.
*/
referenceVideos?: Array<unknown>;
}

export namespace Kling4 {
export interface Reference {
/**
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
* [our docs](/assets/inputs#images) on image inputs for more information.
*/
uri: string;
}
}
}

export declare namespace ImageToVideo {
Expand Down
2 changes: 2 additions & 0 deletions src/resources/organization/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export interface OrganizationRetrieveUsageResponse {
| 'ruby'
| 'enhance_frame_rate'
| 'kling2.5_turbo_pro'
| 'kling_4'
| 'kling3.0_pro'
| 'kling3.0_4k'
| 'kling3.0_standard'
Expand Down Expand Up @@ -288,6 +289,7 @@ export namespace OrganizationRetrieveUsageResponse {
| 'ruby'
| 'enhance_frame_rate'
| 'kling2.5_turbo_pro'
| 'kling_4'
| 'kling3.0_pro'
| 'kling3.0_4k'
| 'kling3.0_standard'
Expand Down
56 changes: 55 additions & 1 deletion src/resources/text-to-video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export type TextToVideoCreateParams =
| TextToVideoCreateParams.Wan3Prime
| TextToVideoCreateParams.H3Max
| TextToVideoCreateParams.Seedance2_5
| TextToVideoCreateParams.GrokImagine1_5Lite;
| TextToVideoCreateParams.GrokImagine1_5Lite
| TextToVideoCreateParams.Kling4;

export declare namespace TextToVideoCreateParams {
export interface Gen4_5 {
Expand Down Expand Up @@ -1673,6 +1674,59 @@ export declare namespace TextToVideoCreateParams {
| '1744:1152'
| '1152:1744';
}

export interface Kling4 {
model: 'kling_4';

/**
* A text prompt describing what should happen in the video.
*/
promptText: string;

/**
* The duration of the output video in seconds.
*/
duration?: number;

/**
* The target output size. Use a pixel ratio such as `1280:720` or `auto_720p` /
* `auto_1080p` for adaptive framing.
*/
ratio?:
| '1280:720'
| '720:1280'
| '940:940'
| '1460:624'
| '1920:1080'
| '1080:1920'
| '1440:1440'
| '2200:940'
| 'auto_720p'
| 'auto_1080p';

/**
* Images of characters, objects or styles to use in the video. Up to 10 images in
* total, frames included.
*/
references?: Array<Kling4.Reference>;

/**
* Up to 5 videos whose style, motion or camera work should guide the output,
* together at most 30 seconds long.
*/
referenceVideos?: Array<unknown>;
}

export namespace Kling4 {
export interface Reference {
/**
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
* [our docs](/assets/inputs#images) on image inputs for more information.
*/
uri: string;
}
}
}

export declare namespace TextToVideo {
Expand Down
41 changes: 40 additions & 1 deletion src/resources/video-to-video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export type VideoToVideoCreateParams =
| VideoToVideoCreateParams.Seedance2Mini
| VideoToVideoCreateParams.GeminiOmniFlash
| VideoToVideoCreateParams.GeminiOmniFlash1_1
| VideoToVideoCreateParams.Seedance2_5;
| VideoToVideoCreateParams.Seedance2_5
| VideoToVideoCreateParams.Kling4;

export declare namespace VideoToVideoCreateParams {
export interface Variant0 {
Expand Down Expand Up @@ -1158,6 +1159,44 @@ export declare namespace VideoToVideoCreateParams {
uri: string;
}
}

export interface Kling4 {
model: 'kling_4';

/**
* A text prompt describing how to edit the video.
*/
promptText: string;

/**
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
* `data:video/mp4;base64,...`, up to 5MB) containing an encoded video. See
* [our docs](/assets/inputs#videos) on video inputs for more information.
*/
videoUri: string;

/**
* Output quality tier. The video keeps the input media framing.
*/
ratio?: 'auto_720p' | 'auto_1080p';

/**
* Images of characters, objects or styles to use in the video. Up to 10 images in
* total, frames included.
*/
references?: Array<Kling4.Reference>;
}

export namespace Kling4 {
export interface Reference {
/**
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
* [our docs](/assets/inputs#images) on image inputs for more information.
*/
uri: string;
}
}
}

export declare namespace VideoToVideo {
Expand Down
Loading