AI video generator for business: build a request form from the API
Use GET /v1/formats and the io.input_kind field to build an internal video request form, grouped by what each Sume Format needs.

The simplest AI video generator for a business team is a form your own staff already trust, backed by the Formats API. Each Format reports an io.input_kind, so you can show a URL box for Formats that take a URL, an upload for image Formats and a text box for the rest, without hard-coding 27 slugs.
Which field drives the form?
The catalog page documents io.input_kind with four values. Formats saved before registration have it as null, which means not declared, so give those a free-text box.
| `io.input_kind` | Form control | What goes in `input` |
|---|---|---|
url | One URL field | A product or page link |
text | Text area | The brief |
image | File upload | Attach through attachments, up to 30 images |
product | Name, image, notes | Product details |
null | Free text | Read the Format's description |
Group the catalog
This script reads the list and groups Formats by input kind. It needs SUME_API_KEY and uses only the standard library.
import json, os, urllib.request
from collections import defaultdict
req = urllib.request.Request(
"https://api.sume.com/v1/formats",
headers={"Authorization": "Bearer " + os.environ["SUME_API_KEY"]})
with urllib.request.urlopen(req) as r:
formats = json.load(r)["data"]
groups = defaultdict(list)
for f in formats:
kind = (f.get("io") or {}).get("input_kind") or "undeclared"
groups[kind].append(f"{f['handle']}/{f['slug']}")
for kind, slugs in sorted(groups.items()):
print(kind, len(slugs))
for s in slugs:
print(" ", s)Keep the key on the server
The form should post to your backend, which holds the API key and adds the spend cap and an Idempotency-Key per request. Never ship the key to a browser. Any key with formats:write can start a run, so give the backend its own key with that scope only.
Store the returned run id with the requester so people can see status. The run starts in queued, moves to processing, then ends completed, failed, canceled or skipped. Show output_error to the requester when present.
Handle the awkward cases
Some Formats need a team key. The docs say a Team Format returns 403 workspace_key_required if called with the wrong key, and service-account keys cannot create runs at all. Test the backend key against one Format of each input kind before you launch the form to staff.
Add two fields that every request should carry: the requester's name for your own audit trail, and an expected-length note that goes into instruction. Keep the form short. Staff who face fifteen fields will stop using it, and the Format itself already has a recipe behind it.
Show status without polling every second
Poll with backoff up to 60 seconds, or take the webhook. A run's expires_at is 90 minutes after created_at, so your status page should mark anything past that as dead rather than waiting forever.
Sources
Related posts
More in Developers
- AI video generator for business: no approval step over the API
Format runs started through the Sume API are unattended: approval gates are pre-granted. What that means for review, and the unattended_blocked failure.
- arq worker that polls an AI video job with defer_by in Python
An arq task reads Sume's job status once and enqueues itself again with _defer_by from next_poll_after_seconds, giving asyncio polling without a sleep loop.
- asyncio Semaphore size for Sume image batches: accepted capacity
Size the semaphore to what Sume accepts, concurrency plus queue: Free 6, Pro 24, Startup 48, Scale 120. A fake-submit test proves the peak never exceeds it.
- asyncio TaskGroup cancels siblings: poll many Sume jobs safely
A TaskGroup cancels every other poller when one raises. For a batch of Sume video jobs that abandons waits, not jobs. Catch inside the task and return results.
Written by Sume