Ir para a navegação

Create Generation

Start a lipsync generation. Pass each media input by url or by the assetId of an uploaded asset. To send local files in the request itself, use Create Generation with Files.

A new generation starts as PENDING. Poll Get Generation or set webhookUrl to find out when it finishes.

Send an Idempotency-Key header and reuse it, with the same payload, when you retry. A retry then returns the original generation instead of creating a second one. Keys are kept for seven days, and a retry after the original ended FAILED or REJECTED starts a new generation (201). See Idempotent Requests. Error codes are explained in Error Handling; those for social video links and dialogue edits are in their guides.

Autenticação

x-api-keystring
Autenticação de chave de API via cabeçalho

Cabeçalhos

Idempotency-KeystringOpcional

Case-sensitive organization-scoped key, 1–128 characters matching [A-Za-z0-9._~-]+. Send exactly one header. Reuse the same key and payload for retries of one action; a retry after the generation ended FAILED or REJECTED starts a new one. Use a unique key per intended generation. Retained seven days from acceptance, longer while active or unresolved. Not a JSON field.

Solicitação

This endpoint expects an object.
inputlist of objectsObrigatório

One video or image input plus one audio or text input. With dubParams, send exactly one video input and nothing else; the audio to dub comes from that video. Image inputs are sync-3 only. With segments, give each audio or text input that a segment references a unique refId. At most 102 inputs.

modelenumObrigatório
name of the model to use for generation.
Valores permitidos:
dialogueEditobjectOpcional

The id of a completed dialogue edit from POST /v2/dialogue-edits, which supplies the audio and edited regions. The edit’s preview must have run segment lipsync and section expansion (segmentLipsyncEnabled and sectionExpansionEnabled). Send one video input, the video the edit was made from, and no audio, segments or dubParams. See Dialogue Editing.

dubParamsobjectOpcional

Dubbing parameters. When present, audio is extracted from the single video input, dubbed via ElevenLabs into the target language, and then lipsync is run with the dubbed audio. Do not include audio or text inputs with dubParams; requests that send both are rejected.

optionsobjectOpcional
additional options available for generation.
outputAudioobjectOpcional
An audio input that replaces the sound of the whole finished output, lipsynced parts or not. Use it with segments, for example one dubbed track over a video where some segments set lipsync to false. If a segment sets lipsync to false and this is omitted, the only audio input is used. Not available with a custom output bucket, zero data retention or a retention override.
outputFileNamestringOpcional
Base filename for the generated output without extension. The .mp4 extension will be added automatically. Only alphanumeric characters, underscores, and hyphens are allowed, up to 255 characters.
projectIdstringOpcional

Optionally attach this generation to a project (created via POST /v2/projects) so it appears in Studio under that project. Must reference a project in your organization — otherwise the request is rejected with 422.

segmentslist of objectsOpcional
segments definition list. When provided, allows defining one or more video segments with different audio inputs for each segment. Each segment specifies a time range and references an audio input by refId. At most 100 segments.
webhookUrlstringOpcional

Webhook URL for generation status updates. When the generation reaches a terminal state, Sync sends a POST request with the generation payload and a Sync-Signature header. Verify the header with the organization webhook secret from GET /v2/organizations/webhook/secret. HTTPS is strongly recommended.

Resposta

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.
Valores permitidos:
statusenum
The status of the generation.
errorstringOpcional

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

errorCodestringOpcional

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.

optionsobjectOpcional
Options for the generation.
outputDurationdoubleOpcional
The duration of the output media.
outputUrlstringOpcional
The URL of the output media.
outputFileNamestringOpcional
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 objectsOpcional
The segments of the generation.
segmentOutputUrlstringOpcional
The URL of the segment output media.
dubAudioUrlstring or nullOpcional

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

dubAudioAssetIdstring or nullOpcional

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.

synthesizedAudioUrlstringOpcional

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.

webhookUrlstringOpcional
The URL to the webhook endpoint.
projectIdstringOpcional
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.
generationEstimateobjectOpcional

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.

progressobjectOpcional

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

Erros

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