Live-commerce Format: instruction past 4,000 characters is cut
A Format run rejects input above 2 MiB with a 400, but silently keeps only the first 4,000 characters of instruction. Put the broadcast script in input.

On a live-commerce Format run, the API cuts instruction at about 4,000 characters and keeps only the start, with no error, while input above 2 MiB gets a loud 400. So put the broadcast script in input.script, keep instruction short, and send input as a JSON object, not a stringified blob.
Two limits that fail in opposite ways
The live-commerce docs describe two size limits. The first is loud. The API rejects input above 2 MiB (2,097,152 UTF-8 bytes), or above 64 top-level properties, measured on the compact JSON. You see a 400, and you fix it.
The second is quiet. When Sume carries instruction into the run, it cuts at roughly 4,000 characters and keeps the start. Nothing tells you. The tail of your text is simply missing, and a script that you pasted there will end mid-sentence.
| Field | Limit | What you see |
|---|---|---|
| input | 2 MiB and 64 top-level properties | 400 error |
| instruction | About 4,000 characters | No error, the tail is dropped |
| attachments | Images only, up to 30 | Use input for scripts |
Where each piece belongs
Use instruction for decisions in prose: use the script as written, the framing, no BGM, no captions. Use input for data: product_url, host_image_url, vo_language, price and script.segments. input must be a JSON object. A stringified blob gets a 400.
The recipe reads the keys it knows. Other keys go to the run as context, but they are not echoed back in output, so keep your own row ids in your database.
A script shaped for the Format
The script is a list of segments, each with a tag. The docs use Intro, Mid and Fin. Tell the agent to use the text as written, because the default behavior of an agent is to tidy a script.
{
"instruction": "Use the Intro/Mid/Fin script as written; do not shorten. Vertical 9:16, no BGM, no captions.",
"input": {
"product_url": "https://shop.example.com/p/4438469916",
"vo_language": "ko",
"script": {
"segments": [
{ "tag": "Intro", "text": "..." },
{ "tag": "Mid", "text": "..." },
{ "tag": "Fin", "text": "..." }
]
}
},
"generation_spend_cap_usd": 120
}Cap the spend and catch the end
Send generation_spend_cap_usd on every run. The cookbook uses about $120 as the ceiling for a production live-commerce run, and a much smaller cap for a single-scene retry. A webhook URL in communication gets one signed POST when the turn ends, so you do not need to poll.
Post the run to /v1/formats/{owner}/{slug}/runs with an Idempotency-Key. Store data.id and data.thread_id with your row. The first reads the receipt, and the second groups retries.
Sources
Related posts
More in Formats
- Logo animation with sume-logo-motion-design: one call, a cap, a retry
Animate a logo with the sume-logo-motion-design Format: attach the PNG, set a spend cap, keep a stable idempotency key, and continue a run to fix one detail.
- Lost the bulk-run queue id? There is no list endpoint; replay the key
Sume has no list-queues or cancel-queue endpoint. If you lost the frq_ id, replay the create with the same key and body to get the queue back.
- MAI-Voice-2.1 and Format runs: get the voiceover as its own file
A Format run cannot be told to use MAI-Voice-2.1, since its tools pick the audio model. Bind an audio field to get the voiceover track as a file.
- One Format run with five variants or a five-item bulk queue?
One run gives you five variants under one cap and one receipt. A bulk queue gives five receipts, a concurrency window up to 16 and per-item retry.
Written by Sume