Kling 4.0 API (kling-v4) unifies text-to-video, image-to-video, multimodal references, video editing and extension. Generate 3–30s clips in 720p or 1080p, always with stereo audio.
Every video includes a stereo soundtrack.
Transparent pricing with no hidden fees. Pay only for what you use.
| Variant | Tier | GoldCurrent price | Platinum | Diamond | Official | Your savings |
|---|---|---|---|---|---|---|
kling-v4 | 720P-input | 0.94Credits(~$0.094)/sec | 0.893Credits(~$0.0893)/sec | 0.846Credits(~$0.0846)/sec | 1.175Credits(~$0.1175)/sec | 20% |
| 1080P-input | 1.41Credits(~$0.141)/sec | 1.3395Credits(~$0.134)/sec | 1.269Credits(~$0.1269)/sec | 1.7625Credits(~$0.1763)/sec | 20% | |
| 720P | 1.57Credits(~$0.157)/sec | 1.4915Credits(~$0.1492)/sec | 1.413Credits(~$0.1413)/sec | 1.9625Credits(~$0.1963)/sec | 20% | |
| 1080P | 2.35Credits(~$0.235)/sec | 2.2325Credits(~$0.2233)/sec | 2.115Credits(~$0.2115)/sec | 2.9375Credits(~$0.2938)/sec | 20% |
* Actual costs are subject to final output.
Kling 4.0 API (kling-v4) unifies text-to-video, image-to-video, multimodal references, video editing and extension. Generate 3–30s clips in 720p or 1080p, always with stereo audio.
50K+
Active Users
99.9%
Uptime
2x
Faster
—
Cost Savings
Use model kling-v4 for all five workflows. Submit a video task, then query its video-generation endpoint to obtain the result.
Store your key in APIMART_API_KEY and send Authorization: Bearer on each request.
POST /v1/videos/generations with model kling-v4, the prompt and workflow-specific media. Save the returned task ID.
Query GET /v1/tasks/{task_id} until completion, then retrieve the video result. Check the error details if generation fails.
Check the APIMart documentation for integration updates.
curl -X POST https://api.apimart.ai/v1/videos/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v4",
"prompt": "A cinematic tracking shot of a cyclist riding through a sunlit coastal road, gentle ocean breeze and natural motion",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "kling-v4",
"prompt": "A cinematic tracking shot of a cyclist riding through a sunlit coastal road, gentle ocean breeze and natural motion",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}
resp = requests.post(f"{API_BASE}/v1/videos/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["videos"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(10)
else:
raise TimeoutError(f"task {task_id} did not finish in time")curl -X POST https://api.apimart.ai/v1/videos/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v4",
"prompt": "Animate this scene with a slow camera push-in, subtle natural movement and consistent composition",
"resolution": "720p",
"duration": 5,
"image_urls": [
"https://example.com/first-frame.jpg"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | Default: kling-v4 | Fixed model ID: kling-v4. |
prompt | string | Optional | Default: — | Required except for image-to-video, where it may be omitted. |
duration | integer | Optional | Default: 5 | 3–30 whole seconds; default 5. For editing, omission follows the input duration. For extension, this is the new clip length. |
resolution | string | Optional | Default: 720p | 720p or 1080p; default 720p. |
aspect_ratio | string | Optional | Default: — | 16:9, 9:16, 1:1 or 21:9; reference mode also accepts auto. Defaults: text 16:9, image follows first frame, reference auto, edit follows source. Omit for extension. |
image_urls | string[] | Optional | Default: — | Image mode: first frame then optional last frame, at most two. Explicit reference mode and editing: up to ten reference images. |
image_with_roles | object[] | Optional | Default: — | Objects with url and role: first_frame, last_frame, keyframe or reference_image. Up to eight keyframes and ten frame images total; middle_frame is also accepted. |
first_frame_image | string | Optional | Default: — | First-frame image URL for image-to-video. |
last_frame_image | string | Optional | Default: — | Last-frame image URL; in extension, the target end frame. |
video_urls | string[] | Optional | Default: — | Reference videos: up to five and 30 seconds in total. Editing or extension also accepts one entry instead of video_url. |
video_url | string | Optional | Default: — | One source video for edit or extend; set omni_reference_task_type explicitly. Editing requires at least 3 seconds and trims beyond 30. |
audio_urls | string[] | Optional | Default: — | Up to three reference audio clips, each 5–30 seconds. Images, videos and audio together must not exceed 15 files. |
omni_reference_task_type | string | Optional | Default: auto | auto, reference, edit or extend. A standalone video_url requires edit or extend. Explicit reference treats image_urls as reference images. |
audio_setting | string | Optional | Default: — | origin keeps source audio; auto regenerates it. Available for editing and reference mode with video. Editing defaults to origin, reference to auto. Omit for extension. |
Compare Kling video models on APIMart. Check each model’s availability, capabilities and pricing on its own page.
| Model | Best for | Resolution | Duration |
|---|---|---|---|
| Kling 4.0 APIThis page | Text, frame and multimodal generation, video editing and extension, always with stereo audio | 720P / 1080P | 3–30 s |
| Kling 3.0 API | Cinematic text-to-video and image-to-video with first/last-frame control and multi-shot prompts | 720P / 1080P / 4K | 3–15 s |
| Kling 3.0 Omni API | All-in-one generation from text, images and video, with reference roles and video editing | 720P / 1080P / 4K | 3–15 s |
| Kling 3.0 Turbo API | Speed-optimized text-to-video and first-frame image-to-video | 720P / 1080P | 3–15 s |
| Kling Video O1 API | Thinking-driven generation focused on visual fidelity | 720P / 1080P | 5 s / 10 s |
| Kling 2.6 API | Native audio (pro mode), dynamic masks and camera control | 720P / 1080P | 5 s / 10 s |
| Kling Motion Control 2.6 API | Transfer motion from a reference video onto the subject of your image | 720P / 1080P | Follows reference video |
| Kling 3.0 Motion Control API | Newer V3 generation of reference-video motion transfer | 720P / 1080P | Follows reference video |
Five video workflows share one kling-v4 model ID, with frame control, multimodal references and resolution-based pricing.
Create, adapt and continue videos with the five Kling 4.0 workflows.
Create a key, select a workflow and submit your first video task.
Sign in to APIMart, create an API key and fund your balance before paid requests.
Choose text, image, reference, edit or extend; add the required prompt and media, then review the live price.
Submit to POST /v1/videos/generations and query GET /v1/tasks/{task_id} until the task finishes.
Modes, reference limits, pricing, audio and API integration.
Kling 4.0, also called Kling AI 4.0 or Kling4.0, uses model ID kling-v4. Text-only requests generate from text; a first frame selects image mode; reference images, video_urls or audio_urls select reference mode. Set omni_reference_task_type to edit or extend with video_url for those workflows. Kling 4.0 Flash has a separate page.
Image mode requires one first frame and allows one last frame plus up to eight keyframes, with ten frame images total. Reference mode allows ten images, five videos totaling 30 seconds, and three audio clips of 5–30 seconds each, up to 15 files combined. Address them as @Image1, @Video1 and @Audio1 in the prompt.
Text, image, image/audio-only reference generation and extension use output seconds; extension counts only newly generated footage. Editing and reference generation with video use output + max(output, input) at the video-input rate. Input duration is summed, rounded up and capped at 30 seconds. Editing a 3.04-second video without duration produces 4 seconds and bills 8 seconds. Check the live rates on this page. Failed generations are fully refunded; input-duration probe failures return 400 without charge.
Outputs are 720p or 1080p, 3–30 seconds, and always include stereo audio. Text defaults to 16:9, image to the first-frame ratio, reference to auto and editing to the source ratio. Explicit ratios are 16:9, 9:16, 1:1 and 21:9; auto is reference-only. Editing keeps original sound by default; audio_setting auto regenerates it. Reference mode with video can use origin to keep its sound.
Submit POST /v1/videos/generations with model kling-v4, then query GET /v1/tasks/{task_id}. Media must be publicly accessible. Use resolution instead of mode; V3 fields such as multi_shot, multi_prompt, element_list and negative_prompt are unsupported, as is audio false.
No. Extension adds 3–30 seconds after the input’s last frame and returns the original video joined to the new footage. Only new output seconds are billed. You can specify a target last_frame_image or last_frame role. Do not send aspect_ratio or audio_setting; framing is inherited, original audio is preserved and new audio is generated.
Explore more models in the same category.

ViduQ 4 Preview
Vidu Q4 Preview is ShengShu's image-to-video and reference-to-video model. Animate one first frame or combine up to 15 reference images and 3 audio clips into 3–16 second videos at up to 4K, with audio generated by default.

Wan 3.0 Video Prime
Wan 3.0 Prime is the Prime version of Alibaba Cloud's all-in-one Wan 3.0 video model, with general, first-and-last-frame and file or webpage modes and 2–30 second output.

Gemini Omni 1.1 Flash
Gemini Omni 1.1 Flash is a multimodal video model officially released by Google that supports rapid generation, natural language editing, and cinematic-quality visual control. This page connects to the official service through APIMart’s unified video API and uses separate pricing and task logs.

MiniMax H3 Max
MiniMax H3 Max generates video from text and images at 480P, 768P or 1080P with 5–15 second clips, first/last frames, multimodal references and synced audio.