Skip to content

Captions

The Captions card transcribes audio or video into timed caption segments and attaches them to the cell as a caption layer for subtitle overlays in the final video.

POST /v1/vidsheet/{id}/cells/{cell_id}/generate?agent_id={agent_id}
ParameterTypeDescription
idintegerThe sheet ID.
cell_idintegerThe cell ID.
FieldTypeRequiredDescription
generation_typestringYes"captions".
data.audio.valuestring (URI)One ofPublic URL of the audio to caption.
data.video.valuestring (URI)One ofPublic URL of the video to caption (its audio track is extracted).
data.trimobjectNo{ "start_seconds": number >= 0, "duration_seconds": number > 0 } — caption only part of the source.

Pass exactly one of audio or video. No other fields are accepted.

Terminal window
curl -X POST "https://api.gen.pro/v1/vidsheet/101/cells/3000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"generation_type": "captions",
"data": {
"video": { "value": "https://cdn.gen.pro/outputs/final-abc123.mp4" },
"trim": { "start_seconds": 0, "duration_seconds": 30 }
}
}'

You can also generate captions on a layer:

POST /v1/vidsheet/{id}/cells/{cell_id}/layers/{layer_id}/generate?agent_id={agent_id}

Poll Check generation status until complete. The finished generation carries the transcript and timed segments in result (full_text, captions, audio_duration) and writes a caption layer onto the cell.

StatusError codeDescription
422validation_errorNo source, both audio and video, bad URI, or bad trim.
404not_foundSheet or cell not found.

FieldTypeDescription
autoGeneratebooleanAuto-trigger generation when source audio/video changes.

Caption source is passed in the generation data parameter.