Skip to main content
Glama

create timeline lipsync

lipsync_create-timeline
Destructive

Lipsync separate audio clips to specific time ranges of a saved video, enabling partial dubbing or switching audio or speaker between shots.

Instructions

Lipsync one saved video with several audio clips, each on its own stretch of the video like a Studio timeline: to lipsync only some ranges, or to switch audio or speaker between shots. For one audio across the whole video use lipsync_create; to translate and dub a whole video use dubbing_create when available.

Each lipsynced clip takes exactly one of audioAssetId or audioUrl, a span in seconds or in frames (not a mix), and optionally audioStartTime and audioEndTime to play part of that audio. Clips may come in any order but must not overlap; parts no clip covers keep their original picture and, unless outputAudio plays, their original sound. Frame spans need the video's fps: read it from assets_get-playback-metadata when it returns one (signed-in users only) and never guess it; otherwise use seconds. Get speaker.faceTrackUrl from transcriptions_slice-speaker-face-track when available.

To lipsync only the speaking shots of a dub, pass the full dubbed track as outputAudio, give speaking shots clips that play their part of it, and mark the other shots lipsync: false. outputAudio replaces the sound of the whole output; if it is omitted while a clip sets lipsync: false, the one audio the other clips share plays instead, so pass it whenever they use several.

Before anything is created, the tool validates the input (options included), spans, audio ranges and overlaps, and per-clip errors name the clip index. Overlaps are compared only within one unit, so use one unit for every clip. Problems only the API detects, such as an unknown audio asset or a speaker point off the face, surface after a new project may already exist.

Hard shots can finish COMPLETED with lips that barely move: a face turned toward profile, a small face the model has to enlarge, several faces or a crowd, a microphone or hand over the mouth, a face hidden for part of the shot, or singing over music. Before paying for a video like that, when the faces tools are available run faces_detect, then faces_get-people or faces_get-timeline, and pick the face yourself with options.active_speaker_detection { frame_number, coordinates: [x, y] } (on lipsync_create-timeline, a clip speaker). A still image has no face choice: the faces tools read videos only and an image ignores active_speaker_detection, so for a small face or a group photo suggest a tighter crop of the one face instead. For a song, drive the lipsync with the vocals stem from stems_separate when available; the output then plays only that stem, so say so. Tell the person, before spending, that the shot is hard and why, what you will do about it, and that the lips may still barely move.

Paid generation, sync-3 unless model is set. Estimate and confirm before creating; this starts an asynchronous generation and returns its id and status. Poll that id with generations_get and wait: true.

Without projectId it first creates a NEW project, named projectName or a default; default new work to that. Pass projectId with projectIntent=explicit only when the user explicitly asks to work in that project, selects it in the interface, or it was just created for this request; a matching workflow or name or an open editor is never permission to modify it. Send a fresh idempotencyKey, plus a fresh projectCreationKey when there is no projectId, and after a lost or uncertain response retry only with identical arguments and the same keys. Never resend a request that had no idempotencyKey: it can start a second paid generation.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "videoAssetId": "<videoAssetId>",
      "clips": "<clips>"
    },
    "name": "lipsync_create-timeline"
  }
}

Input Schema

NameRequiredDescriptionDefault
clipsYesClips placed on the video, in any order, without overlapping. Parts no clip covers keep their original picture, and their original sound unless outputAudio plays; clips with lipsync: false keep their picture but play outputAudio.
modelNoModel to use. Defaults to sync-3.
optionsNoOptional model controls. Omit any field to use its default.
projectIdNoExisting Sync project id, only for a project the user explicitly selected or one just created for this request.
outputAudioNoOne audio that plays over the whole finished output from its first second, replacing the sound of every part, such as the full dubbed track. Defaults, when a clip sets lipsync: false, to the only audio the clips use.
projectNameNoName for a NEW project only. Never search or reuse a matching name. Cannot be combined with projectId.
videoAssetIdYesSync asset id of the video.
projectIntentNoRequired with projectId. Set only for an explicit user project selection/update, or the new project just created for this request. Never infer intent from a matching project name, workflow name or active editor.
idempotencyKeyNoUnique key for this generation. Reuse it with identical arguments when retrying after a lost response. Passed as the Idempotency-Key header.
organizationIdNoRun only this call in another of the user’s Sync organizations, by id from organizations_list, when the user asks for it (for example “generate this in the Acme org”). The session keeps its organization; reads of the ids this call returns stay in this organization. Omit to use the session’s organization.
projectCreationKeyNoFresh random UUID identifying this NEW project creation, not a project ID. Required for keyed generation without projectId. Persist this key, name and generation key on retries; the server derives a separate project UUID.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.37
    • changedInput schema / properties / options / properties / active_speaker_detection / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "auto_detect": {
      -        "description": "Find the person speaking automatically.",
      -        "type": "boolean"
      -      },
      -      "coordinates": {
      -        "description": "[x, y] pixel position of the speaker's face on frame_number.",
      -        "items": false,
      -        "maxItems": 2,
      -        "minItems": 2,
      -        "prefixItems": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "number"
      -          }
      -        ],
      -        "type": "array"
      -      },
      -      "face_image": {
      -        "description": "URL of a reference image of the speaker's face.",
      -        "type": "string"
      -      },
      -      "frame_number": {
      -        "description": "Zero-based video frame that coordinates refer to.",
      -        "maximum": 9007199254740991,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "use_v2": {
      -        "description": "Use the second-generation speaker detector.",
      -        "type": "boolean"
      -      },
      -      "v3": {
      -        "description": "Use the third-generation speaker detector.",
      -        "type": "boolean"
      -      }
      -    },
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "auto_detect": {
      +        "description": "Find the person speaking automatically.",
      +        "type": "boolean"
      +      },
      +      "coordinates": {
      +        "description": "[x, y] pixel on the middle of the speaker's face (between the eyes and the mouth, not hair, a hat or the body) on frame_number, in the upright video frame. A point just off one face is moved onto it; the result's warnings say so.",
      +        "items": {
      +          "type": "number"
      +        },
      +        "maxItems": 2,
      +        "minItems": 2,
      +        "type": "array"
      +      },
      +      "face_image": {
      +        "description": "URL of a reference image of the speaker's face.",
      +        "type": "string"
      +      },
      +      "frame_number": {
      +        "description": "Zero-based video frame that coordinates refer to.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "use_v2": {
      +        "description": "Use the second-generation speaker detector.",
      +        "type": "boolean"
      +      },
      +      "v3": {
      +        "description": "Use the third-generation speaker detector.",
      +        "type": "boolean"
      +      }
      +    },
      +    "type": "object"
      +  }
      +]
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "$schema": "https://json-schema.org/draft/2020-12/schema",
      -    "additionalProperties": false,
      -    "properties": {
      -      "error": {},
      -      "errorCode": {},
      -      "generationEstimate": {
      -        "anyOf": [
      -          {
      -            "additionalProperties": {},
      -            "propertyNames": {
      -              "type": "string"
      -            },
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "Server-provided completion estimate and server clock. Use only for approximate remaining time; do not invent an estimate when absent."
      -      },
      -      "id": {
      -        "description": "Sync generation id.",
      -        "type": "string"
      -      },
      -      "model": {
      -        "description": "Model used for the generation.",
      -        "type": "string"
      -      },
      -      "organization": {
      -        "additionalProperties": false,
      -        "description": "The Sync organization this call ran in.",
      -        "properties": {
      -          "id": {
      -            "format": "uuid",
      -            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -            "type": "string"
      -          },
      -          "name": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          }
      -        },
      -        "required": [
      -          "id",
      -          "name"
      -        ],
      -        "type": "object"
      -      },
      -      "outputDuration": {
      -        "description": "Output duration in seconds.",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "outputMediaUrl": {
      -        "description": "Signed result URL when the generation is complete, named as in the API (GET /v2/generations/{id}). Copy this exact string verbatim; do not reconstruct, shorten, or edit it.",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "outputUrl": {
      -        "deprecated": true,
      -        "description": "Deprecated alias of outputMediaUrl, with the same value. Read outputMediaUrl.",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "projectId": {
      -        "description": "Sync project containing this generation.",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "status": {
      -        "description": "Current generation status.",
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "$schema": "https://json-schema.org/draft/2020-12/schema",
      -    "additionalProperties": false,
      -    "properties": {
      -      "error": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "code": {
      -            "type": "string"
      -          },
      -          "generationId": {
      -            "type": "string"
      -          },
      -          "importJobId": {
      -            "format": "uuid",
      -            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -            "type": "string"
      -          },
      -          "importStatus": {
      -            "enum": [
      -              "queued",
      -              "downloading",
      -              "processing",
      -              "completed",
      -              "failed"
      -            ],
      -            "type": "string"
      -          },
      -          "message": {
      -            "type": "string"
      -          },
      -          "progress": {
      -            "maximum": 100,
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "retryAfterMs": {
      -            "type": "number"
      -          },
      -          "retryable": {
      -            "type": "boolean"
      -          },
      -          "status": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          }
      -        },
      -        "required": [
      -          "message"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "$schema": "https://json-schema.org/draft/2020-12/schema",
      +    "additionalProperties": false,
      +    "properties": {
      +      "error": {},
      +      "errorCode": {},
      +      "generationEstimate": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Server-provided completion estimate and server clock. Use only for approximate remaining time; do not invent an estimate when absent."
      +      },
      +      "id": {
      +        "description": "Sync generation id.",
      +        "type": "string"
      +      },
      +      "model": {
      +        "description": "Model used for the generation.",
      +        "type": "string"
      +      },
      +      "organization": {
      +        "additionalProperties": false,
      +        "description": "The Sync organization this call ran in.",
      +        "properties": {
      +          "id": {
      +            "format": "uuid",
      +            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "name"
      +        ],
      +        "type": "object"
      +      },
      +      "outputDuration": {
      +        "description": "Output duration in seconds.",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "outputMediaUrl": {
      +        "description": "Signed result URL when the generation is complete, named as in the API (GET /v2/generations/{id}). Copy this exact string verbatim; do not reconstruct, shorten, or edit it.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "outputUrl": {
      +        "deprecated": true,
      +        "description": "Deprecated alias of outputMediaUrl, with the same value. Read outputMediaUrl.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "projectId": {
      +        "description": "Sync project containing this generation.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "status": {
      +        "description": "Current generation status.",
      +        "type": "string"
      +      },
      +      "warnings": {
      +        "description": "Only on a create: what the API did with a face point before starting. face_point_snapped: the point was just off one face (on hair, a hat or an ear) and was moved to its centre (from, to); tell the user which face is being lipsynced. face_point_unverified: no face was found at the point, which was sent unchanged and may fail; nearestFaces lists the faces found on that frame, so a retry can use a box center.",
      +        "items": {
      +          "additionalProperties": {},
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "$schema": "https://json-schema.org/draft/2020-12/schema",
      +    "additionalProperties": false,
      +    "properties": {
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "generationId": {
      +            "type": "string"
      +          },
      +          "importJobId": {
      +            "format": "uuid",
      +            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +            "type": "string"
      +          },
      +          "importStatus": {
      +            "enum": [
      +              "queued",
      +              "downloading",
      +              "processing",
      +              "completed",
      +              "failed"
      +            ],
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "progress": {
      +            "maximum": 100,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "retryAfterMs": {
      +            "type": "number"
      +          },
      +          "retryable": {
      +            "type": "boolean"
      +          },
      +          "status": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "message"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changedv0.2.4
    • changedInput schema / properties / clips / description
      Previous value: -"Clips placed on the video, in any order, without overlapping. Parts no clip covers keep their original picture and sound; clips with lipsync: false keep their picture but play outputAudio."New value: +"Clips placed on the video, in any order, without overlapping. Parts no clip covers keep their original picture, and their original sound unless outputAudio plays; clips with lipsync: false keep their picture but play outputAudio."
  3. Changed7 schema fields changed
    • addedInput schema / properties / options / description
      Added value: +"Optional model controls. Omit any field to use its default."
    • changedInput schema / properties / options / properties / active_speaker_detection / anyOf
      Previous value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "auto_detect": {
      -        "type": "boolean"
      -      },
      -      "coordinates": {
      -        "items": false,
      -        "maxItems": 2,
      -        "minItems": 2,
      -        "prefixItems": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "number"
      -          }
      -        ],
      -        "type": "array"
      -      },
      -      "face_image": {
      -        "type": "string"
      -      },
      -      "frame_number": {
      -        "maximum": 9007199254740991,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "use_v2": {
      -        "type": "boolean"
      -      },
      -      "v3": {
      -        "type": "boolean"
      -      }
      -    },
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "auto_detect": {
      +        "description": "Find the person speaking automatically.",
      +        "type": "boolean"
      +      },
      +      "coordinates": {
      +        "description": "[x, y] pixel position of the speaker's face on frame_number.",
      +        "items": false,
      +        "maxItems": 2,
      +        "minItems": 2,
      +        "prefixItems": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "number"
      +          }
      +        ],
      +        "type": "array"
      +      },
      +      "face_image": {
      +        "description": "URL of a reference image of the speaker's face.",
      +        "type": "string"
      +      },
      +      "frame_number": {
      +        "description": "Zero-based video frame that coordinates refer to.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "use_v2": {
      +        "description": "Use the second-generation speaker detector.",
      +        "type": "boolean"
      +      },
      +      "v3": {
      +        "description": "Use the third-generation speaker detector.",
      +        "type": "boolean"
      +      }
      +    },
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / options / properties / active_speaker_detection / description
      Added value: +"Which face to lipsync when several people are visible: true or { auto_detect: true } to find the speaker, or frame_number plus coordinates to pick one. Omit for a single face or an image."
    • addedInput schema / properties / options / properties / model_mode / description
      Added value: +"How much of the face the model may change: lips, face or head."
    • addedInput schema / properties / options / properties / occlusion_detection_enabled / description
      Added value: +"Keep hands, microphones and other objects that pass in front of the mouth in front of it. Slower."
    • addedInput schema / properties / options / properties / sync_mode / description
      Added value: +"How to fit audio and video of different lengths: bounce (play the video forward, then in reverse), loop, cut_off (stop at the shorter input), silence (pad with silence to the longer input) or remap (change the video speed to match the audio)."
    • addedInput schema / properties / options / properties / temperature / description
      Added value: +"How expressive the mouth movement is, from 0 to 1. Omit for the model default."
  4. Addedv0.1.5

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false; the description adds substantial context on top: pre-creation validation with per-clip error indices, that API-only failures can surface after a project already exists, that generation is paid and asynchronous, and how to poll with generations_get wait:true. It also documents idempotency/retry semantics and the risk of duplicate paid generations, which is exactly the destructive-operation context the agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded: purpose and the two alternatives land in the first sentence, and the costly/destructive warnings come before the invocation instructions. It is long and occasionally dense (the hard-shots paragraph packs many conditions), but nearly every sentence carries operational weight given the complexity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers routing, validation behavior, async/paid lifecycle, idempotency and retry rules, project scoping, and the hard-shot workflow end to end. With an output schema present it correctly avoids explaining return values, only noting that it returns an id and status to poll.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema cannot: clips must not overlap, uncovered parts keep original picture/sound, overlap checking is scoped to a single unit so clip spans must use one unit, and outputAudio's fallback when a clip sets lipsync:false. It also documents cross-tool dependencies for fps (assets_get-playback-metadata) and faceTrackUrl (transcriptions_slice-speaker-face-track).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource and scope: 'Lipsync one saved video with several audio clips, each on its own stretch of the video like a Studio timeline', immediately distinguishing it from lipsync_create (one audio, whole video) and dubbing_create (translate and dub whole video). An agent can route between these three without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use conditions ('to lipsync only some ranges, or to switch audio or speaker between shots') and names the alternatives with the condition that selects each. It also states when to pass projectId vs projectName, when to run faces_detect / faces_get-people first, and when to use stems_separate for songs — all decision guidance beyond invocation mechanics.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.