DEV Community

useapi.net
useapi.net

Posted on Edited on Originally published at useapi.net

How to Generate Kling 4.0 Video via the Kling API

Introduction

Kling 4.0 launched in the Kling app on October 15, 2026, and Kling's own developer API still lists it as coming soon (as of October 18, 2026), so the way to call it from code today is the useapi.net Kling API: send "model_name": "kling-v4-0" to POST /videos/text2video and it runs on your Kling AI website subscription. useapi.net is a third-party API, not affiliated with Kling AI or Kuaishou Technology. Kling 4.0 makes 3 to 30 second clips at 720p or 1080p, always with a stereo soundtrack, and adds the 21:9 aspect ratio and keyframes between the start and end frames.

This guide is one real run. We asked Kling 4.0 for the cheapest clip it makes, 3 seconds at 720p, on a Kling Pro subscription. The job finished in about 2 minutes and took 27 Kling credits off the balance (300,290 to 297,590 in the account's hundredths of a credit), about $0.30 at the Pro plan's credit price. Every response below is from that run, with the account email left out.

Before you start

You need a useapi.net API token and a Kling account connected through Setup Kling. Kling 4.0 at 1080p needs a paid Kling plan. Export the token so the curl examples run as they are:

export USEAPI_TOKEN="user:1234-..."      # your useapi.net API token
export KLING_EMAIL="you@example.com"     # your connected Kling account
Enter fullscreen mode Exit fullscreen mode

email is optional in the request body: without it, the API picks one of your Kling accounts that has a free job slot (429 when every account is busy). With more than one account, note which account ran the job (GET tasks/task_id explains how to find it), because polling the task needs that account's email. If Kling hasn't opened Kling 4.0 to your account yet, the create call returns 403 with AUTH.VPrivilegeEscalation, and nothing is charged.

Kling 4.0 at a glance

Kling 4.0 (kling-v4-0)
Duration 3 to 30 seconds, default 5
Resolution std 720p, pro 1080p (paid Kling plan). No 4K or HDR yet
Aspect ratio 16:9, 9:16, 1:1, 21:9
Audio Always on, stereo
Prompt Up to 8000 characters
Shots Kling may cut the clip into several shots, or you write up to 6 shot prompts (15 seconds in total)
Credits per second 10 at 720p, 15 at 1080p (Kling Pro, Premier and Ultra+ subscribers pay 10% less)

The same model is on three endpoints: text-to-video, image-to-video with start, end and keyframe images, and Omni with reference images, elements, videos and voices. The credit price is the same on all three.

Generate a Kling 4.0 video in two calls

Generation is asynchronous. The create call answers right away with a task, and you poll the task until it is final.

1. Submit the job

POST /videos/text2video with model_name set to kling-v4-0:

curl -s -X POST "https://api.useapi.net/v1/kling/videos/text2video" \
  -H "Authorization: Bearer $USEAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "'"$KLING_EMAIL"'",
    "model_name": "kling-v4-0",
    "mode": "std",
    "duration": "3",
    "aspect_ratio": "16:9",
    "prompt": "A small paper boat sails across a rain puddle on a city sidewalk at dusk, neon signs reflect and ripple in the water, raindrops patter around it and a tram bell rings in the distance, low camera at water level"
  }'
Enter fullscreen mode Exit fullscreen mode

The answer came back in about a second. The parts that matter, from our run:

{
  "task": {
    "id": 324332112308198,
    "type": "m2v_aio2video",
    "status": 5,
    "status_name": "submitted",
    "status_final": false
  },
  "works": [],
  "status": 5,
  "status_name": "submitted",
  "status_final": false,
  "message": "",
  "userPoints": {
    "points": [],
    "total": 297590
  }
}
Enter fullscreen mode Exit fullscreen mode

task.id is the id you poll. userPoints.total is the balance after the charge, in hundredths of a credit, so 297590 is 2,975.90 credits. The task's arguments echo what Kling received: kling_version 4.0, model_mode std, enable_audio true and prefer_multi_shots true. Kling 4.0 always turns audio on, and it may cut the clip into shots on its own. The create call is the paid step, so don't resend it after a timeout. Poll or list your tasks instead.

2. Poll for the result

GET /tasks/task_id:

curl -s "https://api.useapi.net/v1/kling/tasks/324332112308198?email=$KLING_EMAIL" \
  -H "Authorization: Bearer $USEAPI_TOKEN"
Enter fullscreen mode Exit fullscreen mode

Ours read processing for about 2 minutes, then:

{
  "status": 99,
  "status_name": "succeed",
  "status_final": true,
  "works": [
    {
      "workId": 324332112317252,
      "status_name": "succeed",
      "resource": {
        "resource": "https://v15-kling.klingai.com/bs2/upload-ylab-stunt-sgp/....mp4",
        "height": 720,
        "width": 1280,
        "duration": 3041
      }
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The MP4 is 1280×720, 3.04 seconds, H.264 video with a two-channel AAC soundtrack. A task is done when status_final is true, and status_name: "succeed" means it worked. The other final statuses are failures, listed on GET /tasks/task_id. Pass a replyUrl in the create body if you'd rather get a webhook than poll.

3. Download the master

Free Kling plans get a watermarked works[0].resource.resource. On a paid plan, GET /assets/download returns a cdnUrl to the clean file:

curl -s "https://api.useapi.net/v1/kling/assets/download?email=$KLING_EMAIL&workIds=324332112317252&fileTypes=MP4" \
  -H "Authorization: Bearer $USEAPI_TOKEN"
Enter fullscreen mode Exit fullscreen mode

Longer, wider and 1080p

Change three fields and keep the rest. A 10-second 1080p cinema-wide clip:

{
  "model_name": "kling-v4-0",
  "mode": "pro",
  "duration": "10",
  "aspect_ratio": "21:9",
  "prompt": "..."
}
Enter fullscreen mode Exit fullscreen mode

That costs 150 credits (15 per second), or 135 on a Kling Pro or Ultra plan. duration goes up to 30. To direct the cuts yourself, send shot_1_prompt with shot_1_duration, shot_2_prompt with shot_2_duration and so on, up to 6 shots and 15 seconds in total, in place of prompt and duration. negative_prompt and cfg_scale don't apply to Kling 4.0.

Image-to-video with keyframes

POST /videos/image2video-frames with model_name: kling-v4-0 takes a start frame (image, required), an optional end frame (image_tail) and up to 9 keyframes in between (keyframe_1 to keyframe_9), in order. That is up to 10 images in total, and at most the duration in seconds plus one, so a 5-second clip takes up to 6 images. Upload each image with POST /assets first and pass the returned URLs:

curl -s -X POST "https://api.useapi.net/v1/kling/videos/image2video-frames" \
  -H "Authorization: Bearer $USEAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "'"$KLING_EMAIL"'",
    "model_name": "kling-v4-0",
    "mode": "std",
    "duration": "5",
    "image": "https://example.com/start.jpg",
    "keyframe_1": "https://example.com/middle.jpg",
    "image_tail": "https://example.com/end.jpg",
    "prompt": "the boat drifts from the puddle into the gutter stream"
  }'
Enter fullscreen mode Exit fullscreen mode

The aspect ratio comes from the start image. You poll and download the result the same way as above.

Omni with references and voices

POST /videos/omni with omni_version: v4 runs Kling 4.0 with up to 10 reference images, 7 elements (IMAGE and VIDEO), 5 reference videos of 3 to 30 seconds each (30 seconds in total) and 3 voices, including your own voice saved with POST /videos/voices. Reference them in the prompt as @image_1, @video_1 or @voice_1. Omni 4.0 doesn't take start and end frames, so use image-to-video above for those. The Kling Omni tutorial walks through the reference workflows.

Batch-generate with the script

The kling-4 example in the kling-api GitHub repo reads Kling 4.0 prompts from prompts.json (text-to-video, 21:9 and multi-shot) or prompts-frames.json (start, end and keyframe images), checks each one against the documented limits before it spends credits, submits it, polls the task and downloads the clean master. Run it with Node.js v21 or newer:

git clone https://github.com/useapi/kling-api.git
cd kling-api/kling-4
node ./kling4.mjs "$USEAPI_TOKEN" "$KLING_EMAIL"
Enter fullscreen mode Exit fullscreen mode

The Kling v3 tutorial explains the script line by line.

What it costs

Kling 4.0 uses the credits of your Kling AI website subscription, at the rates in the table above, and useapi.net adds no per-video charge. On Kling Pro ($32.56 a month for 3,000 credits), that comes to about $0.10 a second at 720p and $0.15 at 1080p, so a 5-second 720p video uses 45 credits and the plan makes about 66 of them a month (as of October 2026). The cost calculator on the Kling API page prices every model on each Kling plan.

Kling's own developer API sells prepaid video packs from $700 instead, separate from the app subscriptions (as of October 2026).

The same from an AI assistant

The hosted Kling MCP server at https://api.useapi.net/v1/kling/mcp exposes the same calls as 45 tools for Claude Code, Cursor and VS Code, Kling 4.0 included. Ask for "a 5-second Kling 4.0 clip of …" and the assistant calls kling_text_to_video with model_name: kling-v4-0 on your account.

Examples

Kling 4.0 » kling-v4-0, text-to-video, std 720p, 3 seconds, 16:9, the run above

The prompt is in step 1. 27 Kling credits on a Pro plan, about 2 minutes, with its stereo soundtrack.

Frequently asked questions

Is there a Kling 4.0 API? Through useapi.net, yes: the Kling API already runs Kling 4.0 on your Kling AI website subscription, from a prompt, from start, end and key frames, or from Omni references and voices. Kling's own developer site lists the Kling 4.0 API as coming soon (as of October 18, 2026), and its developer plans are sold separately from the app subscriptions.

What is the model name for Kling 4.0? Through useapi.net, Kling 4.0 is kling-v4-0 in the model_name field of POST /videos/text2video and POST /videos/image2video-frames, and omni_version: v4 on POST /videos/omni. negative_prompt and cfg_scale don't apply to it, and the credit price is the same on all three endpoints.

Does Kling 4.0 need a paid Kling plan? Through useapi.net, Kling 4.0 at 720p (mode: std) runs on every Kling AI website subscription, and 1080p (mode: pro) needs a paid one. A 403 with AUTH.VPrivilegeEscalation means Kling hasn't opened the model to that account yet, and nothing is charged. On Kling Pro, Premier and Ultra+, every Kling 4.0 video costs 10% less.

Can I turn audio off? Through useapi.net, no: Kling 4.0 always makes a stereo soundtrack and doesn't accept enable_audio, so leave the field out. Our test video came back with two-channel AAC audio next to H.264 video. For a video without sound, use Kling v3 (kling-v3-0) instead, where enable_audio: false turns the sound off.

How long can a Kling 4.0 video be? Through useapi.net, a Kling 4.0 video runs 3 to 30 seconds in one generation, set with duration, while Kling v3 stops at 15 seconds. When you write the shots yourself with shot_1_prompt to shot_6_prompt, the total stays within 15 seconds, and a single prompt may still be cut into several shots by Kling.

Do I need a Kling developer account or API key? Through useapi.net, no: you need a useapi.net API token and a Kling account connected once through Setup Kling, with no Kling developer account and no prepaid pack. The same token works on the hosted Kling MCP server, so Claude Code, Cursor or VS Code can make Kling 4.0 videos for you.

Conclusion

Kling 4.0 is one field away from any Kling call you already make: set model_name to kling-v4-0 and pick a duration up to 30 seconds. The full model reference is on the Kling API page, and the runnable code is in the kling-api GitHub repo.

Visit our Discord Server or Telegram Channel for any support questions and concerns.

Top comments (0)