Workflows

End-to-end video pipelines started with a single API call.

Workflows create a VideoGen project and run the full generation pipeline asynchronously. Each POST returns 202 Accepted with { workflowRunId, projectId, projectUrl }.

Poll GET /v1/workflows/runs/{workflowRunId} until status is terminal, or use the SDK helpers pollWorkflowRun (TS) / poll_workflow_run (Python). Subscribe to workflow_run.succeeded, workflow_run.failed, and workflow_run.cancelled webhook events for push notifications.

For a single short standalone clip (up to 15 seconds) without an editable project, use generate-video-clip instead. That tool automatically routes each request to a suitable video generation model.

Available workflows

Script to video

Build a narrated video from a script. VideoGen uses your text verbatim, then adds visuals, narration, and captions. This is the primary entry point: pass a script and a visualStyle ({ type: "AI_IMAGE", aiStyle } for AI-generated images, where aiStyle is a free-form description of the look; see AI styles for example descriptions, { type: "STOCK" } for stock footage, or { type: "ENTITY", entityId } for a saved visual-style entity). To direct the on-screen visuals yourself, pass timed scenes (see Options).

Endpoint reference

Voiceover to video

Build a video around an audio file you provide. Upload the voiceover through the Files API first, then pass its fileId and a visualStyle (same shape as script to video). VideoGen transcribes the audio and matches b-roll to the narration. To skip re-transcription and pin caption timing, attach a pre-computed transcript when you upload the audio (see File uploads). To direct the on-screen visuals yourself, pass timed scenes (see Options).

Endpoint reference

Slideshow to video

Build a narrated walkthrough from an uploaded PDF or PowerPoint file. Upload the file through the Files API first, then pass its fileId. VideoGen narrates each slide and adds transitions and captions. Override the per-slide narration with slideScripts (see Options).

Endpoint reference

Prompt to video clip

Generate one short AI video clip (1 to 15 seconds) from a text prompt, optionally guided by reference imageFileIds. VideoGen generates an opening frame from the prompt, then animates that frame into a video inside an editable project. Set the length with durationSeconds (defaults to 10) and the quality tier with quality (STANDARD or HIGH). This workflow does not accept remixActions. For a standalone clip without a project, use generate-video-clip. For longer narrated multi-scene videos, use script to video.

Endpoint reference

Options

Workflows accept optional fields beyond their required input. Each applies only where it makes sense for that workflow.

FieldApplies toDescription
aspectRatioallOutput aspect ratio (e.g. 16:9). Defaults to 16:9.
durationSecondsprompt to videoLength in whole seconds (1 to 15, defaults to 10).
imageFileIdsprompt to videoFile ids of uploaded reference images that guide the opening frame. Upload via the Files API first.
visualPacingscript, voiceoverFAST, MEDIUM, or SLOW. Controls how quickly visuals change. Defaults to MEDIUM.
qualityscript, voiceover, prompt to videoFor script/voiceover: image generation tier (LOW/STANDARD/HIGH) when visualStyle.type is AI_IMAGE or ENTITY. For prompt to video: video (and opening-frame) quality (STANDARD/HIGH). Defaults to STANDARD.
languagescript, voiceover, slideshowOutput language as a BCP-47 code (e.g. en, es, fr). Defaults to English.
slideScriptsslideshowPer-slide narration, in slide order, applied by index: each slide uses its matching entry, and an empty string makes that slide silent. Fewer entries than slides leaves the remaining slides silent; extra entries are ignored. Omit the field entirely to narrate each slide from its speaker notes in the uploaded file. Pass an empty array ([]) to guarantee no narration on any slide.
voiceIdscript, slideshowNarration voice from GET /v1/resources/tts-voices. A default voice is used when omitted.
voiceSpeedscript, slideshowSpeech rate multiplier. Defaults to the voice’s default.
avatarPresenterIdscript, slideshowPresenter id from GET /v1/resources/avatar-presenters to deliver the narration as a talking-head avatar. Pass your voiceId to that endpoint to list presenters sorted by best match for the voice. Omit for a standard voiceover.
featuredBRollFileIdsscriptFile ids of uploaded images or videos to feature as b-roll. Upload via the Files API first.
captionStylevoiceover, slideshowCaption styling. Omit to keep the default style with captions shown. Pass an object to override individual style fields (font, colors, background, alignment — any omitted field uses the default). Pass null to hide captions entirely. For script-to-video, style captions with an ENABLE_CAPTIONS remix action.
logoFileIdvoiceover, slideshowFile id of an uploaded logo image to overlay on the video. Upload the image via the Files API first. For script-to-video, add a logo with a SET_LOGO remix action.
remixActionsscript, voiceover, slideshowOrdered list of edits applied after the video is built (background music, logo, captions, transitions, natural-language edits). Each runs asynchronously; the response returns one remix action id per entry. See Remix actions.
scenesscript, voiceoverOptional timed scene descriptions guiding what to show on screen during absolute time ranges of the video, as [{ startSeconds, endSeconds, description }]. Ranges must be sorted by startSeconds and non-overlapping. Omit to let the workflow choose visuals automatically.
isOutputTemporaryallWhen true, the video’s generated output files (AI images, video clips, voiceover audio, avatars, and any post-build remix-action media) are created as temporary: guaranteed available for 24 hours, then eligible for archival. Use this when your integration downloads or re-hosts the results itself. The project and its metadata are unaffected. Defaults to false.

Workflow run lifecycle

MethodPathPurpose
GET/v1/workflows/runsList workflow runs, most recently created first (selfOnly scopes to the key owner). Cursor-paginated; see Pagination.
GET/v1/workflows/runs/{workflowRunId}Poll run status (pending, running, succeeded, failed, cancelled).
POST/v1/workflows/runs/{workflowRunId}/cancelRequest cancellation of an in-progress workflow run (best-effort).

When a run succeeds, use projectId with the Projects API to export or remix. You do not need projectUrl for an API-only flow.

About projectId and projectUrl

Every workflow creates a VideoGen project. Responses include both:

  • projectId (vg_proj_...): the stable id for API calls (export, remix, metadata). Use this in integrations that never open the web app.
  • projectUrl: a deep link to open the project in the VideoGen editor. Use it only when a person should review or manually edit the video in the app. Ignore it in a fully automated pipeline.

Access matches the dashboard: the project is available to members of your team and any project collaborators on that project, not to the public or to other teams.

Example (script to video)

1import { VideoGen, pollWorkflowRun } from "@videogen/sdk";
2
3const client = new VideoGen({ apiKey: "sk_videogen_live_..." });
4
5const { workflowRunId } = await client.workflows.scriptToVideo({
6 script:
7 "Staying hydrated keeps your body and mind running at their best. Drinking enough water boosts your energy, focus, and mood. Keep a water bottle nearby and sip throughout the day.",
8 visualStyle: {
9 type: "AI_IMAGE",
10 aiStyle: "loose watercolor illustration with visible brushstrokes and soft color bleeds",
11 },
12 visualPacing: "MEDIUM",
13 quality: "HIGH",
14 remixActions: [
15 { type: "ENABLE_CAPTIONS" },
16 {
17 type: "CONVERT_IMAGES_TO_VIDEOS",
18 motionPrompt: "slow cinematic push-in",
19 muteOutputVideos: true,
20 quality: "HIGH",
21 },
22 ],
23});
24
25const run = await pollWorkflowRun({ client, workflowRunId });
26console.log(run.status, run.projectId);

Projects and export

After a workflow completes, use the Projects API to list projects, fetch metadata, and render an MP4:

MethodPathPurpose
GET/v1/projectsList projects (selfOnly=true scopes to the key owner; default is team-wide). API-created only by default; pass includeUiProjects=true to also include dashboard-created projects.
GET/v1/projects/{projectId}Project metadata (includes optional projectUrl for opening in the app).
POST/v1/projects/{projectId}/exportStart an export; returns { exportId }.
GET/v1/projects/{projectId}/exports/{exportId}Poll export status; downloadUrl when status is succeeded.
POST/v1/projects/{projectId}/remixApply ordered remix actions to a project.
GET/v1/projects/{projectId}/remix-actionsList remix actions for a project, with status and progress.

Use pollProjectExport (TS) / poll_project_export (Python) to wait for the MP4.