POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/kling-3-pro-image2video"; const data = { "start_image_url": "toB64('https://segmind-resources.s3.amazonaws.com/input/75757e4c-7bb1-4e7f-8949-2bf8feaca736-seedance-med.jpg')", "prompt": "Create a serene flowing river scene", "negative_prompt": "noise, flicker", "end_image_url": "toB64('')", "duration": 5, "aspect_ratio": "16:9", "cfg_scale": 0.5, "generate_audio": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


start_image_urlimage *

Image URL to animate. High-resolution images yield clearer results.


promptstr ( default: Create a serene flowing river scene )

Describe motion in video. Use dynamic verbs like dance or flow.


negative_promptstr ( default: noise, flicker )

Elements to avoid in animation output. Use for noise or flicker.


end_image_urlimage ( default: 1 )

URL of the final image frame. Suggested: Use for controlled motion transitions.


durationenum:str ( default: 5 ) Affects Pricing

Length of the video in seconds. Choose longer for more detailed scenes.

Allowed values:

min : 3,

max : 4


aspect_ratioenum:str ( default: 16:9 )

Set the aspect ratio for the video. For social media, select '9:16'.

Allowed values:


cfg_scalefloat ( default: 0.5 )

Adjust prompt adherence. Increase for precise motion depiction.

min : 0,

max : 1


generate_audiobool ( default: 1 )

Enable for synchronized audio output. Recommended for immersive experiences.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Kling 3.0: Image-to-Video Model (1080p + Native Audio)

What is Kling 3.0?

Kling 3.0 is a generative image-to-video model that turns a starting image into a cinematic-quality 1080p animation, with an option to produce native, synchronized audio. It’s designed for developers building video generation features—like motion from stills, animated product shots, and stylized clips—while maintaining strong prompt control over how the scene moves.

On platforms like fal.ai, Kling is known for narrative-friendly generation (including multi-shot workflows and element consistency). On Segmind, this endpoint focuses on a practical workflow: animate a provided start frame, optionally guide motion with a prompt, and (if needed) constrain the transition with an end frame.

Key Features

  • Start-frame animation via start_image_url (required)
  • Prompt-driven motion control with natural language verbs and action cues
  • Optional end-frame targeting using end_image_url for controlled transitions
  • Flexible duration from 3–15 seconds (duration)
  • Aspect ratios for common placements: 16:9, 9:16, 1:1
  • Prompt adherence tuning using cfg_scale (0–1)
  • Optional audio generation with generate_audio

Best Use Cases

  • Marketing & product: animated hero shots, lifestyle motion, app promos
  • Creator content: short cinematic loops for Reels/TikTok (use 9:16)
  • Gaming & entertainment: atmosphere shots, scene motion tests, concept animatics
  • Education: animated diagrams or historical stills with subtle motion

Prompt Tips and Output Quality

  • Describe motion, not just visuals: “camera slowly pushes in, wind moves hair, subtle parallax.”
  • Prefer dynamic verbs: drift, swirl, pan, zoom, ripple, rotate.
  • Use negative_prompt (advanced) to reduce artifacts: try “noise, flicker, jitter, warping.”
  • Set cfg_scale higher when motion must match the prompt; lower if output feels rigid or overfit.
  • Use end_image_url when you need a clear start → end transformation (e.g., pose change).
  • Turn on generate_audio for immersive clips; keep it off for silent UI/background loops.

FAQs

Is Kling 3.0 text-to-video or image-to-video?
This Segmind endpoint is image-to-video (requires start_image_url).

How do I generate 9:16 vertical video?
Set aspect_ratio to 9:16 and compose prompts with “portrait framing” cues.

What duration works best?
Start with 5–8 seconds. Use longer durations for slower camera moves and richer motion beats.

What does cfg_scale do?
It controls prompt adherence. Higher = more literal motion; lower = more interpretive animation.

How do I reduce flicker and artifacts?
Use negative_prompt (e.g., “flicker, noise”) and avoid overly complex motion in one prompt.