Black Friday ad copy and video in one call: an output_schema example
Bind an output_schema with headline, caption and a SumeMediaFile video so one Format run returns typed copy and the clip together, with primary_output_key set.

One Format run can return the ad copy and the video in a single typed result. Bind an output_schema with a headline, a caption and a video that uses { "$ref": "SumeMediaFile#" }, and name the video in primary_output_key.
The request
The schema follows Sume's strict rules: the root is an object, additionalProperties is false, and every property is listed in required. A field you might not have is a nullable union, not an omitted key.
{
"instruction": "Black Friday teaser, 9:16, 8 seconds.",
"input": { "product": "Merino beanie", "offer": "30% off, today only" },
"output_schema": {
"name": "shop/bf-teaser/v1",
"strict": true,
"schema": {
"type": "object",
"additionalProperties": false,
"required": ["headline", "caption", "video"],
"properties": {
"headline": { "type": "string", "maxLength": 60 },
"caption": { "type": "string" },
"video": { "$ref": "SumeMediaFile#" }
}
}
},
"primary_output_key": "video"
}What you get back
outputholds the typed object;primary_output_urlresolves fromprimary_output_key.- A video URL is accepted only if the run generated it. You cannot make the agent fill the field with an arbitrary link.
duration_mson a media value is checked against the file within 10 percent.
When it does not fit
If the agent cannot satisfy the schema the run fails with an output_error such as output_schema_unsatisfied or primary_output_missing; it does not hand you a half-filled object. Handle those in your failure branch, and note the schema keywords are an allowlist: oneOf, allOf and nullable are rejected, so use anyOf or a type array.
Sources
Related posts
More in Formats
- Bulk queue concurrency 16 but fewer runs start: workspace concurrency
Concurrency 16 is a ceiling on the queue, not a promise. Workspace generation concurrency still applies to every child, so some start late or fail to start.
- A queue of 100 Shorts: unique input and a cap per item
Sume bulk runs queue up to 100 Format runs. Give each item its own input and spend cap so no two Shorts read alike. Limits and a request shape from the docs.
- Bulk run for an ad matrix: 3 hooks by 4 ratios in 12 queue items
Build a 3 by 4 creative matrix as one Sume bulk run: 12 items, concurrency 4, and an index-to-name map so every finished file has a clear label.
- Same Idempotency-Key replay: bulk run answers 202, single run 200
Replaying a Format bulk-run create returns 202 and the original queue with no idempotency_hit flag. A single run returns 200 with idempotency_hit true.
Written by Sume