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.

5 min readSume
All posts

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.

kling-3 limits on Sume (read 2026-10-05)
SettingValue
duration4 to 15 seconds
resolution720p, 1080p
aspect_ratio16:9, 9:16, 1:1
input_referencesnot 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

All Developers posts

Written by Sume