Smoke-test a video API key with curl: a $0.11 Omni clip

A 19-line curl and jq script: submit a 3-second 360p Gemini Omni Flash 1.1 job, poll it, save the MP4. At $0.0375 a second the test costs $0.1125.

4 min readSume
All posts

When you get a new video API key, the useful first test is not a beautiful clip. It is the cheapest real job that exercises authentication, the balance check, the polling loop and the download. On Sume that job is Gemini Omni Flash 1.1 at its floor: 3 seconds at 360p. Omni is priced per second by resolution, and 360p is $0.0375 a second, so the whole run costs 3 x $0.0375 = $0.1125.

The script is a 19-line bash file that needs only curl and jq. It was run against a local stand-in server returning the documented 202, poll and 302 shapes.

The script

Export SUME_API_KEY and run bash smoke.sh. Omit POLL_SECONDS to keep the 30-second poll interval; the test server needs 0.

#!/usr/bin/env bash
set -euo pipefail
BASE="${SUME_API_BASE:-https://api.sume.com}"
AUTH="Authorization: Bearer ${SUME_API_KEY:?set SUME_API_KEY}"
POLL="$(curl -sS -X POST "$BASE/v1/videos" -H "$AUTH" -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: omni-test-0001' \
  -d '{"model":"gemini-omni-flash-1.1","prompt":"A lighthouse in a storm","duration":3,"resolution":"360p","aspect_ratio":"16:9"}' \
  | jq -er .polling_url)"
while true; do
  sleep "${POLL_SECONDS:-30}"
  JOB="$(curl -sS "$POLL" -H "$AUTH")"
  STATUS="$(jq -r .status <<<"$JOB")"
  case "$STATUS" in
    failed|cancelled) echo "$STATUS: $(jq -c .error <<<"$JOB")" >&2; exit 1 ;;
    completed)
      curl -sSL "$(jq -r '.unsigned_urls[0]' <<<"$JOB")" -H "$AUTH" -o out.mp4
      echo "cost $(jq .usage.cost <<<"$JOB")"; break ;;
  esac
done

Reading the result

Each exit path says something about your setup, so treat the output as a checklist rather than a pass or fail.

  • A 401 from the first curl means the key is missing or wrong. jq -er fails on the missing polling_url and set -e stops the script.
  • A 402 insufficient_credits means the key works but the workspace USD balance is below the reserve. Top up and run again.
  • failed or cancelled prints the error object and exits 1, so a CI step goes red.
  • completed downloads out.mp4 with curl -L, which follows the redirect from the content URL, and prints usage.cost as the billable amount.

Why Omni for the test

Omni accepts 3 to 10 seconds at 360p, 720p, 1080p or 4K, in 16:9 or 9:16, and it always has native synced audio, so you should not send generate_audio. The same model is what sume/auto resolves to by default. Because the price table is linear in seconds, you can scale the test up and read the effect on usage.cost.

Gemini Omni Flash 1.1 price on Sume per second and for a 3 s test (pricing tables, read 2026-10-05)
ResolutionPer second3 s clip
360p$0.0375$0.1125
720p$0.125$0.375
1080p$0.1875$0.5625
4K$0.375$1.125

Is there a free key?

Jobs bill against the workspace USD balance, so a key can authenticate and still be refused at submit when the balance is empty. Google's Gemini API pricing page, which I read on 2026-10-05, says plainly that there is no free tier for Veo 3.1 (https://ai.google.dev/gemini-api/docs/pricing). An 11-cent test is how you find out about your own setup without a surprise.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume