Kling 4.0

KlingVideo generationper-requestTiered pricing

Kling 4.0 asynchronous video generation with sound. Text-to-video, first/last-frame generation and omni references at 720p or 1080p for 3-30 seconds: up to 10 reference images and up to 5 reference videos, or one video to edit. Name references in the prompt as @image_1 and @video_1. With a reference video or an edit, billed for output plus the longer of output and input seconds, at 60% of the rate.

Price

$0.133/s

Max

$0.1197/s

Endpoint

/videos

Delivery pattern

Async task lifecycle

Availability

Available now

API documentation

Build and copy the request

Choose the options this model accepts. The code below updates as you choose.

Step-by-step in the docs
POSThttps://apiking.ai/v1/videosBearer API keyAsync task

OptionsOnly options published for this model are shown.

# Requires curl and jq
API_KEY="${API_KEY:-YOUR_API_KEY}"

# 1. Submit once
SUBMITTED=$(curl --fail-with-body -sS https://apiking.ai/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: model-docs-$(date +%s)-$$" \\
  -d '{
  "model": "Kling 4.0",
  "prompt": "A cinematic scene with careful composition",
  "duration": 5,
  "resolution": "720p",
  "size": "16:9"
}')
TASK_ID=$(printf '%s' "$SUBMITTED" | jq -r '.task_id // .id // empty')
if [ -z "$TASK_ID" ]; then
  printf '%s\n' "$SUBMITTED" >&2
  exit 1
fi
echo "task_id=$TASK_ID"

# 2. Poll until terminal
while true; do
  STATUS_JSON=$(curl --fail-with-body -sS \
    "https://apiking.ai/v1/videos/$TASK_ID" \
    -H "Authorization: Bearer $API_KEY")
  STATUS=$(printf '%s' "$STATUS_JSON" | jq -r '.status // empty' | tr '[:upper:]' '[:lower:]')
  echo "status=$STATUS"
  case "$STATUS" in
    completed|succeeded|success) break ;;
    failed|failure|cancelled|canceled)
      printf '%s\n' "$STATUS_JSON" | jq .
      exit 1
      ;;
  esac
  sleep 5
done

# 3. Fetch the final result
curl --fail-with-body -sS \
  "https://apiking.ai/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer $API_KEY" | jq .
  1. 1Submit the task
  2. 2Poll the status
  3. 3Fetch the content

This model requires public media URLs. Upload a local file first, then put public_url into the model request. Avoid large Base64 bodies.

Read the upload guide

Parameter reference

model
stringrequired

Exact model identifier for this request.

kling-4.0
prompt
stringrequired

Video prompt. Name references by position as @image_1 and @video_1, and say what each one is for.

duration
integeroptional

Output seconds from 3 to 30.

resolution
stringoptional

Requested output resolution.

720p1080p
size
stringoptional

adaptive needs a reference image or video.

16:99:161:121:9adaptive
images
string[]optional

One public URL is the first frame; two are first and last frames. Three or more, anything beside a video, or image_reference_mode=multi are references.

videos
string[]optional

Public mp4/mov clips, 3-30 seconds in all, 700-4553 px, up to 300 MB each.

Response lifecycle

Task status, terminal states, and result response examples.

Submit
{
  "id": "task_xxx",
  "task_id": "task_xxx",
  "object": "video",
  "model": "Kling 4.0",
  "status": "queued"
}

Waiting

queued · submitted · in_progress · processing

Success

completed · succeeded · success

Failure

failed · failure · cancelled · canceled

Errors and production

Retry rules, idempotency, and the minimum production checklist.

400 / 422

Fix the request fields or unsupported option; do not retry unchanged.

401

Check that the API key is present, active, and sent as a Bearer token.

402

The account balance is insufficient.

409

The Idempotency-Key is processing or was reused with another body.

429

Back off according to Retry-After before retrying.

5xx

Retry with exponential backoff and keep the original Idempotency-Key.

  • Keep API keys on your server for public mobile and browser applications.
  • Set a unique Idempotency-Key for every billable async operation.
  • Persist task_id so polling can resume after a restart.
  • Use a timeout for every HTTP request and surface the request ID in support reports.
  • Read live model metadata instead of hard-coding prices and supported options.

Price and tiers

List price, for everyone.

Per-second price · 720p

$0.133/s

Tiered pricing

Billed per second of generated output.

With a reference video or an edit, you pay for the generated seconds plus the longer of the generated clip and the reference video, at 60% of the price.

ResolutionPrice
720p$0.133/s
1080p$0.1995/s

The price shown here is exactly what you are billed — failed calls are refunded automatically.

Kling 4.0 at a glance

Model ID
Kling 4.0
Type
Video generation
Vendor
Kling
Resolutions
720p · 1080p
Aspect ratios
16:9 · 9:16 · 1:1 · 21:9
Reference inputs
Up to 10 images · Up to 5 videos
Endpoint
POST /v1/videos
Delivery
Async task: poll it or get a webhook
Billed by
Per second of output

What Kling 4.0 costs

  • A 5-second 720p video$0.665
  • A 10-second 720p video$1.33
  • A 5-second 1080p video$0.9975
  • A 10-second 1080p video$1.995

At the list price. Failed calls are not charged.

Common questions

How much does the Kling 4.0 API cost?

Kling 4.0 costs $0.133/s on APIKing. Pay as you go from your balance.

How do I call the Kling 4.0 API?

Send a request to https://apiking.ai/v1/videos with your APIKing key as a Bearer token and set the model to Kling 4.0. The call returns a task. Poll it until it finishes, or set a webhook to be told when it does.

What is the model ID of Kling 4.0?

Set the model parameter to Kling 4.0.

Which resolutions and lengths does Kling 4.0 support?

Resolutions: 720p, 1080p.

Can Kling 4.0 work from reference images or videos?

Yes. Reference inputs: Up to 10 images · Up to 5 videos.

Am I charged when a Kling 4.0 call fails?

A failed call or a failed generation is not charged. Tasks are estimated first and settled at what they actually used.

Compare Kling 4.0 with similar models

ModelVendorPriceSpec
Kling 4.0KlingFrom $0.133/sUp to 1080p
Wan 3.0WanFrom $0.028109/sUp to 1080P · up to 30 s
Grok Imagine 1.5 VideoGrokFrom $0.009996/sUp to 720p · up to 15 s
Muse Video ExtMeta$0.02305 / requestUp to 720p · up to 10 s
Seedance 2.0 MiniByteDanceFrom $0.016381/sUp to 720p · up to 15 s
Seedance 2.5ByteDanceFrom $0.086712/sUp to 1080p · up to 30 s