NewMiniMax H3 Lite is live: our cheapest video model, at a launch price until Dec 31. Try it now

OG filename: how-to-use-kling-api-cover-v3.png
All guides
How-to

How to Use the Kling API in 2026

Generate Kling 2.5 Turbo Pro, 2.6, 3.0 and 4.0 videos from your own code with the AiWings API: create a key, send one request, and get a permanent MP4 link. Step by step, in cURL, JavaScript and Python.

·6 min read·

How to Use the Kling API in 2026

Want Kling videos in your own app, script or automation? This guide shows how to make them with the AiWings API, step by step. You use one AiWings key, pay per second of video from your AiWings credits, and get back a permanent link to every MP4. It takes about five minutes from no account to a finished video, and the same key also covers MiniMax H3 and Seedance video and a range of image models.

What you need

  • An AiWings account. Sign in with Google; the Trial Pack ($5 once for 500 credits, valid for 30 days) is the easiest way to try it.
  • An AiWings API key, which you create in the next step.
  • Somewhere to run code on a server: a script, a backend route, a serverless function or an automation tool that can send HTTP requests. Keys don’t work from browser or mobile app code, where anyone could read them.

Step 1: Create an API key

  1. 1Sign in to AiWings and open the API page in your dashboard.
  2. 2Click Create key, give it a name (for example “my-app production”) and, if you like, a monthly credit limit.
  3. 3Copy the key. It starts with aiw_live_ and is shown only once.
  4. 4Save it as an environment variable on the machine or service that will call the API.
export AIWINGS_API_KEY="aiw_live_your_key_here"

The API uses the same credits as AiWings in ChatGPT, Claude and the dashboard, so there’s no separate plan to buy. Every request sends the key in the Authorization header as a Bearer token.

Create an API key

Step 2: Choose a Kling model

Pick the version with the model field. All four work from text or from a start image and are billed per second:

Modelmodel valueResolutionsLengthSound5 seconds fromBest for
Kling 2.5 Turbo Prokling-v2.5-turbo-pro1080p5 or 10 secondsNo45 credits ($0.45) at 1080pFast, low-cost 1080p clips
Kling 2.6kling-v2.61080p5 or 10 secondsOptional, costs more45 credits ($0.45) at 1080p1080p clips with native sound
Kling 3.0kling-v3720p, 1080p, 4K3–15 secondsOptional, costs more105 credits ($1.05) at 720pUp to 4K, with start and end frames
Kling 4.0kling-v4720p, 1080p3–30 secondsNo100 credits ($1.00) at 720pLong shots, up to 8 reference images

Prices are at the top-up rate of $0.01 per credit, and plans include more credits per dollar. Each finished job reports exactly what it cost in its credits field, and GET /v1/models lists every price. The prices above are for silent clips. On Kling 2.6 and 3.0, sound costs more per second: a 5-second clip with sound is 90 credits ($0.90) on Kling 2.6 and 160 credits ($1.60) on Kling 3.0 at 720p. Kling 2.5 Turbo Pro and Kling 4.0 are always silent. Sound is on by default where a model has it, so send "audio": false for the lower price.

Step 3: Make your first video

Send a POST request to /v1/videos with a prompt and the model you picked. This one makes a 5-second 16:9 clip with Kling 2.5 Turbo Pro at 1080p, which costs 45 credits ($0.45):

1# 1. Start the job
2curl https://aiwings.io/api/v1/videos \
3 -H "Authorization: Bearer $AIWINGS_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "prompt": "Slow dolly shot through a neon-lit night market in the rain, steam rising from the food stalls, reflections on the wet street",
7 "model": "kling-v2.5-turbo-pro",
8 "resolution": "1080p",
9 "duration": 5,
10 "aspect_ratio": "16:9"
11 }'
12
13# 2. Check it until status is "succeeded" (or "failed")
14curl "https://aiwings.io/api/v1/videos/VIDEO_ID?wait=30" \
15 -H "Authorization: Bearer $AIWINGS_API_KEY"
POST /v1/videosShell

Creating a video returns right away with an id and status "processing". Videos usually take one to a few minutes, so you check back with GET /v1/videos/{id}. Adding ?wait=30 holds each check open for up to 30 seconds and returns the moment the video is ready, so the loop above makes only a handful of requests.

When status is "succeeded", output.url is a permanent link to the MP4. If a video fails, status is "failed", error.message says why, and the credits are refunded automatically. Every video you make through the API also shows up in your AiWings library.

Step 4: Animate an image

To bring a still image to life, pass a public image URL as first_frame and describe only the motion. On Kling 2.5 Turbo Pro, 3.0 and 4.0 you can also add last_frame, and Kling moves from the first picture to the second. Already made the image with AiWings? Pass its id as source_generation_id instead of a URL.

1# 1. Start the job
2curl https://aiwings.io/api/v1/videos \
3 -H "Authorization: Bearer $AIWINGS_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "prompt": "Slow camera push-in, steam rising from the cup, morning light shifting across the table",
7 "model": "kling-v3",
8 "resolution": "720p",
9 "duration": 5,
10 "audio": false,
11 "first_frame": "https://example.com/coffee-cup.jpg"
12 }'
13
14# 2. Check it until status is "succeeded" (or "failed")
15curl "https://aiwings.io/api/v1/videos/VIDEO_ID?wait=30" \
16 -H "Authorization: Bearer $AIWINGS_API_KEY"
POST /v1/videosShell

With a first frame, Kling follows the shape of your image, so aspect_ratio is ignored. This silent 720p clip costs 105 credits ($1.05); with "audio": true it would be 160 credits ($1.60). Kling 2.6 takes a first frame only, with no last_frame.

Step 5: Guide Kling 4.0 with reference images

Kling 4.0 can follow up to 8 reference_images, such as a person, a product and a place. Pass public image URLs and mention each one in the prompt as @image_1, @image_2 and so on. This 10-second clip at 720p costs 200 credits ($2.00):

1# 1. Start the job
2curl https://aiwings.io/api/v1/videos \
3 -H "Authorization: Bearer $AIWINGS_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "prompt": "The woman in @image_1 walks into the flower shop in @image_2 and picks up a bouquet, handheld camera",
7 "model": "kling-v4",
8 "resolution": "720p",
9 "duration": 10,
10 "aspect_ratio": "16:9",
11 "reference_images": [
12 "https://example.com/woman.jpg",
13 "https://example.com/flower-shop.jpg"
14 ]
15 }'
16
17# 2. Check it until status is "succeeded" (or "failed")
18curl "https://aiwings.io/api/v1/videos/VIDEO_ID?wait=30" \
19 -H "Authorization: Bearer $AIWINGS_API_KEY"
POST /v1/videosShell

Kling 4.0 makes silent videos up to 30 seconds long, at 720p or 1080p. Reference images can’t be combined with first and last frames in one request, so pick one approach per video.

More models with the same key

Your key isn’t limited to Kling. The same key, balance and request format cover every video and image model on AiWings. To switch, change the model field: video models go to POST /v1/videos and image models to POST /v1/images.

Modelmodel valueEndpointFrom
Seedance 2.0seedance-2.0/v1/videos50 credits ($0.50) for 5 seconds at 480p
Seedance 2.5seedance-2.5/v1/videos65 credits ($0.65) for 5 seconds at 480p
MiniMax H3minimax-h3/v1/videos50 credits ($0.50) for 5 seconds at 768p
MiniMax H3 Highspeedminimax-h3-highspeed/v1/videos20 credits ($0.20) for 5 seconds at 768p
MiniMax H3 Liteminimax-h3-lite/v1/videos10 credits ($0.10) for 5 seconds at 480p
Kling 2.5 Turbo Prokling-v2.5-turbo-pro/v1/videos45 credits ($0.45) for 5 seconds at 1080p
Kling 2.6kling-v2.6/v1/videos45 credits ($0.45) for 5 seconds at 1080p
Kling 3.0kling-v3/v1/videos105 credits ($1.05) for 5 seconds at 720p
Kling 4.0kling-v4/v1/videos100 credits ($1.00) for 5 seconds at 720p
GPT Image 2.6 Flaregpt-image-2.6-flare/v1/images7 credits ($0.07) per image
GPT Image 2.6 Sunburstgpt-image-2.6-sunburst/v1/images7 credits ($0.07) per image
GPT Image 2.5 Flaregpt-image-2.5-flare/v1/images2 credits ($0.02) per image
GPT Image 2.5 Sunburstgpt-image-2.5-sunburst/v1/images2 credits ($0.02) per image
GPT Image 2gpt-image-2/v1/images2 credits ($0.02) per image
GPT Image 1.5gpt-image-1.5/v1/images2 credits ($0.02) per image
Nano Banananano-banana/v1/images5 credits ($0.05) per image
Nano Banana 2nano-banana-2/v1/images8 credits ($0.08) per image
Nano Banana Pronano-banana-pro/v1/images19 credits ($0.19) per image
Seedream 5 Liteseedream-5-lite/v1/images5 credits ($0.05) per image
Grok Imaginegrok-imagine/v1/images3 credits ($0.03) per image
Flux Fastflux-fast/v1/images1 credit ($0.01) per image

GET /v1/models returns the same list with every price, size and option, so your code can check what’s available instead of hard-coding it.

See every model with samples

Things to know

  • Sound: Kling 2.6 and 3.0 add native sound unless you send "audio": false, which also lowers the price. Kling 2.5 Turbo Pro and Kling 4.0 are always silent.
  • Lengths: 5 or 10 seconds on Kling 2.5 Turbo Pro and 2.6, 3–15 seconds on Kling 3.0 and 3–30 seconds on Kling 4.0. Any other value returns a 400 error.
  • Aspect ratios: 16:9, 9:16, 1:1, plus 21:9 on Kling 4.0. With a first frame, the video takes the shape of the image instead.
  • Send an Idempotency-Key header with each new job (the JavaScript and Python examples do). If a request times out and you retry with the same key, you get the same job back instead of paying twice.
  • Each key has its own rate limit, and you can give each key a monthly credit cap so a bug in one app can’t spend your whole balance.
  • Output URLs are public but unguessable, like a share link. Download the file to your own storage if you need to control who can see it.

If something goes wrong

  • 401 authentication_failed: the key is missing, mistyped or revoked. Check the Authorization header reads Bearer followed by your key.
  • 400 invalid_request: a field isn’t allowed for that model, for example a resolution or length it doesn’t support. The error’s param names the field to fix.
  • 402 insufficient_credits: your balance can’t cover the video. Top up in the dashboard and send the request again.
  • 403 spend_limit_reached: this key hit its monthly credit limit. Raise or remove the limit on the API page.
  • 429 rate_limited or too_many_jobs: you’re sending too fast or have too many jobs rendering at once. Wait for the Retry-After time, or for a video to finish.
  • The video failed with a content error: the prompt or image was blocked by the model’s safety filter. Reword it; the credits were already refunded.

Bottom line

You don’t need a separate Kling account to put Kling in your product. One AiWings key gives your code all four Kling models, MiniMax H3, Seedance and the image models, billed from one balance, with permanent links and automatic refunds on failures. Prefer no code? The same models work in ChatGPT and Claude.

Read the full API reference

FAQ

Is this the official Kling API?

No. AiWings is an independent service that runs Kling for you. You use an AiWings key and AiWings credits, with no Kling account or separate billing.

How much does a Kling video cost through the API?

It’s billed per second. A silent 5-second clip is 45 credits ($0.45) with Kling 2.5 Turbo Pro at 1080p, 105 credits ($1.05) with Kling 3.0 at 720p and 100 credits ($1.00) with Kling 4.0 at 720p. Sound costs more on Kling 2.6 and 3.0. Failed videos are refunded.

Which Kling version should I use?

Kling 2.5 Turbo Pro for quick 1080p clips, Kling 2.6 for 1080p with sound, Kling 3.0 for 4K or a start and end frame, and Kling 4.0 for clips up to 30 seconds or up to 8 reference images.

Can I use it from n8n, Make or Zapier?

Yes, any tool that can send an HTTP request works. Send the POST request from Step 3, then check the video with a GET request until its status is succeeded.

Can the same key make images?

Yes. POST /v1/images makes images with GPT Image, Nano Banana, Seedream, Flux and more, from the same key and balance.