Python asyncio price check: one Omni Flash clip at four resolutions

A runnable Python script submits a 3-second Omni Flash clip at 360p, 720p, 1080p and 4K together and prints usage.cost. Expect $2.20 in total.

5 min readSume
All posts

The script below submits the same 3-second prompt to Gemini Omni Flash 1.1 at four resolutions at once through POST /v1/videos, polls each job and prints the status and usage. It is the fastest way to confirm Sume prices against your own balance. Expect a total of 220 cents: 12 + 38 + 57 + 113.

The script

It uses requests inside asyncio.to_thread so the four jobs run concurrently without an extra HTTP library. Set SUME_API_KEY in the environment before you run it.

import asyncio, os, time, requests

H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
URL = "https://api.sume.com/v1/videos"

def run(res):
    body = {"model": "gemini-omni-flash-1.1",
            "prompt": "A paper boat drifting on a puddle",
            "resolution": res, "duration": 3,
            "aspect_ratio": "16:9"}
    job = requests.post(URL, headers=H, json=body).json()
    while True:
        s = requests.get(job["polling_url"], headers=H).json()
        if s["status"] in ("completed", "failed", "cancelled"):
            return res, s["status"], s.get("usage")
        time.sleep(10)

async def main():
    tasks = [asyncio.to_thread(run, r)
             for r in ("360p", "720p", "1080p", "4K")]
    for row in await asyncio.gather(*tasks):
        print(row)

asyncio.run(main())

What you should see

usage.cost is the Sume billable amount in dollars on the poll response. The expected values are in the table.

Sume rounds each clip up to the next whole cent, so a clip total is ceil(seconds x rate), not a sum of fractional cents.

Expected billable cost of a 3 s Omni clip (as of 2026-10-08)
ResolutionArithmeticCentsusage.cost
360p3 x 3.75120.12
720p3 x 12.5380.38
1080p3 x 18.75570.57
4K3 x 37.51131.13
Total12 + 38 + 57 + 1132202.20

Notes for a real run

The loop polls every 10 seconds; the docs suggest a moderate interval such as 30 seconds for production. Add a timeout and a callback_url if you do not want to hold a process open.

Check status before you read the video. Add an Idempotency-Key header to each submit if you wrap the call in a retry loop, so a repeated POST returns the original job.

The same length at every tier

For reference, a 3-second Omni Flash clip at each resolution. Every price is the seconds times the billable rate, rounded up to a whole cent, as of 2026-10-08.

Omni Flash 3 s by resolution (as of 2026-10-08)
ResolutionArithmeticBilled
360p3 x 3.75 = 11.25 cents$0.12
720p3 x 12.5 = 37.5 cents$0.38
1080p3 x 18.75 = 56.25 cents$0.57
4K3 x 37.5 = 112.5 cents$1.13

Limits to remember

These apply to every request on this page, from the Video Router and Video generation docs:

  • Length is 3 to 10 whole seconds in generation modes; an edit takes no duration.
  • Aspect ratio is 16:9 or 9:16; an edit takes no aspect ratio.
  • Native synced audio is always on, and generate_audio: false is rejected.
  • There is no bitrate_mode, no reference audio and no seed.
  • Billing is the provider list times 1.25 per output second, reserved at submit and shown in usage.cost.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume