@runapi.ai/kling 0.5.0 → 0.6.1

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.mts CHANGED
@@ -29,8 +29,6 @@ declare const modelValues: {
29
29
  readonly avatar: {
30
30
  readonly KLING_AI_AVATAR_PRO: "kling-ai-avatar-pro";
31
31
  readonly KLING_AI_AVATAR_STANDARD: "kling-ai-avatar-standard";
32
- readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
33
- readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
34
32
  };
35
33
  readonly motionControl: {
36
34
  readonly KLING_3_0: "kling-3.0";
@@ -56,7 +54,7 @@ type KlingAspectRatio = '16:9' | '9:16' | '1:1';
56
54
  type KlingDuration = number;
57
55
  type KlingV26Mode = 'std' | 'pro';
58
56
  type KlingO1ReferenceVideoType = 'base' | 'feature';
59
- /** A single shot in a multi-shot text-to-video sequence. */
57
+ /** A custom shot: 1-12 seconds; all shots sum to the total video duration. */
60
58
  interface MultiPromptItem {
61
59
  prompt: string;
62
60
  duration_seconds: number;
@@ -78,9 +76,20 @@ interface KlingElement {
78
76
  /** End time in milliseconds for video element capture; must be 3000-8000 ms after start_time. */
79
77
  end_time?: number;
80
78
  }
79
+ interface KlingO1ReferenceParams {
80
+ /** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
81
+ reference_image_urls?: string[];
82
+ /** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
83
+ reference_video_url?: string;
84
+ /** Base edit or feature reference; defaults to base. */
85
+ reference_video_type?: KlingO1ReferenceVideoType;
86
+ /** Preserve audio from the reference video. */
87
+ preserve_reference_video_audio?: boolean;
88
+ }
89
+
81
90
  interface Kling3TextToVideoCommonParams {
82
91
  model: (typeof modelValues.textToVideo.KLING_3_0);
83
- /** Duration in seconds (3-15). */
92
+ /** Duration in seconds (3-15), default 5. */
84
93
  duration_seconds?: KlingDuration;
85
94
  aspect_ratio?: KlingAspectRatio;
86
95
  output_resolution?: KlingTextToVideoOutputResolution;
@@ -100,17 +109,28 @@ interface Kling3TextToVideoSingleShotParams extends Kling3TextToVideoCommonParam
100
109
  /** Closing frame image URL; only available in single-shot mode. */
101
110
  last_frame_image_url?: string;
102
111
  }
103
- /** Kling 3.0 multi-shot mode: stitch multiple prompted segments into one video with sound. */
112
+ /** Kling 3.0 custom multi-shot mode with optional sound. */
104
113
  interface Kling3TextToVideoMultiShotParams extends Kling3TextToVideoCommonParams {
105
114
  /** Must be true to activate multi-shot generation. */
106
115
  multi_shots: true;
107
- /** Must be true; sound is always generated in multi-shot mode. */
108
- enable_sound: true;
109
- /** Ordered shot segments, each with its own prompt and duration. */
116
+ /** Generate synchronized audio for the video. */
117
+ enable_sound?: boolean;
118
+ /** Custom storyboard; defaults to custom only when multi_shots is true. */
119
+ shot_type?: 'custom';
120
+ /** 1-6 ordered shots. Each prompt allows 500 effective characters; each @element reference counts as 37. */
110
121
  multi_prompt: MultiPromptItem[];
111
122
  /** Opening frame image URL for the first shot. */
112
123
  first_frame_image_url?: string;
113
124
  }
125
+ /** Kling 3.0 automatic storyboard from one prompt with optional sound. */
126
+ interface Kling3TextToVideoAutomaticShotParams extends Kling3TextToVideoCommonParams {
127
+ multi_shots: true;
128
+ shot_type: 'automatic';
129
+ prompt: string;
130
+ enable_sound?: boolean;
131
+ multi_prompt?: never;
132
+ first_frame_image_url?: string;
133
+ }
114
134
  /** V2.5 Turbo text-to-video: fast, high-quality generation with negative prompt and cfg_scale control. */
115
135
  interface V25TurboTextToVideoParams {
116
136
  model: (typeof modelValues.textToVideo.KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO);
@@ -155,16 +175,6 @@ interface KlingV26TextToVideoParams {
155
175
  aspect_ratio?: KlingAspectRatio;
156
176
  callback_url?: string;
157
177
  }
158
- interface KlingO1ReferenceParams {
159
- /** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
160
- reference_image_urls?: string[];
161
- /** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
162
- reference_video_url?: string;
163
- /** Base edit or feature reference; defaults to base. */
164
- reference_video_type?: KlingO1ReferenceVideoType;
165
- /** Preserve audio from the reference video. */
166
- preserve_reference_video_audio?: boolean;
167
- }
168
178
  /** Kling O1 text-to-video with image and video references. */
169
179
  interface KlingO1TextToVideoParams extends KlingO1ReferenceParams {
170
180
  model: (typeof modelValues.textToVideo.KLING_O1);
@@ -196,6 +206,8 @@ interface V3OmniReferenceTextToVideoParams {
196
206
  enable_sound?: boolean;
197
207
  callback_url?: string;
198
208
  }
209
+ type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | Kling3TextToVideoAutomaticShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams | V3OmniReferenceTextToVideoParams;
210
+
199
211
  /**
200
212
  * Earlier V2 image-to-video parameters. A first-frame image is required; the model
201
213
  * animates it into video guided by the text prompt. last_frame_image_url is supported
@@ -263,8 +275,8 @@ interface V3OmniImageToVideoParams {
263
275
  aspect_ratio?: KlingAspectRatio;
264
276
  callback_url?: string;
265
277
  }
266
- type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams | V3OmniReferenceTextToVideoParams;
267
278
  type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | KlingO1ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
279
+
268
280
  /** Continue a completed Kling V2.5 Turbo video task. */
269
281
  interface KlingExtendVideoParams {
270
282
  source_task_id: string;
@@ -345,21 +357,18 @@ interface MotionControlCommonParams {
345
357
  prompt?: string;
346
358
  callback_url?: string;
347
359
  }
348
- /** Kling 3.0 motion transfer with explicit resolution and optional orientation and background controls. */
360
+ /** Kling 3.0 motion transfer with explicit resolution and optional character orientation. */
349
361
  interface Kling3MotionControlParams extends MotionControlCommonParams {
350
362
  model: (typeof modelValues.motionControl.KLING_3_0);
351
363
  output_resolution: '720p' | '1080p';
352
364
  /** Whether the character faces the direction from the video or the image. */
353
365
  character_orientation?: 'video' | 'image';
354
- /** Whether the background comes from the video or the image. */
355
- background_source?: 'video' | 'image';
356
366
  }
357
367
  /** Kling 2.6 motion transfer with explicit resolution and character orientation. */
358
368
  interface KlingV26MotionControlParams extends MotionControlCommonParams {
359
369
  model: (typeof modelValues.motionControl.KLING_V2_6);
360
370
  output_resolution: '720p' | '1080p';
361
371
  character_orientation: 'video' | 'image';
362
- background_source?: never;
363
372
  }
364
373
  type MotionControlParams = Kling3MotionControlParams | KlingV26MotionControlParams;
365
374
  interface MotionControlResponse extends AsyncTaskResponse {
@@ -536,4 +545,4 @@ declare class KlingClient extends BaseClient {
536
545
  constructor(options?: ClientOptions);
537
546
  }
538
547
 
539
- export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type EditVideoParams, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingEditVideoModel, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniReferenceTextToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
548
+ export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type EditVideoParams, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoAutomaticShotParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingEditVideoModel, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniReferenceTextToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
package/dist/index.d.ts CHANGED
@@ -29,8 +29,6 @@ declare const modelValues: {
29
29
  readonly avatar: {
30
30
  readonly KLING_AI_AVATAR_PRO: "kling-ai-avatar-pro";
31
31
  readonly KLING_AI_AVATAR_STANDARD: "kling-ai-avatar-standard";
32
- readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
33
- readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
34
32
  };
35
33
  readonly motionControl: {
36
34
  readonly KLING_3_0: "kling-3.0";
@@ -56,7 +54,7 @@ type KlingAspectRatio = '16:9' | '9:16' | '1:1';
56
54
  type KlingDuration = number;
57
55
  type KlingV26Mode = 'std' | 'pro';
58
56
  type KlingO1ReferenceVideoType = 'base' | 'feature';
59
- /** A single shot in a multi-shot text-to-video sequence. */
57
+ /** A custom shot: 1-12 seconds; all shots sum to the total video duration. */
60
58
  interface MultiPromptItem {
61
59
  prompt: string;
62
60
  duration_seconds: number;
@@ -78,9 +76,20 @@ interface KlingElement {
78
76
  /** End time in milliseconds for video element capture; must be 3000-8000 ms after start_time. */
79
77
  end_time?: number;
80
78
  }
79
+ interface KlingO1ReferenceParams {
80
+ /** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
81
+ reference_image_urls?: string[];
82
+ /** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
83
+ reference_video_url?: string;
84
+ /** Base edit or feature reference; defaults to base. */
85
+ reference_video_type?: KlingO1ReferenceVideoType;
86
+ /** Preserve audio from the reference video. */
87
+ preserve_reference_video_audio?: boolean;
88
+ }
89
+
81
90
  interface Kling3TextToVideoCommonParams {
82
91
  model: (typeof modelValues.textToVideo.KLING_3_0);
83
- /** Duration in seconds (3-15). */
92
+ /** Duration in seconds (3-15), default 5. */
84
93
  duration_seconds?: KlingDuration;
85
94
  aspect_ratio?: KlingAspectRatio;
86
95
  output_resolution?: KlingTextToVideoOutputResolution;
@@ -100,17 +109,28 @@ interface Kling3TextToVideoSingleShotParams extends Kling3TextToVideoCommonParam
100
109
  /** Closing frame image URL; only available in single-shot mode. */
101
110
  last_frame_image_url?: string;
102
111
  }
103
- /** Kling 3.0 multi-shot mode: stitch multiple prompted segments into one video with sound. */
112
+ /** Kling 3.0 custom multi-shot mode with optional sound. */
104
113
  interface Kling3TextToVideoMultiShotParams extends Kling3TextToVideoCommonParams {
105
114
  /** Must be true to activate multi-shot generation. */
106
115
  multi_shots: true;
107
- /** Must be true; sound is always generated in multi-shot mode. */
108
- enable_sound: true;
109
- /** Ordered shot segments, each with its own prompt and duration. */
116
+ /** Generate synchronized audio for the video. */
117
+ enable_sound?: boolean;
118
+ /** Custom storyboard; defaults to custom only when multi_shots is true. */
119
+ shot_type?: 'custom';
120
+ /** 1-6 ordered shots. Each prompt allows 500 effective characters; each @element reference counts as 37. */
110
121
  multi_prompt: MultiPromptItem[];
111
122
  /** Opening frame image URL for the first shot. */
112
123
  first_frame_image_url?: string;
113
124
  }
125
+ /** Kling 3.0 automatic storyboard from one prompt with optional sound. */
126
+ interface Kling3TextToVideoAutomaticShotParams extends Kling3TextToVideoCommonParams {
127
+ multi_shots: true;
128
+ shot_type: 'automatic';
129
+ prompt: string;
130
+ enable_sound?: boolean;
131
+ multi_prompt?: never;
132
+ first_frame_image_url?: string;
133
+ }
114
134
  /** V2.5 Turbo text-to-video: fast, high-quality generation with negative prompt and cfg_scale control. */
115
135
  interface V25TurboTextToVideoParams {
116
136
  model: (typeof modelValues.textToVideo.KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO);
@@ -155,16 +175,6 @@ interface KlingV26TextToVideoParams {
155
175
  aspect_ratio?: KlingAspectRatio;
156
176
  callback_url?: string;
157
177
  }
158
- interface KlingO1ReferenceParams {
159
- /** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
160
- reference_image_urls?: string[];
161
- /** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
162
- reference_video_url?: string;
163
- /** Base edit or feature reference; defaults to base. */
164
- reference_video_type?: KlingO1ReferenceVideoType;
165
- /** Preserve audio from the reference video. */
166
- preserve_reference_video_audio?: boolean;
167
- }
168
178
  /** Kling O1 text-to-video with image and video references. */
169
179
  interface KlingO1TextToVideoParams extends KlingO1ReferenceParams {
170
180
  model: (typeof modelValues.textToVideo.KLING_O1);
@@ -196,6 +206,8 @@ interface V3OmniReferenceTextToVideoParams {
196
206
  enable_sound?: boolean;
197
207
  callback_url?: string;
198
208
  }
209
+ type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | Kling3TextToVideoAutomaticShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams | V3OmniReferenceTextToVideoParams;
210
+
199
211
  /**
200
212
  * Earlier V2 image-to-video parameters. A first-frame image is required; the model
201
213
  * animates it into video guided by the text prompt. last_frame_image_url is supported
@@ -263,8 +275,8 @@ interface V3OmniImageToVideoParams {
263
275
  aspect_ratio?: KlingAspectRatio;
264
276
  callback_url?: string;
265
277
  }
266
- type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams | V3OmniReferenceTextToVideoParams;
267
278
  type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | KlingO1ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
279
+
268
280
  /** Continue a completed Kling V2.5 Turbo video task. */
269
281
  interface KlingExtendVideoParams {
270
282
  source_task_id: string;
@@ -345,21 +357,18 @@ interface MotionControlCommonParams {
345
357
  prompt?: string;
346
358
  callback_url?: string;
347
359
  }
348
- /** Kling 3.0 motion transfer with explicit resolution and optional orientation and background controls. */
360
+ /** Kling 3.0 motion transfer with explicit resolution and optional character orientation. */
349
361
  interface Kling3MotionControlParams extends MotionControlCommonParams {
350
362
  model: (typeof modelValues.motionControl.KLING_3_0);
351
363
  output_resolution: '720p' | '1080p';
352
364
  /** Whether the character faces the direction from the video or the image. */
353
365
  character_orientation?: 'video' | 'image';
354
- /** Whether the background comes from the video or the image. */
355
- background_source?: 'video' | 'image';
356
366
  }
357
367
  /** Kling 2.6 motion transfer with explicit resolution and character orientation. */
358
368
  interface KlingV26MotionControlParams extends MotionControlCommonParams {
359
369
  model: (typeof modelValues.motionControl.KLING_V2_6);
360
370
  output_resolution: '720p' | '1080p';
361
371
  character_orientation: 'video' | 'image';
362
- background_source?: never;
363
372
  }
364
373
  type MotionControlParams = Kling3MotionControlParams | KlingV26MotionControlParams;
365
374
  interface MotionControlResponse extends AsyncTaskResponse {
@@ -536,4 +545,4 @@ declare class KlingClient extends BaseClient {
536
545
  constructor(options?: ClientOptions);
537
546
  }
538
547
 
539
- export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type EditVideoParams, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingEditVideoModel, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniReferenceTextToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
548
+ export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type EditVideoParams, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoAutomaticShotParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingEditVideoModel, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniReferenceTextToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "runapi": {
4
4
  "slug": "kling"
5
5
  },
6
- "version": "0.5.0",
6
+ "version": "0.6.1",
7
7
  "description": "RunAPI Kling SDK for text-to-video, image-to-video, source-video editing, avatar, and motion-control workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.mjs",
@@ -31,16 +31,16 @@
31
31
  "clean": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@runapi.ai/core": "^0.5.0"
34
+ "@runapi.ai/core": "^0.5.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.0.0",
38
- "@vitest/coverage-v8": "^1.6.0",
38
+ "@vitest/coverage-v8": "^4.1.11",
39
39
  "dotenv-cli": "^11.0.0",
40
40
  "tsup": "^8.0.0",
41
41
  "tsx": "^4.7.0",
42
42
  "typescript": "^5.4.0",
43
- "vitest": "^1.6.0"
43
+ "vitest": "^4.1.11"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -58,7 +58,7 @@ const result = await client.textToVideo.run({
58
58
  const url = result.videos[0].url;
59
59
  ```
60
60
 
61
- Kling 2.6 uses `model: 'kling-v2.6'` for text-to-video, image-to-video, and motion control. Set `mode: 'pro'` before enabling sound; final-frame image-to-video requests also use `duration_seconds: 5`. Motion control requires `source_image_url`, `output_resolution`, and `character_orientation`; its `reference_video_url` may be 3-10 seconds for image orientation or 3-30 seconds for video orientation. Omit `background_source`.
61
+ Kling 2.6 uses `model: 'kling-v2.6'` for text-to-video, image-to-video, and motion control. Set `mode: 'pro'` before enabling sound; final-frame image-to-video requests also use `duration_seconds: 5`. Motion control requires `source_image_url`, `output_resolution`, and `character_orientation`; its `reference_video_url` may be 3-10 seconds for image orientation or 3-30 seconds for video orientation.
62
62
  Kling O1 uses `model: 'kling-o1'` with ordered public HTTP(S) `reference_image_urls` and an optional public HTTP(S) `reference_video_url`. Mention every supplied item in `prompt` as `<<<image_1>>>`, `<<<image_2>>>`, or `<<<video_1>>>`. With a video, at most four images are allowed. Do not combine `last_frame_image_url` with reference images or a reference video. Use `feature` with the required first frame; `base` cannot be combined with frame inputs. Use a five-second request and keep sound disabled.
63
63
  Kling V3 Omni uses `model: 'kling-v3-omni'` for both text-to-video and image-to-video. Image-to-video requires `first_frame_image_url`; final-frame requests also use `duration_seconds: 5`.
64
64
  Use `kling-v3-omni-reference` with text-to-video for image-only reference inputs. For a source video, use edit-video with either `kling-v3-omni-reference` or `kling-v3-omni-edit`; the reference model keeps sound disabled.
@@ -23,6 +23,8 @@ metadata:
23
23
 
24
24
  # Kling on RunAPI
25
25
 
26
+ Retired versions below are historical references only. Do not select them for a new request.
27
+
26
28
  ## Choose route
27
29
 
28
30
  - For a one-off artifact or result, use the registered `kling` service in the `runapi` CLI. If the installed command catalog does not list it, stop and report the missing service instead of inventing a command.
@@ -50,6 +52,11 @@ Traverse nested objects and arrays before execution. Close every relationship st
50
52
 
51
53
  For a discovered local media input, including file-typed fields and top-level media URL fields, put an agent-readable local file path directly in `request.json`. The CLI consumes file fields as declared and uploads local paths in top-level media URL fields. Use `runapi files create` only when the user needs a reusable URL, provides Base64, or the discovered contract explicitly requires a separate upload.
52
54
 
55
+ Semantic invariants:
56
+ - For Kling 3.0 multi-shot, use `multi_shots: true`. `shot_type` accepts `custom` or `automatic` and defaults to `custom` only in multi-shot mode. Omit `shot_type` for single-shot requests.
57
+ - Custom storyboards require 1-6 `multi_prompt` shots with integer durations from 1-12 seconds. Their sum must equal the total `duration_seconds` from 3-15, default 5. Each shot prompt allows 500 effective characters, with each named `@element` reference counting as 37.
58
+ - Automatic storyboarding requires `prompt` and omits `multi_prompt`. `enable_sound` is optional for multi-shot requests.
59
+
53
60
  Validate the file before sending it:
54
61
 
55
62
  ```shell
@@ -115,9 +122,7 @@ Use this route only for application or production-code integration. Open the cur
115
122
  - `kling-3.0`: https://runapi.ai/models/kling/3.0.md
116
123
  - `kling-ai-avatar-pro`: https://runapi.ai/models/kling/ai-avatar-pro.md
117
124
  - `kling-ai-avatar-standard`: https://runapi.ai/models/kling/ai-avatar-standard.md
118
- - `kling-ai-avatar-v1-pro`: https://runapi.ai/models/kling/ai-avatar-v1-pro.md
119
125
  - `kling-o1`: https://runapi.ai/models/kling/o1.md
120
- - `kling-v1-avatar-standard`: https://runapi.ai/models/kling/v1-avatar-standard.md
121
126
  - `kling-v2.1-master-image-to-video`: https://runapi.ai/models/kling/v2.1-master-image-to-video.md
122
127
  - `kling-v2.1-master-text-to-video`: https://runapi.ai/models/kling/v2.1-master-text-to-video.md
123
128
  - `kling-v2.1-pro`: https://runapi.ai/models/kling/v2.1-pro.md
@@ -130,3 +135,11 @@ Use this route only for application or production-code integration. Open the cur
130
135
  - `kling-v3-omni-reference`: https://runapi.ai/models/kling/v3-omni-reference.md
131
136
  - `kling-v3-turbo-image-to-video`: https://runapi.ai/models/kling/v3-turbo-image-to-video.md
132
137
  - `kling-v3-turbo-text-to-video`: https://runapi.ai/models/kling/v3-turbo-text-to-video.md
138
+
139
+ ## Retired references
140
+ - `kling-ai-avatar-v1-pro` (retired 2026-10-14): https://runapi.ai/models/kling/ai-avatar-v1-pro.md
141
+ This model ID is not mapped to another model.
142
+ - `kling-v1-avatar-standard` (retired 2026-10-14): https://runapi.ai/models/kling/v1-avatar-standard.md
143
+ This model ID is not mapped to another model.
144
+
145
+ New requests for these versions return HTTP 410 before task creation or balance deduction. Existing task IDs remain queryable through the task-status API. Do not retry task creation with a retired model ID.