compose 400: stack keys and overlay keys mixed in one layout
compose layout keys are stack (split, image_region, ratio) or overlay (position, width_ratio, margin_ratio). Mixing them is a 400. Match layout to operation.

compose_stack_takes_no_overlay_layout and compose_overlay_takes_no_stack_layout mean the layout object in a POST /v1/timeline-1.0/compose request mixes vocabularies. A stack takes split, image_region and ratio. An overlay takes position, width_ratio and margin_ratio. Remove the keys of the other operation, or change operation to match the layout.
Compose is the Sume route that puts one still and one video into a single vertical frame, for example a product plate above a talking clip. YouTube describes Shorts as vertical video up to 3 minutes (YouTube Help, read 2026-10-05), and the default compose output is already 1080 by 1920.
Which keys belong to which operation
The field that selects the operation is operation, not mode; mode is the async or sync communication option. The timeline compose docs list the layout vocabulary:
| layout key | stack | overlay |
|---|---|---|
| split | horizontal or vertical | refused |
| image_region | top, bottom, left or right (must match split) | refused |
| ratio | still share, 0.1 to 0.9 | refused |
| position | refused | top, center or bottom |
| width_ratio | refused | 0.05 to 1, default 0.9 |
| margin_ratio | refused | 0 to 0.45 of height, default 0.05 |
| video_fit | cover, contain or stretch | cover, contain or stretch |
Two valid bodies
The stack body below is the half-banner: a still on top and the video below. The overlay body would instead keep the video full frame and place the still as a plate near the bottom. Pick one, then send only its keys. Both URLs must already be your own media.sume.com artifacts, and an Idempotency-Key header is required.
{
"operation": "overlay",
"image": { "url": "https://media.sume.com/artifacts/artf_demo/plate.png" },
"video": { "url": "https://media.sume.com/artifacts/artf_demo/talk.mp4" },
"layout": { "position": "bottom", "width_ratio": 0.8, "margin_ratio": 0.12 },
"output": { "width": 1080, "height": 1920 }
}Finding the stray key
Mixed bodies usually come from a template that sets every layout key as a default and then switches only operation. If the template has ratio: 0.5 baked in and someone changes the operation to overlay, the refusal fires. A reliable pattern is to hold two small layout dictionaries, one per operation, and pick one by name, so a key from the wrong vocabulary can never be present. Pick the layout by name at the last step before the request is serialised.
Related wrong-axis error
A stack with the wrong region for its split is a different code: compose_image_region_wrong_axis, for left or right on a horizontal split, or top or bottom on a vertical split. The defaults, a horizontal split with the still on top and a ratio of 0.5, need no layout keys at all.
Limits and a design note
Compose output is at most 300 seconds and costs $0.02 flat per job, with the rate to be confirmed in GET /v1/catalog. The still stays on screen for the whole clip and never makes it longer. Output length always comes from the video layer. Sume does not know where a platform draws its own buttons and captions, so the margin_ratio you pick is a layout choice that you should check on a real device, not a verified safe zone.
Sources
Related posts
More in Media tools
- Timeline output fps for a Short: 24, 25, 30 or 60, and the warning
Timeline 1.0 output.fps accepts 24, 25, 30 or 60. Leave it out and the render follows the sources. Read output_fps_resamples_sources before you upload.
- Timeline output size for 21:9 and 16:9 clips: default is 1080x1920
Sume Timeline renders 1080x1920 portrait unless you set output.width and height: even integers, 256 to 2160. Sizes that work for 21:9 and 16:9 AI clips.
- Timeline slot under 0.2 s refused: fast-cut hooks for Shorts in Sume
Sume Timeline 1.0 needs every video slot duration to be at least 0.2 s. Merge sub-0.2 s flashes into a neighbor, or hold a still.
- Trim an AI clip's slow intro for a Short: keyframe cut or exact cut?
Sume video-trim has two precisions: exact re-encodes to the frame, keyframe is a stream copy that can start a GOP early. Which one to use before a Short.
Written by Sume