Top.Mail.Ru
Главная icon
Главная
Галерея icon
Галерея
Unitool Labs icon
Unitool Labs
Блог icon
Блог
MCP icon
MCP
← Все модели

Kling 3.0 Turbo

kling-3-0-turbo · Видео · unitool

Быстрая версия Kling 3.0: видео 3–15 секунд из текста или фотографии, 720p и 1080p.

Генерация асинхронная: создание, ожидание или опрос, результат по ссылке на 7 дней. Подробно: Генерации медиа

Текст → видео

Режим t2v · kling-3-0-turbo:t2v

Цена

Зависит от параметров: 70 токенов на примере ниже, база 70. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 70,
  "example_price": 70,
  "matrix": [
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 14,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 18,
      "per": "duration"
    }
  ]
}

Параметры

ПараметрТипОписание
promptобязательныйstring
aspect_ratio16:9 | 9:16 | 1:1Соотношение сторонПо умолчанию "16:9"
resolution720p | 1080pКачествоПо умолчанию "720p"
duration5 | 10ДлительностьПо умолчанию "5"

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "kling-3-0-turbo",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5"
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "kling-3-0-turbo",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5"
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "kling-3-0-turbo",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5"
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Фото → видео

Режим i2v · kling-3-0-turbo:i2v

Цена

Зависит от параметров: 70 токенов на примере ниже, база 70. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 70,
  "example_price": 70,
  "matrix": [
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 14,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 18,
      "per": "duration"
    }
  ]
}

Параметры

ПараметрТипОписание
promptstring
resolution720p | 1080pКачествоПо умолчанию "720p"
duration5 | 10ДлительностьПо умолчанию "5"
image_urlsобязательныйarray of file (≤ 1)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "kling-3-0-turbo",
  "mode": "i2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "duration": "5",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "kling-3-0-turbo",
  "mode": "i2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "duration": "5",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "kling-3-0-turbo",
  "mode": "i2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "duration": "5",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Мы используем файлы cookie

Продолжая пользоваться сайтом, вы соглашаетесь с Политикой обработки персональных данных.