Home › Quickstart

Kling Pricing quickstart

Create an account, copy your key, and make your first request. Model id used below: kling-v3.0-std.

  1. Create a VideoRouter account and add credit.
  2. Create an API key in the dashboard.
  3. Run one of the examples below.

cURL

job=$(curl -s https://videorouter.sh/api/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "kling-v3.0-std", "prompt": "a paper airplane gliding over a city", "duration_secs": 5}')
id=$(echo "$job" | jq -r .id)

# poll until done (polling is free)
while true; do
  job=$(curl -s https://videorouter.sh/api/v1/videos/$id -H "Authorization: Bearer $VIDEOROUTER_API_KEY")
  status=$(echo "$job" | jq -r .status)
  [ "$status" = "completed" -o "$status" = "failed" ] && break
  sleep 5
done
echo "$job" | jq -r 'if .status == "completed" then .data[0].url else .error end'

Python

import time, requests

BASE = "https://videorouter.sh/api/v1"
H = {"Authorization": "Bearer llmr_sk_live_..."}

job = requests.post(f"{BASE}/videos", headers=H, json={
    "model": "kling-v3.0-std",
    "prompt": "a paper airplane gliding over a city",
    "duration_secs": 5,
}).json()

while job["status"] not in ("completed", "failed"):
    time.sleep(5)
    job = requests.get(f"{BASE}/videos/{job['id']}", headers=H).json()

if job["status"] != "completed":
    raise RuntimeError(job["error"])
print(job["data"][0]["url"])

JavaScript

const BASE = "https://videorouter.sh/api/v1";
const H = { Authorization: "Bearer llmr_sk_live_...", "Content-Type": "application/json" };

let job = await (await fetch(`${BASE}/videos`, {
  method: "POST", headers: H,
  body: JSON.stringify({ model: "kling-v3.0-std", prompt: "a paper airplane gliding over a city", duration_secs: 5 }),
})).json();

while (!["completed", "failed"].includes(job.status)) {
  await new Promise(r => setTimeout(r, 5000));
  job = await (await fetch(`${BASE}/videos/${job.id}`, { headers: H })).json();
}
console.log(job.status === "completed" ? job.data[0].url : job.error);

Pin a provider (optional)

Append a host to the model string, e.g. kling-v3.0-std/<provider>, to prefer one provider (a soft preference; the request can still fall back). Without a suffix, requests route to the cheapest healthy host and fail over automatically.

Image-to-video

Add start_image_url (a public https URL or a base64 data URI) to animate a starting frame.

Errors

All errors use {"error": {"message", "type", "code"}}. 402 = out of credit or cap hit, 429 = rate limited (honour Retry-After), 400 = bad model id or parameters. Full reference in the API docs.