Submit a Sume video job from PHP with cURL: sume/auto and polling

Replace a Sora call in a PHP worker with Sume /v1/videos: submit with cURL, poll the job, read the download URL, and know what a default clip costs.

5 min readSume
All posts

Teams moving a PHP queue worker off a discontinued Sora call need little more than cURL. Sume's /v1/videos is asynchronous: one POST creates a job, a GET on the returned polling_url reports pending, in_progress, completed, failed or cancelled. OpenAI's Sora API is reported shut down by Pinggy (read 2026-10-07).

The code

Set SUME_API_KEY. The program submits one job, polls polling_url every 20 seconds until completed, and prints the first download URL.

<?php
$key = getenv('SUME_API_KEY');
function call($url, $key, $body = null) {
    $ch = curl_init($url);
    $h = ['Authorization: Bearer ' . $key, 'Content-Type: application/json'];
    curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $h]);
    if ($body) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
    }
    $out = json_decode(curl_exec($ch), true);
    curl_close($ch);
    return $out;
}
$job = call('https://api.sume.com/v1/videos', $key, [
    'model' => 'sume/auto',
    'prompt' => 'A paper boat crossing a rain puddle, macro',
    'aspect_ratio' => '9:16',
]);
do {
    sleep(20);
    $s = call($job['polling_url'], $key);
    echo $s['status'], PHP_EOL;
} while (in_array($s['status'], ['pending', 'in_progress']));
if ($s['status'] === 'completed') echo $s['unsigned_urls'][0], PHP_EOL;

What to know

sume/auto currently resolves to Gemini Omni Flash 1.1 and takes 3 to 10 seconds in 16:9 or 9:16. The defaults are 720p and 8 seconds, so this call bills $1.00 (list $0.10 per second x 1.25 x 8 s). A failed or cancelled job ends the loop with a non-success status; check error in the poll body.

Do not send size, seed or provider.options; Sume rejects them. For production add an Idempotency-Key header on the POST so a retried submit does not create a second job, and prefer callback_url over polling when you have a public endpoint.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume