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.

4 min readSume
All posts

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 to form control, from the Sume catalog page, read 2026-10-06.
`io.input_kind`Form controlWhat goes in `input`
urlOne URL fieldA product or page link
textText areaThe brief
imageFile uploadAttach through attachments, up to 30 images
productName, image, notesProduct details
nullFree textRead 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

All Developers posts

Written by Sume