{
  "openapi": "3.1.0",
  "info": {
    "title": "Runware API - sync-3",
    "version": "1.0.0",
    "description": "sync-3 is a lip synchronization model that processes entire shots as a single generation rather than stitching independent segments. It builds a global understanding of the speaker across all frames, enabling consistent output on close-ups, extreme face angles, partially obscured faces, and obstructed mouths. The model preserves the original speaker's style, cadence, and emotional expression across 95+ languages."
  },
  "servers": [
    {
      "url": "https://api.runware.ai/v1",
      "description": "Runware REST API"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Runware API Key (e.g., Bearer <your-key>)"
      }
    },
    "schemas": {
      "AuthenticationTask": {
        "title": "Authentication",
        "description": "Authenticates a connection using an API key. Can be sent as the first element of the request array as an alternative to using the Authorization header.",
        "type": "object",
        "x-response-schema": "https://schemas.runware.ai/responses/utilities/authentication.json",
        "properties": {
          "taskType": {
            "const": "authentication",
            "title": "Task Type",
            "description": "The type of task to perform."
          },
          "apiKey": {
            "title": "API Key",
            "description": "Your Runware API key.",
            "type": "string"
          },
          "connectionSessionUUID": {
            "title": "Connection Session UUID",
            "description": "Optional session UUID to resume a previous connection and receive any buffered results.",
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "taskType",
          "apiKey"
        ],
        "additionalProperties": false
      },
      "RequestBody": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "model": {
              "title": "Model",
              "description": "Identifier of the model to use for generation.",
              "type": "string",
              "const": "sync:lipsync@3"
            },
            "inputs": {
              "title": "Inputs",
              "description": "The unified payload wrapper for complex media assets dictating image, video or audio inference constraints.",
              "type": "object",
              "properties": {
                "video": {
                  "title": "Video",
                  "description": "Video input (UUID or URL).",
                  "type": "string",
                  "anyOf": [
                    {
                      "format": "uuid"
                    },
                    {
                      "format": "uri"
                    }
                  ]
                },
                "audio": {
                  "title": "Audio",
                  "description": "Audio input (UUID or URL).",
                  "type": "string",
                  "anyOf": [
                    {
                      "format": "uuid"
                    },
                    {
                      "format": "uri"
                    }
                  ]
                }
              },
              "required": [
                "video"
              ],
              "additionalProperties": false
            },
            "speech": {
              "title": "Speech",
              "description": "Settings for speech generation.",
              "type": "object",
              "properties": {
                "text": {
                  "title": "Speech Text",
                  "description": "Text to convert to speech.",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 5000
                },
                "voice": {
                  "title": "Voice",
                  "description": "Voice identifier to use. Set to `auto` for automatic selection.",
                  "type": "string",
                  "default": "auto"
                }
              },
              "required": [
                "text",
                "voice"
              ],
              "additionalProperties": false
            },
            "settings": {
              "title": "Settings",
              "description": "Global inference settings.",
              "type": "object",
              "properties": {
                "activeSpeakerDetection": {
                  "title": "Active Speaker Detection",
                  "description": "Speaker-targeting for multi-person clips.",
                  "type": "object",
                  "properties": {
                    "autoDetect": {
                      "type": "boolean",
                      "title": "Auto Detect",
                      "description": "Automatically detect and target the active speaker.",
                      "default": false
                    },
                    "boundingBoxes": {
                      "type": "array",
                      "title": "Bounding Boxes",
                      "description": "Per-frame face bounding boxes across the clip. Each box is [x1, y1, x2, y2].",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "minItems": 4,
                        "maxItems": 4
                      }
                    },
                    "coordinates": {
                      "type": "array",
                      "title": "Coordinates",
                      "description": "[x, y] point on the target speaker's face in the selected frame.",
                      "items": {
                        "type": "number"
                      },
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "frameNumber": {
                      "type": "integer",
                      "title": "Frame Number",
                      "description": "Frame index corresponding to the provided face coordinates.",
                      "minimum": 0
                    }
                  },
                  "dependentRequired": {
                    "coordinates": [
                      "frameNumber"
                    ],
                    "frameNumber": [
                      "coordinates"
                    ]
                  },
                  "additionalProperties": false
                },
                "segments": {
                  "title": "Segments",
                  "description": "Time segments with audio sources for segmented lip sync workflows.",
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "description": "Segment configuration with audio.",
                    "properties": {
                      "startTime": {
                        "description": "Start time in seconds for the segment.",
                        "type": "number",
                        "multipleOf": 0.01,
                        "minimum": 0
                      },
                      "endTime": {
                        "description": "End time in seconds for the segment. Must be greater than startTime.",
                        "type": "number",
                        "multipleOf": 0.01,
                        "exclusiveMinimum": 0
                      },
                      "audio": {
                        "title": "Audio",
                        "description": "Audio source URL for this segment.",
                        "type": "string",
                        "anyOf": [
                          {
                            "format": "uuid"
                          },
                          {
                            "format": "uri"
                          }
                        ]
                      },
                      "audioStartTime": {
                        "description": "Start time in seconds within the source audio file.",
                        "type": "number",
                        "multipleOf": 0.01,
                        "minimum": 0,
                        "default": 0
                      },
                      "audioEndTime": {
                        "description": "End time in seconds within the source audio file.",
                        "type": "number",
                        "multipleOf": 0.01,
                        "minimum": 0
                      }
                    },
                    "required": [
                      "startTime",
                      "endTime",
                      "audio"
                    ],
                    "dependentRequired": {
                      "audioStartTime": [
                        "audioEndTime"
                      ],
                      "audioEndTime": [
                        "audioStartTime"
                      ]
                    },
                    "additionalProperties": false
                  }
                },
                "syncMode": {
                  "title": "Sync Mode",
                  "description": "Synchronization strategy when audio and video durations don't match.",
                  "type": "string",
                  "definitions": {
                    "bounce": {
                      "const": "bounce",
                      "description": "Audio bounces back and forth to fill video duration."
                    },
                    "loop": {
                      "const": "loop",
                      "description": "Audio repeats from the beginning when it ends."
                    },
                    "cut_off": {
                      "const": "cut_off",
                      "description": "Audio is cut when video ends."
                    },
                    "silence": {
                      "const": "silence",
                      "description": "Remaining video plays with silence after audio ends."
                    },
                    "remap": {
                      "const": "remap",
                      "description": "Audio is time-stretched or compressed to match video duration."
                    }
                  },
                  "default": "cut_off",
                  "oneOf": [
                    {
                      "const": "bounce",
                      "description": "Audio bounces back and forth to fill video duration."
                    },
                    {
                      "const": "cut_off",
                      "description": "Audio is cut when video ends."
                    },
                    {
                      "const": "silence",
                      "description": "Remaining video plays with silence after audio ends."
                    },
                    {
                      "const": "remap",
                      "description": "Audio is time-stretched or compressed to match video duration."
                    }
                  ]
                },
                "tts": {
                  "title": "TTS Provider Settings",
                  "description": "Configuration for the text-to-speech provider used with speech input.",
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "title": "TTS Provider",
                      "description": "Name of the TTS provider.",
                      "default": "elevenlabs"
                    },
                    "stability": {
                      "type": "number",
                      "title": "Stability",
                      "description": "Voice stability for the TTS provider. Higher values produce more consistent output.",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "similarityBoost": {
                      "type": "number",
                      "title": "Similarity Boost",
                      "description": "Voice similarity enforcement for the TTS provider. Higher values make the voice more closely match the target.",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "taskType": {
              "title": "Task Type",
              "description": "Identifier for the type of task being performed",
              "type": "string",
              "const": "videoInference"
            },
            "taskUUID": {
              "title": "Task UUID",
              "description": "UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.",
              "type": "string",
              "format": "uuid"
            },
            "webhookURL": {
              "title": "Webhook URL",
              "description": "Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.",
              "type": "string",
              "format": "uri"
            },
            "includeCost": {
              "title": "Include Cost",
              "description": "Include task cost in the response.",
              "type": "boolean",
              "default": false
            },
            "numberResults": {
              "title": "Number of Results",
              "description": "Number of results to generate. Each result uses a different seed, producing variations of the same parameters.",
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            },
            "uploadEndpoint": {
              "title": "Upload Endpoint",
              "description": "Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.\n\n**Common use cases:**\n\n- **Cloud storage**: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.\n- **CDN integration**: Upload to content delivery networks for immediate distribution.\n\n```text\n// S3 presigned URL for secure upload\nhttps://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600\n\n// Google Cloud Storage presigned URL\nhttps://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789\n\n// Custom storage endpoint\nhttps://storage.example.com/uploads/generated-image.jpg\n```\n\nThe content data will be sent as the request body to the specified URL when generation is complete.\n\n[Read full documentation](https://runware.ai/docs/models/sync-3#uploadEndpoint)",
              "type": "string",
              "format": "uri"
            },
            "ttl": {
              "title": "TTL",
              "description": "Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.",
              "type": "integer",
              "minimum": 60
            },
            "outputType": {
              "title": "Output Type",
              "description": "Video output type.",
              "type": "string",
              "enum": [
                "URL"
              ],
              "default": "URL"
            },
            "outputFormat": {
              "title": "Output Format",
              "description": "Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.\n\n- \\`JPG\\`: Best for photorealistic images with smaller file sizes (no transparency).\n- \\`PNG\\`: Lossless compression, supports high quality and transparency (alpha channel).\n- \\`WEBP\\`: Modern format providing superior compression and transparency support.\n- \\`MP4\\`: Widely supported video container (H.264), recommended for general use.\n- \\`WEBM\\`: Optimized for web delivery.\n- \\`MOV\\`: QuickTime format, common in professional workflows (Apple ecosystem).\n- \\`GIF\\`: Animated image format (no audio), suitable for short loops or previews.\n- \\`MP3\\`: Compressed audio, smaller file size.\n- \\`WAV\\`: Uncompressed, high-quality audio.\n- \\`FLAC\\`: Lossless compression.\n- \\`SVG\\`: Scalable Vector Graphics.\n- \\`TIFF\\`: High-quality output supporting layers.\n\n> [!NOTE]\n> \\*\\*Transparency\\*\\*: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., \\`PNG\\`, \\`WEBP\\`, \\`TIFF\\`). \\`JPG\\` does not support transparency.\n\n[Read full documentation](https://runware.ai/docs/models/sync-3#outputFormat)",
              "type": "string",
              "enum": [
                "MP4",
                "WEBM",
                "MOV"
              ],
              "default": "MP4"
            },
            "outputQuality": {
              "title": "Output Quality",
              "description": "Compression quality of the output. Higher values preserve quality but increase file size.",
              "type": "integer",
              "minimum": 20,
              "maximum": 99,
              "default": 95
            },
            "deliveryMethod": {
              "title": "Delivery Method",
              "description": "Determines how the API delivers task results.",
              "type": "string",
              "oneOf": [
                {
                  "const": "async",
                  "description": "Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse. Required for long-running tasks like video generation."
                }
              ],
              "default": "async"
            },
            "safety": {
              "type": "object",
              "title": "Safety Settings",
              "description": "Content safety checking configuration for video generation.",
              "properties": {
                "checkContent": {
                  "title": "Check Content",
                  "description": "Enable or disable content safety checking. When enabled, defaults to `fast` mode.",
                  "type": "boolean",
                  "default": false
                },
                "mode": {
                  "description": "Safety checking mode for video generation.",
                  "type": "string",
                  "oneOf": [
                    {
                      "const": "none",
                      "title": "None",
                      "description": "Disables checking."
                    },
                    {
                      "const": "fast",
                      "title": "Fast",
                      "description": "Checks key frames."
                    },
                    {
                      "const": "full",
                      "title": "Full",
                      "description": "Checks all frames."
                    }
                  ],
                  "default": "none"
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "inputs",
            "taskType",
            "taskUUID",
            "model"
          ],
          "allOf": [
            {
              "not": {
                "allOf": [
                  {
                    "properties": {
                      "settings": {
                        "properties": {
                          "activeSpeakerDetection": {
                            "required": [
                              "boundingBoxes"
                            ]
                          }
                        },
                        "required": [
                          "activeSpeakerDetection"
                        ]
                      }
                    },
                    "required": [
                      "settings"
                    ]
                  },
                  {
                    "properties": {
                      "settings": {
                        "properties": {
                          "activeSpeakerDetection": {
                            "required": [
                              "coordinates"
                            ]
                          }
                        },
                        "required": [
                          "activeSpeakerDetection"
                        ]
                      }
                    },
                    "required": [
                      "settings"
                    ]
                  }
                ]
              }
            },
            {
              "if": {
                "properties": {
                  "settings": {
                    "required": [
                      "tts"
                    ]
                  }
                },
                "required": [
                  "settings"
                ]
              },
              "then": {
                "required": [
                  "speech"
                ]
              }
            },
            {
              "oneOf": [
                {
                  "properties": {
                    "inputs": {
                      "required": [
                        "audio"
                      ]
                    }
                  },
                  "required": [
                    "inputs"
                  ]
                },
                {
                  "required": [
                    "speech"
                  ]
                },
                {
                  "properties": {
                    "settings": {
                      "required": [
                        "segments"
                      ]
                    }
                  },
                  "required": [
                    "settings"
                  ]
                }
              ]
            }
          ],
          "additionalProperties": false
        },
        "description": "You must always POST an array of task objects."
      },
      "ResponseBody": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Unknown response structure"
            }
          }
        }
      },
      "ErrorResponse": {
        "title": "Error Response",
        "description": "Standard error response returned by the Runware API.",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": true,
              "properties": {
                "code": {
                  "type": "string",
                  "description": "A short identifier for the error (e.g., invalidApiKey, timeoutProvider)."
                },
                "message": {
                  "type": "string",
                  "description": "A human-readable explanation of what went wrong."
                },
                "parameter": {
                  "type": "string",
                  "description": "The request parameter related to the error, if applicable."
                },
                "taskType": {
                  "type": "string",
                  "description": "The task type of the request that failed."
                },
                "taskUUID": {
                  "type": "string",
                  "description": "The unique identifier of the failed request."
                },
                "documentation": {
                  "type": "string",
                  "description": "A link to relevant documentation."
                }
              }
            }
          }
        },
        "required": [
          "errors"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "summary": "Run sync-3",
        "description": "sync-3 is a lip synchronization model that processes entire shots as a single generation rather than stitching independent segments. It builds a global understanding of the speaker across all frames, enabling consistent output on close-ups, extreme face angles, partially obscured faces, and obstructed mouths. The model preserves the original speaker's style, cadence, and emotional expression across 95+ languages.",
        "operationId": "run_sync_3",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — Missing or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — Insufficient account balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — The API key lacks permissions for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server Error — Something went wrong on Runware's end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable — Temporarily unavailable (maintenance or capacity).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ]
}