Kling 4.0 Flash
Use kling-4.0-flash to create video output. This page contains the complete request needed for this model.
Model facts
| Property | Value |
|---|---|
| Model ID | kling-4.0-flash |
| Endpoint | POST /api/v1/generation/create |
| Output | Video |
| Modes | text-to-video, image-to-video, video reference |
| Pricing | View current pricing |
Minimal request
curl -X POST https://api.api-stock.com/api/v1/generation/create \
-H "Authorization: Bearer $API_STOCK_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0-flash",
"input": {
"prompt": "A cinematic scene with soft natural light"
}
}'The create response contains a task ID:
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "not_started",
"createdAt": "2026-08-22T12:00:00.000Z"
}
}Parameters
Parameters belong inside the top-level input object. Unknown fields are rejected.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Describe the video. Address references as @image_1 or @video_1. Up to 2500 characters on the current route. max 2500 chars |
duration | integer | No | 5 | Output duration in seconds, 3–20 min 3, max 20 |
resolution | “720p” | No | "720p" | Flash outputs 720p only |
aspectRatio | “16:9” | “9:16” | “1:1” | “21:9” | “auto” | No | "16:9" | Output aspect ratio. auto adapts to reference media and requires an image or video. |
startFrameUrl | string | No | — | Optional first frame. Counts toward the total of 10 image references. End frames are unavailable. |
imageUrls | string[] | No | — | Reference images, up to 10 including startFrameUrl. The first frame, when supplied, is @image_1. |
videoUrls | string[] | No | — | Feature-reference videos, up to 5. Each must be 3–20 seconds; combined input duration must not exceed 20 seconds. Probed before charging. With video, billable seconds = output + max(total input, output). Editing is unavailable. |
Modes
Minimal generation
{
"model": "kling-4.0-flash",
"input": {
"prompt": "A cinematic scene with soft natural light"
}
}With start frame url
{
"model": "kling-4.0-flash",
"input": {
"prompt": "A cinematic scene with soft natural light",
"startFrameUrl": "https://example.com/input.jpg"
}
}With image urls
{
"model": "kling-4.0-flash",
"input": {
"prompt": "A cinematic scene with soft natural light",
"imageUrls": [
"https://example.com/input.jpg"
]
}
}With video urls
{
"model": "kling-4.0-flash",
"input": {
"prompt": "A cinematic scene with soft natural light",
"videoUrls": [
"https://example.com/input.mp4"
]
}
}Constraints
prompt: maximum 2500 characters.duration: minimum 3; maximum 20.resolution: allowed:720p.aspectRatio: allowed:16:9,9:16,1:1,21:9,auto.- Flash is a separate model: 720p, 3–20 whole output seconds (default 5), and a prompt of at most 2500 characters on the current route.
- Use startFrameUrl for a first frame, imageUrls for references and videoUrls for feature-reference videos. Address them as @image_1 and @video_1; the first frame counts as the first image. At most 10 images including the first frame and 5 videos are accepted. auto requires reference media.
- Each reference video must be 3–20 seconds and all reference videos together must be at most 20 seconds. Their durations are probed before charging, summed and rounded upward once. With video references, billable seconds are output + max(total input, output); the with-video price is per billable second. Without video references, pricing is per output second.
- Native audio is included. The current route exposes no audio switch, end frame, storyboard, video editing, voice references or provider-specific subject IDs. Unsupported fields are rejected.
Invalid types, unsupported enum values, out-of-range numbers, and missing required fields return HTTP 400 with error.code: "invalid_input". Correct the request rather than retrying it unchanged.
Result
Poll the task or provide a top-level webhook URL in the create request:
curl https://api.api-stock.com/api/v1/task/status/$TASK_ID \
-H "Authorization: Bearer $API_STOCK_KEY"A successful media task returns one or more files:
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "finished",
"files": [
{
"fileUrl": "https://s3.api-stock.com/result.mp4",
"fileType": "video"
}
],
"createdTime": "2026-08-22T12:00:00.000Z"
}
}See Tasks and webhooks for terminal statuses, retries and webhook delivery.