GPT-6 Sol & Claude Opus 5.5 are liveGPT-6 Sol at half the price of 5.6 Sol

Kling 3.0 API: Text-to-Video Request Code and Real Clips

A text-to-video task is one POST with model kling-3.0. Here is the request code, the fields it takes, and two 5-second clips we made on October 29, 2026, measured.

Kiki, OmniaKey COO7 min read
On this page

A Kling 3.0 text-to-video task is one POST to https://api.omniakey.com/v1/media/tasks with the model id kling-3.0, the operation text_to_video, and two required parameters: duration (5, 10 or 15 seconds) and mode (std or pro). The reply carries a task id; poll it until it succeeds, then download the MP4. On October 29, 2026 we made two 5-second standard-mode clips at 1280×720 and measured the files and the frames.

What a Kling 3.0 request takes

Seven fields go in the body. Two of them, duration and mode, are required for Kling and set the clip length and the quality band.

FieldWhat to send
modelkling-3.0
typevideo
operationtext_to_video
input.promptthe scene, action and camera, as one string
parameters.duration5, 10 or 15, in whole seconds
parameters.modestd or pro
parameters.aspect_ratio16:9, 9:16 or 1:1

The model page's own sample sends duration 6 and a resolution field of 720p, and neither is valid here: the page accepts only 5, 10 or 15 seconds and says there is no separate resolution field (the model page, checked October 29, 2026). Its FAQ maps standard output to 720P and pro to 1080P.

Audio arrives by default, and the page lists no toggle (checked October 29, 2026). Aspect ratio applies to text to video; image to video takes its shape from the first frame and rejects an explicit ratio. These two runs used std at 5 seconds and 16:9, while pro mode, 10 s and 15 s, 9:16 and 1:1, image to video and a last frame were outside them.

Prompt wording sets the scene, action and camera. The Kling 3.0 prompt guide covers the parts of a prompt and the camera language.

The request code

One Python file sends the body, polls the task and downloads the MP4. It reads the key from OMNIAKEY_API_KEY, puts a random Idempotency-Key on the create request, and sleeps 5 seconds between polls for up to 180 tries. The body carries the same fields and values as the two clips in the next section: model kling-3.0, type video, operation text_to_video, duration 5, mode std, aspect ratio 16:9.

python
import json
import os
import time
import urllib.error
import urllib.request
import uuid

API = "https://api.omniakey.com/v1/media/tasks"
KEY = os.environ["OMNIAKEY_API_KEY"]

def request(method, url, body=None, extra_headers=None):
    headers = {"Authorization": f"Bearer {KEY}", "User-Agent": "omniakey-example/1"}
    data = None
    if body is not None:
        headers["Content-Type"] = "application/json"
        data = json.dumps(body).encode()
    headers.update(extra_headers or {})
    req = urllib.request.Request(url, data=data, headers=headers, method=method)
    with urllib.request.urlopen(req, timeout=120) as resp:
        return json.load(resp)

def poll(url, attempts=5):
    for attempt in range(attempts):
        try:
            return request("GET", url)
        except urllib.error.HTTPError as err:
            if err.code < 500 or attempt == attempts - 1:
                raise
        except urllib.error.URLError:
            if attempt == attempts - 1:
                raise
        time.sleep(5 * (attempt + 1))

def text_to_video(prompt, out_path, duration=5, mode="std", aspect_ratio="16:9"):
    body = {
        "model": "kling-3.0",
        "type": "video",
        "operation": "text_to_video",
        "input": {"prompt": prompt},
        "parameters": {"duration": duration, "mode": mode, "aspect_ratio": aspect_ratio},
    }
    task = request("POST", API, body, {"Idempotency-Key": str(uuid.uuid4())})["id"]
    print("task", task, flush=True)
    for _ in range(180):
        time.sleep(5)
        state = poll(f"{API}/{task}")
        if state["status"] not in ("queued", "processing"):
            break
    if state["status"] != "succeeded":
        raise RuntimeError(state.get("error") or state["status"])
    asset_url = state["assets"][0]["url"]  # signed link: short-lived, so download now
    req = urllib.request.Request(asset_url, headers={"User-Agent": "omniakey-example/1"})
    with urllib.request.urlopen(req, timeout=300) as resp, open(out_path, "wb") as f:
        f.write(resp.read())
    return task

if __name__ == "__main__":
    task = text_to_video(
        "A paper boat drifts slowly down a rain-soaked street at dusk. Warm streetlights reflect on "
        "the wet cobblestones. The camera follows the boat at a steady pace. No people, no text.",
        "paper-boat.mp4",
    )
    print("done", task)

Each poll is a GET on the task path, and the loop follows status rather than progress.percent, which can sit at 0 while the clip renders. When the status is no longer queued or processing, the code stops: succeeded leads to the download from assets[0].url, and any other status raises the task's own error message. The download goes out at once because that asset link expires; ask the task again for a fresh one when it does. A poll that hits a dropped connection or a server error (5xx) is retried up to five times, with a longer pause each time.

We ran this file once more on October 29, 2026, with the same settings. Our first attempt lost its connection while polling, which is why the poll now retries. The second run returned task task_PNB1kPopriUyfcHsXhVWY2hBOEoSUIqM, and its MP4 measured 5.04 seconds at 1280×720 with a stereo AAC track. From create to download it took 807 seconds, against 82.2 and 110.7 seconds for the two clips below, so plan for long waits.

Two clips we made

Both requests went out on October 29, 2026 with the body listed above. The paper-boat task is task_cbOtsBxO75cml3nOmVUu9YG3PkYXW2ja and the teapot task is task_M2Ub1EoCaCUa1FjOZDdWDOuEOS9nRjnt. Each prompt went out exactly as written.

Paper boat

prompt
A paper boat drifts slowly down a rain-soaked street at dusk. Warm streetlights reflect on the wet cobblestones. The camera follows the boat at a steady pace. No people, no text.
Frames from the paper-boat clip: a folded paper boat on wet cobblestones at dusk, with warm streetlight reflections.
Frames from the paper-boat clip in time order. Kling 3.0, text to video, 5 seconds, standard mode, 16:9, made October 29, 2026.

Teapot

prompt
A ceramic teapot sits on a wooden table by a window. Steam rises in slow curls. Soft morning light moves across the table. The camera pushes in slowly. No people, no text.
Frames from the teapot clip: a green-glazed teapot on a wooden table by a window, with steam rising.
Frames from the teapot clip in time order. Kling 3.0, text to video, 5 seconds, standard mode, 16:9, made October 29, 2026.

What the files measured

A clip tool measured each download on October 29, 2026.

  • Paper boat — Size: 1280×720; Frame rate: 24.0 fps; Duration: 5.04 s; Audio: AAC, 2 channels, 44.1 kHz; Mean level: −50.9 dB; Max level: −34.0 dB; Cuts: none
  • Teapot — Size: 1280×720; Frame rate: 24.0 fps; Duration: 5.04 s; Audio: AAC, 2 channels, 44.1 kHz; Mean level: −54.3 dB; Max level: −35.9 dB; Cuts: none
  • Code-run clip — Size: 1280×720; Frame rate: 24.0 fps; Duration: 5.04 s; Audio: AAC, 2 channels, 44.1 kHz; Mean level: −48.4 dB; Max level: −20.0 dB; Cuts: none

The first two clips are very quiet: mean levels of −50.9 dB and −54.3 dB, with peaks at −34.0 dB and −35.9 dB. The code-run clip is louder, with a mean of −48.4 dB and a peak of −20.0 dB. We measured the level only; what the tracks contain was outside the measurement. The shot-change detector found no strong or weak cut in any of the three, so each clip plays as one shot.

What the frames show

Both clips follow the prompt, and the teapot adds one small move of its own.

In the paper-boat clip the boat stays near the middle of the frame for the whole 5.04 seconds while the wet street slides past behind it, so the shot reads as a camera following the boat. Warm streetlight reflections stay on the cobblestones through the last frame (frames checked October 29, 2026). No cut interrupts the follow.

In the teapot clip the steam rises in slow curls and fades, and the morning light moves across the wooden table. The teapot ends larger and further toward the lower right than it started, which reads as a push-in with some sideways drift; the prompt asked for a slow push-in, and the drift is something the prompt did not ask for (frames checked October 29, 2026).

First and last frame of the teapot clip, side by side. The teapot is larger and further right in the last frame.
Left: the first frame of the teapot clip. Right: the last frame. The teapot grows in the frame, which is the push-in the prompt asked for, with some sideways drift.

Errors and limits

A duration outside 5, 10 and 15 returns HTTP 400 model_price_error, and no job is created (the video API docs, checked October 29, 2026). Send whole seconds from the three allowed values.

A create request without Idempotency-Key returns 400 missing_idempotency_key; the key can be up to 255 characters. The same key with the same body returns the existing task with HTTP 200 and nothing new is charged, while a changed body under that key returns 409 idempotency_key_reused (media API overview, checked October 29, 2026).

On October 29, 2026 a POST with Python's default urllib User-Agent returned HTTP 403 with the body error code: 1010 from Cloudflare, and our own User-Agent header reached the API. Set a User-Agent on the create request and on the download.

Output links are short-lived: re-poll the task for a fresh assets[].url instead of storing one (video API docs, checked October 29, 2026). Task records are kept for 24 hours after creation (media API overview, checked October 29, 2026).

Kling 3.0 is charged per generation rather than per second (video API docs, checked October 29, 2026). For current rates, see OmniaKey pricing.

FAQ

Which durations does kling-3.0 accept?

5, 10 and 15 seconds. Any other value returns HTTP 400 model_price_error and creates no job (video API docs, checked October 29, 2026).

What is the difference between std and pro?

The model page labels them Standard and Pro, and maps standard output to 720P and pro to 1080P (checked October 29, 2026). We ran std only, so we have no measured difference between the two.

Do the clips have sound?

Every clip carries an AAC track with two channels at 44.1 kHz. The first two are very quiet, with mean levels of −50.9 dB and −54.3 dB; the code-run clip is louder, at a mean of −48.4 dB and a peak of −20.0 dB. We measured the level only and left the content unidentified.

Can I start a clip from an image?

The model page lists image to video with a first frame and an optional last frame (checked October 29, 2026). The first frame sets the aspect ratio, and an explicit aspect ratio is rejected on that operation.

How long does a clip take to generate?

In our two runs on October 29, 2026, the paper boat finished in 110.7 seconds and the teapot in 82.2 seconds. Both were 5-second std clips at 16:9.

Start from the Kling 3.0 model page and send the same body with your own prompt.

Models in this article

Kling 3.0AI videovideo APItext-to-videoAPI

Related articles

Recent posts