Blog

Formats

Sume Formats over the API: create and version a Format, call it, run bulk batches, get structured output, take webhooks, and debug failed runs.

Start with: What is a Sume Format? Turn an agent thread into one API call

Edit a Format mid-batch: which version do queued items use?

A bulk queue dispatches items over time. If you edit the Format while it runs, later items can run the new package. Here is how to tell from the receipts.

Stage a Sume Format change with no branches: second slug, If-Match

Sume Formats have no branches or revert. Test a change in a second Format slug, then promote it to the live one with a single If-Match PUT of the files.

Sume bulk queue has no webhook: poll status_url, read counts.failed

A Sume Format bulk queue gives no queue-level webhook and a completed status that is not all succeeded. Poll status_url and read counts.failed and each item.

Cancel one SKU in a running Sume bulk queue: use the run endpoint

Sume has no public list-queues or cancel-queue endpoint. Stop one running child with POST /v1/format-runs/{run_id}/cancel and read cancel_effect.

250 SKUs for Black Friday: three Format queues of 100, 100 and 50

A Sume bulk queue holds 1 to 100 Format runs. For 250 SKUs, send three queues of 100, 100 and 50 with their own idempotency keys and concurrency window.

One idempotency key per order: a retried holiday batch never doubles

Sume Format runs replay safely: same key and body returns the original run with no second charge. Build the key from order id plus a version, never the clock.

Repeatable holiday ads with Sume Formats: read the io profile first

Sume ships a Format catalog you can call with one POST. Read GET /v1/formats/sume/{slug} for the io profile before you build a Black Friday batch around one.

Bulk virtual try-on videos for a catalog: 100 SKUs per queue

Queue up to 100 try-on runs in one POST: concurrency 1 to 16, one garment image per item, a spend cap each, and how to read the failures afterwards.

Shorts ad copy: 40-character headline, 90-character description

Google recommends 40-character headlines and 90-character descriptions for the Shorts ad CTA card. Draft copy in bulk with Sume and check lengths before upload.

Shop Creative Hub limits: 50 per upload, 10k a month, batch math

Creative Hub for GMV Max takes 50 videos per upload and 10k a month. What that means for Sume bulk queues of 100, and where the 200-video link cap bites.

Run a 5,000-SKU product video catalog in 50 bulk queues

Split 5,000 SKUs into 50 Formats bulk-run queues of 100, key each shard so a crashed script resumes, and read counts.failed before you call a shard done.

Revise 20 finished videos in one Sume bulk queue with previous_run_id

Each bulk item can carry previous_run_id, so one queue re-edits twenty finished runs. A preflight for thread_id, the repeated schema, and the cost per item.

Bulk Format runs: 100 items, 16 at once, what completed means

Sume bulk runs take 1 to 100 items at concurrency 1 to 16. A queue marked completed means every item is terminal, not that every item succeeded.

Format output_schema for partial results: nullable and primary key

How to design a Sume Format output_schema so a run that makes the video but misses a caption still passes: nullable fields, no minItems, and primary_output_key.

Format run expires_at: 90 minutes from created_at, or sooner

How long a Sume Format run can live, which statuses are terminal, and how to poll the status_url without waiting on an event stream that does not exist.

Format run spend cap: generation_spend_cap_usd max 500, zero rejected

How generation_spend_cap_usd works on a Sume Format run: the 500 ceiling, why 0 is rejected, null meaning 500, and what the receipt does and does not include.

Format run retry: same key and body gives 200, changed body 409

Retrying POST /v1/formats/{handle}/{slug}/runs with the same idempotency_key and body returns the first run; a changed body or a parallel duplicate returns 409.

Webhook or polling for Sume Format runs, and the 1 MiB payload rule

Pick between the signed terminal webhook and polling status_url for Sume Format runs: delivery limits, dedupe keys, and what a payload over 1 MiB looks like.

Format structured output: anyOf passes, oneOf and allOf are rejected

Which JSON Schema keywords a Sume Format output_schema accepts, the 400 output_schema_invalid shape, and how it lines up with OpenAI strict structured outputs.

Format output filled_by: agent versus projection, exact URLs

Sume Format runs fill structured output either through the agent or by projection. Learn which one ran, what projection can see, and the exact-URL gate.

Sume webhook missed? POST /v1/format-runs/{run_id}/webhook/redeliver

Replay a Format run webhook without rerunning: the redeliver endpoint, the formats:write scope, and the two 409 errors for no webhook or a run still going.

Verify a Sume Format webhook in Python with an empty-secret guard

Verify x-sume-webhook-signature in Python: HMAC-SHA256 over timestamp.raw_body, a five-minute window, constant-time compare, empty secret refused.

Sume SDK subscribeFormatRun: 20-minute timeout vs 90-minute runs

subscribeFormatRun in @sume-com/sdk polls every 2 seconds and times out at 20 minutes by default, while a Format run can live 90. Set the timeout on purpose.

Calling a Formats by Sume entry: the sume handle, not yours

Formats by Sume run at POST /v1/formats/sume/{slug}/runs with any key holding formats:write. Your own handle returns 404, and a fork lives at your handle.

Format output_schema keywords: pattern and minLength yes, not no

Which JSON Schema keywords a Sume Format output_schema accepts (pattern, minLength, multipleOf, enum, const) and which fail as unsupported_keyword.

Format output_schema nullable: true is rejected, use a type union

OpenAPI nullable: true fails a Sume output_schema as unsupported_keyword. Declare optional fields as type [string, null] and keep them in required.

Format output_schema: $ref "#" fails, a $defs self-reference works

Sume rejects root recursion via $ref "#" in output_schema as unsupported_ref but accepts a $defs entry that references itself. How to write a tree.

Format output_schema root must be an object: wrap an array root

A Sume Format run rejects an output_schema whose root is an array or type union with 400 and rule root_must_be_object. Wrap it in a named key.

Format output_schema strict false: no loose JSON mode on Sume

Sending strict: false with a Sume Format output_schema is accepted but relaxes nothing, and there is no json_object mode. Bind a schema or use the built-in.

Format run media URLs are public: copy on webhook or proxy

Sume Format run media lives at durable public media.sume.com URLs. If customer A must not see customer B's video, copy it at receipt time or proxy it.

Format run spend cap: above the Format cap is honored, null is $500

generation_spend_cap_usd on a Sume Format run may exceed the Format's cap and is not clamped; null runs at the $500 maximum; 0 or over 500 is a 400.

Format run webhook retries: dedupe on request_id, order by created_at

Sume Format run webhook retries repeat request_id, which equals run_id. Dedupe on it and order deliveries by created_at, which changes per built body.

Sume webhook retry schedule: 30s doubling, 10 tries, 1h cap

Sume Format run webhooks retry up to 10 times with min(max(30s x 2^(attempt-1), Retry-After), 1h). The arithmetic of that schedule and what to do when it ends.

Format batch commit: files is a change set, so delete is separate

A batch PUT to a Format's contents commits many files at once. Unnamed files stay, deletes need DELETE, and one stale sha lands nothing.

Format output rejects an uploaded file's URL: generated media only

The Sume output URL gate admits only media the run generated. An uploaded file's URL in your schema fails the projection and takes all of output.

Continued Format run: artifacts span the thread, usage is per run

A Sume Format run continued with previous_run_id gets a new id and cap. Its artifacts[] lists the whole conversation, while usage stays per run.

SumeMediaFile duration_ms is checked within 10% of the real file

A duration_ms in Format output must match the run's artifact ledger within 10%, or the projection fails. A null means not measured, not zero.

output_schema max_string_length: descriptions can spend 120,000

A Sume Format output_schema has a document-wide 120,000-character string budget, plus depth 10, 5,000 properties and 1,000 values per enum.

Format run spend: wait for usage.final before you quote a cost

On a Sume Format receipt, debited is the cost, held and refunded are not spend, and final turns true only once no hold is open.

Magazine cover and model portrait Formats for beauty sellers

Two Sume Formats make 9:16 beauty images from a packshot: a magazine-cover campaign and a model product portrait. When each helps and what to verify.

Resolve 21.1 batch render with AI assistants vs Formats bulk runs

Resolve 21.1 lets AI assistants like Claude batch render. Sume Formats bulk runs queue 1 to 100 items at concurrency 1 to 16 over one API call.

Water splash, sunscreen, formula texture: heroes from a packshot

Three Sume Formats turn one packshot into a 9:16 beauty hero image: water splash, sunscreen splash and formula texture. What each does and what to check.

Check a Format output schema against Sume size limits first

Sume rejects schemas deeper than 10 levels, over 5000 properties or 120,000 characters. A local counter that catches max_depth and max_string_length early.

Format run media budget: 30 files, 10 videos, 10 audio for a lookbook

A Sume Format run shares one attachment budget: 30 files, 30 images, 10 videos, 10 audio. Plan a lookbook run so it stays under invalid_attachment.

Format run `model` picks the orchestrator, not the video model

A new image or video model launches and you set model on a Sume Format run. That field picks the orchestrating LLM only; media models come from Format tools.

Rebuild your best product ad with a new product: sume-recreate Format

Use the sume-recreate Format to keep a winning ad's scene order and timing, cast a new presenter and generate everything fresh with your own packshot.

Failed Format run codes: retry, continue, fix input or wait

Eleven error.code values a failed Sume Format run can carry, grouped by response: continue with previous_run_id, retry with a new key, fix input, or wait.

sume-virtual-try-on Format: first frame, then Seedance 2.5

The sume-virtual-try-on Format builds a first frame with ChatGPT Image 2, then animates it with Seedance 2.5. What goes in, what comes back.