Kling 4.0 Reference to Video

kwaivgi/kling-v4.0/reference-to-video

kwaivgi/kling-v4.0/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

Modelos relacionados

Kling 4.0 Reference to Video Modelos relacionados 1

Referência completa de parâmetros, esquema de saída e preços atuais

Marketplace de APIs de modelos de IAUma plataforma para tudoMais popularTermosExplore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.
prompt *Prompttextarea—≤ 5000 chars
imagesReference imagesimage_upload—image/* · 0–10 items
audiosReference audioaudio_upload_group—audio/* · 0–3 items
keep_original_soundKeep original soundbooleanfalse—
resolutionResolutionselect720p720p | 1080p
durationDurationselect53 ~ 30 · step 1 · 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | …
aspect_ratioAspect ratioselectautoauto | 16:9 | 9:16 | 1:1 | 21:9

Referência completa de parâmetros, esquema de saída e preços atuais

Saiba maisUma plataforma para tudoExplore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.
videosarray<string>

API

Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/reference-to-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "A cinematic portrait, dramatic rim light, shallow depth of field",
    "keep_original_sound": false,
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "auto"
  }
}'

# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
  -H "Authorization: Bearer YOUR_API_KEY"
Python
import time, requests

API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# 1) Submit
resp = requests.post(
    "https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/reference-to-video",
    headers=HEADERS,
    json={
        "input": {
            "prompt": "A cinematic portrait, dramatic rim light, shallow depth of field",
            "keep_original_sound": False,
            "resolution": "720p",
            "duration": 5,
            "aspect_ratio": "auto"
        }
    },
)
resp.raise_for_status()  # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()

# 2) Poll until a terminal state (completed / failed / cancelled).
#    This model is allowed up to 1800s server-side.
deadline = time.time() + 1860
while task.get("status") not in ("completed", "failed", "cancelled"):
    if time.time() > deadline:
        raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
    time.sleep(3)
    poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
    poll.raise_for_status()
    task = poll.json()

print(task["status"], task.get("output"))
JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };

// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/reference-to-video", {
  method: "POST",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({
    "input": {
      "prompt": "A cinematic portrait, dramatic rim light, shallow depth of field",
      "keep_original_sound": false,
      "resolution": "720p",
      "duration": 5,
      "aspect_ratio": "auto"
    }
  }),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();

// 2) Poll until a terminal state (completed / failed / cancelled).
//    This model is allowed up to 1800s server-side.
const deadline = Date.now() + 1860 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
  if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
  await new Promise((r) => setTimeout(r, 3000));
  const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
  if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
  task = await poll.json();
}

console.log(task.status, task.output);

Documentação da API

Kling 4.0 · Reference to Video

Create a new 3–30 second video from a prompt with optional image, video and audio references. Output duration is chosen independently of reference-video duration.

Inputs

  • prompt: required string.
  • images: optional image-URL array, at most 10.
  • videos: optional video-URL array, at most 5. Each source must be at least 3 seconds; at most 30 seconds of video is used in total.
  • audios: optional audio-URL array, at most 3; each clip must be 5–30 seconds.
  • keep_original_sound: boolean, default false. Set true to preserve reference-video audio; requires videos.
  • resolution: "720p" (default) or "1080p".
  • duration: integer from 3 through 30, default 5.
  • aspect_ratio: "auto" (default), "16:9", "9:16", "1:1" or "21:9".

Limits and references

Use at most 15 reference files across images, videos and audios. Longer source footage is trimmed to the 30-second total budget. In prompt, @Image1, @Video1 and @Audio1 refer to the first item in their respective arrays; numbering starts at 1 separately for each media type. Explain the role of each reference.

List price and initial credit charge

Input video720p1080pBilling basis
None$0.157$0.235Per output second
Present$0.094$0.141Per counted second

Without reference video: Cost = output seconds × resolution rate. A 5-second clip costs $0.785 at 720p or $1.175 at 1080p.

Let D be output seconds and V = ceil(min(total input-video seconds, 30)). With video input, cost = rate × (D + max(D, V)). At 720p, D=5 and an 8.2-second input give V=9 and a cost of $1.316; the initial charge is 131.60 credits.

1 USD = 100 Nami credits. Round the total charge upward to 0.01 credit: credits = ceil(cost_usd × 10000) / 100. These are list prices; no promotional discount is applied.

Images, reference audio, aspect ratio and audio-preservation settings add no separate charge under this formula.

MaaS mapping

images, videos and audios remain URL arrays in MaaS. Never send videos as a single string. All other named fields retain their names in MaaS. Send duration as an integer and keep_original_sound as a boolean where supported. Array order is preserved.

Nami API

Send a POST request with Authorization: Bearer YOUR_NAMI_API_KEY and Content-Type: application/json to:

https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/reference-to-video

Example request body:

{
  "input": {
    "prompt": "Use the person from @Image1, follow the camera movement of @Video1, and use @Audio1 as the voice reference. The person greets the viewer in a quiet studio.",
    "images": [
      "https://example.com/person.jpg"
    ],
    "videos": [
      "https://example.com/camera-reference.mp4"
    ],
    "audios": [
      "https://example.com/voice-reference.mp3"
    ],
    "keep_original_sound": false,
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "auto"
  }
}

Replace example.com URLs with publicly accessible media URLs. Use the returned task_uuid to poll GET https://www.namifusion.com/api/v1/marketplace/run/tasks/{task_uuid} with the same authorization. On success, read generated video URLs from output.videos.

Modelos relacionados

xAI Grok Imagine Video v1.5 Reference to Video
Referência para vídeoX Ai

xAI Grok Imagine Video v1.5 Reference to Video

x-ai/grok-imagine-video-v1.5/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.850 / por execução
Vidu Q4 Preview Reference to Video
Referência para vídeoVidu

Vidu Q4 Preview Reference to Video

vidu/q4-preview/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.475 / por execução
MiniMax H3 Reference to Video
Referência para vídeoMinimax

MiniMax H3 Reference to Video

minimax/h3/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.650 / por execução
MiniMax H3 Singularity Reference-to-Video LoRA
Referência para vídeoMinimax H3 Singularity

MiniMax H3 Singularity Reference-to-Video LoRA

minimax-h3-singularity/reference-to-video-lora. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.300 / por execução
MiniMax H3 Singularity Reference-to-Video
Referência para vídeoMinimax H3 Singularity

MiniMax H3 Singularity Reference-to-Video

minimax-h3-singularity/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.250 / por execução
Gemini Omni Flash Reference to Video API
Referência para vídeoGoogle

Gemini Omni Flash Reference to Video API

google/gemini-omni-flash/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $1.28 / por execução
Seedance 2.0 Mini Reference to Video
Referência para vídeoDoubao

Seedance 2.0 Mini Reference to Video

doubao/seedance-2.0-mini/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.3591 / por execução
Seedance 2.5 Reference to Video
Referência para vídeoDoubao

Seedance 2.5 Reference to Video

doubao/seedance-2-5/reference-to-video. Explore APIs de modelos de imagem, vídeo e troca de rosto. Teste qualquer modelo e integre-o por uma API REST unificada.

a partir de $0.6565 / por execução