PowerShell: submit a Kling 3 video job, poll it and download clip.mp4
Invoke-RestMethod posts a silent 5-second kling-3 job to /v1/videos, polls until completed and saves clip.mp4; the 720p test costs $0.70 on Sume.

In PowerShell, Invoke-RestMethod posts the job to https://api.sume.com/v1/videos, a do loop polls the polling_url, and Invoke-WebRequest -OutFile saves the content. A silent 5-second kling-3 test at 720p costs $0.70 on Sume, and $1.05 with audio (Video Router, read 2026-10-05).
What is the script?
Set $env:SUME_API_KEY first. ConvertTo-Json turns the hashtable into the JSON body, and $false becomes false for generate_audio.
$h = @{ Authorization = "Bearer $env:SUME_API_KEY" }
$body = @{
model = "kling-3"; prompt = "A paper plane glides across an office, soft daylight"
duration = 5; resolution = "720p"; aspect_ratio = "16:9"; generate_audio = $false
} | ConvertTo-Json
$job = Invoke-RestMethod -Method Post -Uri "https://api.sume.com/v1/videos" `
-Headers $h -ContentType "application/json" -Body $body
do {
Start-Sleep -Seconds 10
$s = Invoke-RestMethod -Uri $job.polling_url -Headers $h
$s.status
} while ($s.status -in "pending", "in_progress")
if ($s.status -eq "completed") {
Invoke-WebRequest -Uri "https://api.sume.com/v1/videos/$($job.id)/content?index=0" `
-Headers $h -OutFile clip.mp4
}Which kling-3 limits matter?
Kling 3 takes 4 to 15 seconds at 720p or 1080p in 16:9, 9:16 or 1:1, with no reference URLs.
| Setting | Value |
|---|---|
| duration | 4 to 15 seconds |
| resolution | 720p, 1080p |
| aspect_ratio | 16:9, 9:16, 1:1 |
| input_references | not accepted |
| price | $0.14/s silent, $0.21/s with audio |
How do I handle a failed job?
On failed, print $s.error. If content returns 409, the job is either still running (job_not_completed, retry) or failed (job_failed, do not retry); see the 409 explainer. For the earlier PowerShell post on JSON POSTs, see Invoke-RestMethod POST JSON.
Sources
Related posts
More in Developers
- Preflight a 90-second voiceover timeline free before the render
Sume's Timeline 1.0 plan endpoint compiles your request, returns duration and billable minutes, and charges nothing. Use it before the $0.20 render.
- Check durations, frames and references against the Sume video catalog
Read supported_durations, supported_resolutions, supported_frame_images and supported_input_references from /v1/videos/models and refuse bad requests early.
- Presigned URL expiry for image edit references on Sume
Sume downloads reference images from a public HTTPS URL. A presigned link that expires mid-queue gives input_media_unreachable. How to set a safe expiry.
- Preview a 3-minute Short with 24 stills, one every 7.5 seconds
Video frames returns up to 24 stills per call, which spaces a 180-second Short at 7.5 seconds. Build the at[] list in Python and submit it to /v1/video-frames.
Written by Sume