Micro-drama episode manifest as a Format output schema (strict rules)

Bind an output_schema to a Format run and get typed JSON: episode number, title and a SumeMediaFile video. Strict subset: object root, every property required.

5 min readSume
All posts

How do you get a Format run to return an episode record instead of loose text? Bind an output_schema on the run: the response comes back as your own JSON, with a media field typed as SumeMediaFile for the video. The schema must follow the strict subset, which means an object root and every property listed in required.

Series publishing needs records. Shorts series number episodes by publish date, and your own scheduler needs the episode number, a title and a URL for each video in one object it can write straight into a database.

A schema that passes

Optional fields are expressed as a nullable union, because no property may be left out of required.

{
  "output_schema": {
    "name": "acme/episode/v1",
    "strict": true,
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "required": ["episode_number", "title", "cliffhanger", "video"],
      "properties": {
        "episode_number": { "type": "integer" },
        "title": { "type": "string" },
        "cliffhanger": { "type": ["string", "null"] },
        "video": { "$ref": "SumeMediaFile#" }
      }
    }
  },
  "primary_output_key": "video"
}

The rules, in one table

Schemas are checked against an allowlist at submit. A violation returns 400 output_schema_invalid with details.violations[]; nothing runs and nothing is charged.

Strict-subset rules (Sume docs read 2026-10-07)
RuleDetail
RootSingle type object
ObjectsadditionalProperties: false on every object
PropertiesEvery declared property in required
OptionalNullable union such as ["string", "null"]
RejectedoneOf, allOf, not, if/then/else, patternProperties
AllowedanyOf, enum, const, $defs, $ref (limited)

Where the video URL comes from

SumeMediaFile has type, url, content_type, file_name, size_bytes, width, height, duration_ms and expires_at, with every field required and all but type and url nullable. The url must be one this run actually produced; the URL gate rejects a link the run did not make. expires_at is null for durable media.sume.com URLs.

primary_output_key names the field to resolve into primary_output_url on the receipt. It is null while the run is not terminal and when output_error is set.

Failure modes

The projection happens after the run. If it cannot match your schema, a completed run has outcome degraded: output is null, output_error gives the cause, and artifacts[] still holds the real media. Check output_error before you read output, and keep a fallback path that reads artifacts when the typed record is missing.

Sources

Related posts

More in Formats

All Formats posts

Written by Sume