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.

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
- Submit and poll a Sume video job from Rust with reqwest
Rust reqwest blocking client for Sume /v1/videos: submit a sume/auto job, poll until completed, print the download URL and usage.cost. Cargo features listed.
- Retry or fix? A status-code policy for Sume API clients in Python
Retry 429 and 503 with the same idempotency key; never retry 400, 401, 402 or 404. A small Python policy function, tested, with the Sume docs rules behind it.
- sume/auto is missing from GET /v1/images/models: hardcode it
Sume Image Router Auto never appears in the model list. Discovery code that only reads GET /v1/images/models will never offer sume/auto. How to handle it.
- SUME_API_AUTH_MODE: make the Sume CLI send Bearer instead of x-api-key
The Sume CLI sends x-api-key by default. Set SUME_API_AUTH_MODE=bearer when your client or network layer expects Authorization: Bearer. Never send both.
Written by Sume