> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Single Video Swap

> Swap all detected faces in a single video with faces from an input image.

## Request

Make a `POST` request to below endpoint and pass the required parameters in the request body.

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v6/faceswap/single_video_swap' \
```

## Body

```json json theme={null}
{     
    "key": "your_api_key",    
    "init_image":"https://plus.unsplash.com/premium_photo-1661508557554-e3d96f2fdde5?fm=jpg&q=60&w=3000&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8OXx8YmVhdXRpZnVsJTIwZ2lybHxlbnwwfHwwfHx8MA%3D%3D",    
    "init_video":"https://tawk.link/6332cd5154f06e12d8971855/vc/66d997a6a2bc5fe2b627a250/v/4239c555189b772d5ca1bd5aa4bf872c4c12a07e/sdfsdfsdf.mp4",    
    "output_format":"mp4",    
    "webhook":null,    
    "track_id": null
}
```


## OpenAPI

````yaml POST /faceswap/single_video_swap
openapi: 3.1.0
info:
  title: ModelsLab Face Swap API
  description: >-
    AI-powered face swap API supporting image and video face swapping with
    advanced controls
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6
    description: Main API server
security: []
paths:
  /faceswap/single_video_swap:
    post:
      summary: Face swap in video
      description: >-
        Swaps all detected faces in a video with faces from an input image.
        Videos must be less than 1 minute long
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SingleVideoSwapRequest'
      responses:
        '200':
          description: Video face swap response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/SuccessVideoFaceSwapResponse'
                  - $ref: '#/components/schemas/ProcessingVideoFaceSwapResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SingleVideoSwapRequest:
      type: object
      required:
        - key
        - init_image
        - init_video
      properties:
        key:
          type: string
          description: Your API Key used for request authorization
        init_image:
          type: string
          format: uri
          description: The image containing multiple faces to be swapped
        init_video:
          type: string
          format: uri
          description: >-
            The video containing the face(s) to replace the faces in the image.
            Must be less than 1 minute
        output_format:
          type: string
          default: mp4
          description: The output format of the video
        watermark:
          type: boolean
          default: true
          description: Indicates if the generated result should include a watermark
        webhook:
          type: string
          format: uri
          nullable: true
          description: >-
            A URL to receive a POST API call once the video generation is
            complete
        track_id:
          type: integer
          nullable: true
          description: An ID included in the webhook response to identify the request
    SuccessVideoFaceSwapResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        generationTime:
          type: number
          description: Time taken to generate the video in seconds
        id:
          type: integer
          description: Unique identifier for the generation request
        output:
          type: array
          items:
            type: string
            format: uri
          description: Array of URLs to the generated videos
        proxy_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of proxy URLs for the generated videos
        meta:
          type: object
          description: Metadata about the video generation process
          properties:
            file_prefix:
              type: string
            outdir:
              type: string
            output_format:
              type: string
            reference_image:
              type: string
              format: uri
            seed:
              type: integer
            source_image:
              type: string
              format: uri
            target_video_url:
              type: string
              format: uri
            watermark:
              type: string
            watermark_image:
              type: string
              nullable: true
    ProcessingVideoFaceSwapResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - processing
        tip:
          type: string
          description: Helpful tip about the processing status
        eta:
          type: integer
          description: Estimated time remaining in seconds
        message:
          type: string
          description: Status message about the processing
        fetch_result:
          type: string
          format: uri
          description: URL to fetch the result when processing is complete
        id:
          type: integer
          description: Unique identifier for the generation request
        output:
          type: array
          items:
            type: string
          description: Empty array during processing
        meta:
          type: object
          description: Metadata about the video generation process
        future_links:
          type: array
          items:
            type: string
            format: uri
          description: >-
            Array of URLs where the videos will be available once processing is
            complete
    Error:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message description

````