Skip to navigation

Create Generation with Files

The multipart/form-data form of POST /v2/generate, for sending local files in the request instead of passing URLs. It accepts the same fields as Create Generation and the same Idempotency-Key header.

  • Send each file under a field named for its type: video, image (sync-3 only) or audio, at most one of each.
  • Send nested fields (input, options, segments, outputAudio, dubParams, dialogueEdit) as JSON strings.
  • Each file is saved as an asset in your organization.

Limits: 5 GiB per file (your plan and proxies may allow less), 3 files, 32 fields, 35 parts in total, and 1 MiB per field. A file over 5 GiB returns 413; a file over your plan limit returns 422 file_size_exceeds_plan_limit. A malformed body, an unsupported file field, or too many fields or parts returns 400 generation_input_validation_failed.

For large files, upload them first and pass the assetId, so a retry doesn’t resend the file.

Authentication

x-api-keystring
API Key authentication via header

Request

You can mix uploaded files with URL inputs; a file replaces any input item of the same type. An uploaded audio file has no refId, so segments and outputAudio can’t reference it. dialogueEdit needs the original video by URL or assetId, not an uploaded file. With the SDKs, send Idempotency-Key through request options.

videofileOptional
Input video file.
imagefileOptional

Input image file. Only supported with sync-3 model.

audiofileOptional
Input audio file.
modelenumRequired
name of the model to use for generation.
Allowed values:
inputlist of objectsOptional

Array of input objects, encoded as a JSON string in multipart requests. Can be used to provide URLs or assetIds for larger files. Each input should either have a file, a url, or an assetId. Audio input items can be provided as either recorded/captured audio URL or a text-to-speech input with TTS provider configuration.

optionsobjectOptional
Optional generation options, encoded as a JSON string in multipart requests.
segmentslist of objectsOptional
Optional segment definitions, encoded as a JSON string in multipart requests. Each audioInput.refId must name an audio or text input sent in input by url, assetId, or text. An uploaded audio file has no refId, so segments can't reference it.
outputAudioobjectOptional

Optional audio input that plays over the whole finished output, encoded as a JSON string in multipart requests, for example {"refId":"dub"}. Use with segments. The refId must name an audio input sent by url or assetId: an uploaded audio file has no refId.

dubParamsobjectOptional
Optional dubbing parameters, encoded as a JSON string in multipart requests.
webhookUrlstringOptional
outputFileNamestringOptional
projectIdstringOptional
Optional project id to attach the generation to.
dialogueEditobjectOptional

Optional reference to a completed dialogue edit (its id from POST /v2/dialogue-edits) to render its preview into a video, encoded as a JSON string in multipart requests. Send one video input from the same source and no audio, segments or dubParams.

Response

First acceptance returns 201, as does a keyed retry that starts a new generation after the original ended FAILED or REJECTED. An equivalent keyed replay of an active or completed generation returns 200 with this same response shape and Idempotency-Replayed: true.

createdAtdatetime
The date and time the generation was created.
idstring
A unique identifier for the generation.
inputlist of objects
An array of input objects used for generation.
modelenum
The name of the model used for generation.
Allowed values:
statusenum
The status of the generation.
errorstringOptional

The error message if the generation failed, was rejected or lip-synced nothing (NO_OP).

errorCodestringOptional

Stable, machine-readable error code if the generation failed, was rejected or lip-synced nothing (NO_OP) (e.g. generation_input_video_inaccessible). The full catalog of codes, messages and suggested fixes is served unauthenticated at GET /v2/errors.

optionsobjectOptional
Options for the generation.
outputDurationdoubleOptional
The duration of the output media.
outputUrlstringOptional
The URL of the output media.
outputFileNamestringOptional
The sanitized filename applied to the output media. Characters outside letters, numbers, dashes and underscores are stripped and spaces become underscores, so this can differ from the value submitted. Null when no name was provided.
segmentslist of objectsOptional
The segments of the generation.
segmentOutputUrlstringOptional
The URL of the segment output media.
dubAudioUrlstring or nullOptional

Dubbed audio URL. Omitted for generations without dubParams; null until the dubbed track is available.

dubAudioAssetIdstring or nullOptional

Reusable AUDIO asset for the dubbed track. Omitted without dubParams; null until available, or when retention settings or a custom output bucket prevent saving an asset.

synthesizedAudioUrlstringOptional

The URL of the audio synthesized from a text (TTS) input. Only present for generations created with a TTS text input; reuse it as an audio input to keep the same take across generations.

webhookUrlstringOptional
The URL to the webhook endpoint.
projectIdstringOptional
The id of the project this generation is attached to, or null when it belongs to no project. Set via the projectId field on the create request.
generationEstimateobjectOptional

Finish-time estimate recorded when the generation was accepted. Only set for generations made in sync’s own apps, such as Studio. For any generation, request include=progress and read progress.estimatedFinishAt.

progressobjectOptional

Render progress and expected finish. Only included when the generation is requested with include=progress.

Errors

400
Bad Request Error
401
Unauthorized Error
409
Conflict Error
410
Generation Deleted Error
413
Payload Too Large Error
422
Unprocessable Entity Error
429
Generation Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error
504
Gateway Timeout Error