Skip to content

Layers

Layers are composable building blocks within a cell. A single video cell can have multiple layers — text overlays, sound tracks, video clips, captions — that get composed into the final rendered video.

TypeDescriptionKey attributes
textText overlay with font, color, position, and animationcontent, styles (fontSize, fontWeight, color, fontFamily, textAlign, animation)
clipVideo clip with trim, volume, and visual effectssrc, volume, videoStartTime, styles (objectFit, filter, borderRadius)
soundAudio track with volume and trimsrc, volume, startFromSound
captionAuto-generated captions with word-level timestampscaptions (array of timestamped words), styles, template
imageStatic image overlaysrc, styles (objectFit, borderRadius, filter)
shapeGeometric shape overlaystyles (fill, stroke, strokeWidth, borderRadius)
{
"id": 4000,
"name": "Background Music",
"position": 1,
"type": "sound",
"additional_attributes": {
"src": "https://cdn.gen.pro/outputs/audio_001.mp3",
"from": 0,
"durationInFrames": 300,
"totalDuration": 300,
"styles": { "volume": 0.8 },
"startFromSound": 30
},
"created_at_ts": 1709294400000,
"updated_at_ts": 1709380800000,
"default_user_job": null,
"user_jobs": [],
"execution_cost": null
}

This is a freeform JSON field that stores the layer’s composition settings. All timing values are in frames (30 fps).

FieldTypeDescription
fromintegerStart frame on the timeline (0 = beginning of video)
durationInFramesintegerHow many frames this layer is visible/audible
totalDurationintegerOriginal duration before any trim
widthnumberWidth in pixels (for visual layers)
heightnumberHeight in pixels (for visual layers)
leftnumberX position in pixels
topnumberY position in pixels
rotationnumberRotation in degrees
FieldTypeDescription
srcstringVideo URL
videoStartTimenumberTrim start point in the source video (seconds)
styles.volumenumberVolume level: 0 (muted) to 1 (full). Default 1.
styles.objectFitstring"cover", "contain", "fill", "none"
styles.filterstringCSS filter (e.g., "brightness(1.2) contrast(1.1)")
styles.borderRadiusstringCorner rounding (e.g., "8px")
styles.animationobject{ enter: "fadeIn", exit: "fadeOut" }
FieldTypeDescription
srcstringAudio URL
startFromSoundnumberTrim start point in the source audio (frames)
styles.volumenumberVolume level: 0 (muted) to 1 (full). Default 1.
FieldTypeDescription
contentstringThe text to display
styles.fontSizestringFont size (e.g., "48px")
styles.fontFamilystringFont name
styles.fontWeightstring"400", "700", etc.
styles.colorstringText color (hex or CSS color)
styles.textAlignstring"left", "center", "right"
styles.backgroundColorstringBackground behind text
styles.animationobject{ enter: "fadeIn", exit: "fadeOut" }
FieldTypeDescription
captionsarrayArray of { text, startMs, endMs, words: [{ word, startMs, endMs }] }
templatestringCaption style template name
stylesobjectFont, color, highlight styles for active words

Adds a new layer to a cell.

POST /v1/autocontentengine/{id}/cells/{cell_id}/layers?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
FieldTypeRequiredDescription
video_layer.namestringYesLayer name (e.g., "Sound Effect").
video_layer.typestringYesLayer type.
video_layer.positionintegerNoInsert at a specific position. Appended to the end if omitted.

Returns the created layer.

Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_layer": {"name": "Background Music", "type": "audio"}}'

Returns a single layer with its generation history.

GET /v1/autocontentengine/{id}/cells/{cell_id}/layers/{layer_id}?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
layer_idintegerThe layer ID.

Returns the full layer object.

Terminal window
curl "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000?agent_id=42" \
-H "X-API-Key: your-api-key"

Updates a layer’s name, type, or composition attributes (volume, trim, position, styles, etc.).

PATCH /v1/autocontentengine/{id}/cells/{cell_id}/layers/{layer_id}?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
layer_idintegerThe layer ID.
FieldTypeRequiredDescription
video_layer.namestringNoRename the layer.
video_layer.typestringNoChange layer type.
video_layer.additional_attributesobjectNoUpdate composition settings (volume, trim, position, styles).

Rename a layer:

Terminal window
curl -X PATCH "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_layer": {"name": "Intro Music"}}'

Set volume to 50%:

Terminal window
curl -X PATCH "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_layer": {"additional_attributes": {"styles": {"volume": 0.5}}}}'

Trim a clip (start at frame 60, show for 150 frames):

Terminal window
curl -X PATCH "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4001?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_layer": {"additional_attributes": {"from": 60, "durationInFrames": 150}}}'

Move a text overlay and change its style:

Terminal window
curl -X PATCH "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4002?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_layer": {"additional_attributes": {"left": 50, "top": 400, "styles": {"fontSize": "64px", "color": "#ffffff", "fontWeight": "700"}}}}'

Returns the updated layer.


Removes a layer from a cell.

DELETE /v1/autocontentengine/{id}/cells/{cell_id}/layers/{layer_id}?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
layer_idintegerThe layer ID.

No content.

Terminal window
curl -X DELETE "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000?agent_id=42" \
-H "X-API-Key: your-api-key"

Creates a copy of a layer.

POST /v1/autocontentengine/{id}/cells/{cell_id}/layers/{layer_id}/duplicate?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
layer_idintegerThe layer ID to duplicate.

Returns the newly created layer.

Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/4000/duplicate?agent_id=42" \
-H "X-API-Key: your-api-key"

Reorders layers within a cell.

PUT /v1/autocontentengine/{id}/cells/{cell_id}/layers/update_positions?agent_id={agent_id}
FieldTypeRequiredDescription
layersarrayYesArray of {id, position} objects.
Terminal window
curl -X PUT "https://api.gen.pro/v1/autocontentengine/101/cells/3000/layers/update_positions?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"layers": [{"id": 4000, "position": 2}, {"id": 4001, "position": 1}]}'

Returns the updated layers.

StatusError codeDescription
404not_foundSheet, cell, or layer not found.
422validation_errorInvalid layer data.