Skip to content
中文
Kling · Model API

Kling 4.0 Flash API Pricing

Kling 4.0 Flash API with VezAPI. Explore model capabilities, credit pricing, request parameters, and integration examples.

Text to VideoImage to Video

Kling 4.0 Flash API documentation

Integrate Kling 4.0 Flash with your VezAPI key. The operations below share the same authentication and account balance.

Base URL: https://api.vezapi.com
Send Authorization: Bearer YOUR_VEZAPI_KEY. Use a unique Idempotency-Key for each submission; reuse it only when checking the same request.

Kling 4.0 Flash Keyframe To Video

POST/api/v1/jobs/createTask

Model IDs: kling-4.0/flash-keyframe-to-video

ParameterTypeDescription & constraints
model
required
string

The name of the model used to generate the task. This field is required. - This endpoint requires the `kling-4.0/flash-keyframe-to-video` model

Values: "kling-4.0/flash-keyframe-to-video"

Default: "kling-4.0/flash-keyframe-to-video"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task.

input.prompt
required
string

Video description. Required. Maximum 8000 characters. When `first_frame_url` is provided, mention it as `@first_frame`. Middle frames and a last frame are not supported on Kling 4.0 Flash — sending `keyframes` or `last_frame` is rejected.

minLength: 1

maxLength: 8000

input.duration
optional
integer

Output video duration in seconds. Integer from 3 to 20. Default: `5`.

Default: 5

minimum: 3

maximum: 20

input.resolution
optional
string

Output resolution. Kling 4.0 Flash only supports `720p`. Default: `720p`.

Values: "720p"

Default: "720p"

input.aspect_ratio
optional
string

Output aspect ratio. `16:9`, `9:16`, `1:1`, or `21:9`. There is no `auto`. Only used when `first_frame_url` is omitted (text-to-video); default `16:9`. When a first frame is provided, the output follows that image's aspect ratio.

Values: "16:9", "9:16", "1:1", "21:9"

input.first_frame_url
optional
string

Optional first-frame image URL. Mention it in the prompt as `@first_frame`. If omitted, the request is plain text-to-video. Middle frames (`keyframes`) and a last frame (`last_frame`) are not supported.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling-4.0/flash-keyframe-to-video",
  "input": {
    "prompt": "Animate the supplied image as one continuous 10-second shot. Keep the camera fixed to the opposite bench as the gondola ascends. Preserve the skier’s face, the goggles on her helmet, and the embroidered “KIE AI” patch.\nREFERENCES: @first_frame is the exact opening frame.",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }
}'
Responses and errors

HTTP 200

Request Successful

ParameterTypeDescription & constraints
code
optional
integer

Response status code - **200**: Success - Request has been processed successfully - **401**: Unauthorized - Authentication credentials are missing or invalid - **402**: Insufficient Credits - Account does not have enough credits to perform the operation - **404**: Not Found - The requested resource or endpoint does not exist - **422**: Validation Error - The request parameters failed validation checks - **429**: Rate Limited - Request limit has been exceeded for this resource - **433**: Request Limit - Sub-key Usage Exceeds Limit - **455**: Service Unavailable - System is currently undergoing maintenance - **500**: Server Error - An unexpected error occurred while processing the request - **501**: Generation Failed - Content generation task failed - **505**: Feature Disabled - The requested feature is currently disabled

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description when failed

data
required
object
data.taskId
required
string

Task ID, can be used with Get Task Details endpoint to query task status

Kling 4.0 Flash Reference To Video

POST/api/v1/jobs/createTask

Model IDs: kling-4.0/flash-reference-to-video

ParameterTypeDescription & constraints
model
required
string

The name of the model used to generate the task. This field is required. - This endpoint requires the `kling-4.0/flash-reference-to-video` model

Values: "kling-4.0/flash-reference-to-video"

Default: "kling-4.0/flash-reference-to-video"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task.

input.prompt
required
string

Video description. Required. Maximum 8000 characters. Use `@` to mention assets uploaded in this request: - `@image_1`, `@image_2`, … map to `image_urls` in order (1-based) - `@video_1`, `@video_2`, … map to `video_urls` - `@name` maps to the `name` of an item in `elements` Every `@` mention must match an asset included in this request, otherwise the request is rejected. Mentions use longest-match against declared names. If the matched name ends with a letter, digit, or underscore, the next character cannot be a letter, digit, or underscore.

minLength: 1

maxLength: 8000

input.duration
optional
integer

Output video duration in seconds. Integer from 3 to 20. Default: `5`.

Default: 5

minimum: 3

maximum: 20

input.resolution
optional
string

Output resolution. Kling 4.0 Flash only supports `720p`. Default: `720p`.

Values: "720p"

Default: "720p"

input.aspect_ratio
optional
string

Output aspect ratio. Optional. - If omitted and any reference asset is provided, the model uses `auto` - If omitted and no reference asset is provided, the model uses `16:9`

Values: "auto", "16:9", "9:16", "1:1", "21:9"

input.image_urls
optional
array

Reference images, up to 10 publicly accessible URLs. Mention them in the prompt as `@image_1`, `@image_2`, … in array order.

Default: []

maxItems: 10

input.video_urls
optional
array

Reference videos, up to 5 publicly accessible URLs. Mention them in the prompt as `@video_1`, `@video_2`, …. Reference videos plus video subjects in `elements` cannot exceed 5 in total. Combined duration of all reference videos and video elements must be 2–20 seconds; if it is outside that range the completion callback returns a failure.

Default: []

maxItems: 5

input.keep_original_sound
optional
boolean

Whether to keep the original audio of the reference videos. Only takes effect when `video_urls` is provided. Default: `false`. If no reference video is provided, native audio is always generated.

Default: false

input.elements
optional
array

Subjects used only for this task. Up to 7 items, of which at most 3 can be video subjects. Mention them in the prompt as `@name`. `image_urls`, `video_urls`, and `elements` together cannot exceed 15 items. Standalone `voices` is not supported on Flash.

Default: []

maxItems: 7

input.elements[].name
required
string

The name used in the prompt as `@Hero`. 1–20 characters; Chinese, letters, digits, and underscore only. Must be unique across `elements` (case-insensitive). Reserved names (case-insensitive, N is a number) cannot be used: `image_N`, `video_N`, `keyframe_N`, `object_N`, `audio_N`, `first_frame`, `last_frame`.

input.elements[].image_urls
optional
array

2–4 publicly accessible image URLs for an image subject. Cannot be used together with `video_url`. The first image is the primary view (front face or main angle); the rest are supporting views. Required when `type` is `image` or omitted.

minItems: 2

maxItems: 4

input.elements[].video_url
optional
string

Character video URL for a video subject. Cannot be used together with `image_urls`. One video, 3–8 seconds, a single continuous shot (no cuts), shortest side at least 700 pixels. Required when `type` is `video`.

input.elements[].tag
optional
string

Subject category. Optional for image subjects — if omitted, it is inferred from the primary image. Video subjects are always `character`; any other value is rejected.

Values: "character", "animal", "prop", "costume", "scene", "effect", "others"

input.elements[].description
optional
string

Optional subject description. Maximum 100 characters.

maxLength: 100

input.elements[].voice_url
optional
string

Optional reference audio bound to this subject. It cannot be mentioned with `@` on its own. Only character subjects can bind audio: for image subjects `tag` must be `character` or omitted; for video subjects, if omitted the video's original speech is used by default. Standalone `voices` is not supported on Kling 4.0 Flash.

input.elements[].type
optional
string

Subject type. Optional, default `image`. - `image`: use `image_urls` (2–4 images of the same subject; first is the primary view). Do not send `video_url`. - `video`: use `video_url` (one 3–8 second single-shot character video). Do not send `image_urls`. Video subjects are always `character`.

Values: "image", "video"

Default: "image"

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling-4.0/flash-reference-to-video",
  "input": {
    "prompt": "Replace the environment and characters throughout the video with the content from Image.",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "auto"
  }
}'
Responses and errors

HTTP 200

Request Successful

ParameterTypeDescription & constraints
code
optional
integer

Response status code - **200**: Success - Request has been processed successfully - **401**: Unauthorized - Authentication credentials are missing or invalid - **402**: Insufficient Credits - Account does not have enough credits to perform the operation - **404**: Not Found - The requested resource or endpoint does not exist - **422**: Validation Error - The request parameters failed validation checks - **429**: Rate Limited - Request limit has been exceeded for this resource - **433**: Request Limit - Sub-key Usage Exceeds Limit - **455**: Service Unavailable - System is currently undergoing maintenance - **500**: Server Error - An unexpected error occurred while processing the request - **501**: Generation Failed - Content generation task failed - **505**: Feature Disabled - The requested feature is currently disabled

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description when failed

data
required
object
data.taskId
required
string

Task ID, can be used with Get Task Details endpoint to query task status

Task status and callbacks

For asynchronous tasks, keep the returned taskId. Query GET /api/v1/jobs/recordInfo?taskId=... or provide callBackUrl when creating the task. Only the account that created a task can access it or derive new resources from it.

A timeout can mean the submission was accepted. Inspect the existing request in your dashboard; do not create another task automatically. Callback delivery is retried and may arrive more than once. Deduplicate with X-VezAPI-Event-Id.

Files, logs and billing

Generated media normally follows a 14-day provider lifetime; uploaded files expire after 24 hours. Save the files you need before expiration. VezAPI streams registered files without keeping a permanent media library. Request logs are retained for two calendar months.

Credits are reserved before submission. Final deductions match actual discounted consumption one for one. Unknown usage pauses new paid requests. If available funds cannot cover final usage while protecting other reservations, settlement stays pending until funded; model usage cannot make the wallet negative. Time-based inputs require server-side metadata reads; a failed read prevents submission.

Open full documentation →

Kling 4.0 Flash API pricing

Rates below are reference estimates; final deductions equal actual discounted consumption, one for one. At the standard pack rate, 1,000 credits ≈ $10. Larger packs reduce the effective credit price.

SpecificationCreditsUnitUSD reference
kling 4.0 flash, keyframe-to-video, 720P17per second$0.17
kling 4.0 flash, reference-to-video, 720P with video input11.3per second$0.113
kling 4.0 flash, reference-to-video, 720P no video input17per second$0.17