> ## 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.

# Specific Face Swap

> Swap faces in a single image by providing the initial image and the target 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_face_swap' \
```

## Body

```json json theme={null}
{    
    "key":"",    
    "init_image":"https://assets.modelslab.ai/generations/f139a3a7-1c64-4255-a53d-5b1c2a14b564",    
    "target_image":"https://assets.modelslab.ai/generations/f139a3a7-1c64-4255-a53d-5b1c2a14b564",    
    "reference_image":"https://assets.modelslab.ai/generations/f139a3a7-1c64-4255-a53d-5b1c2a14b564",    
    "base64":false,
    "webhook": null,    
    "track_id": null
}
```


## OpenAPI

````yaml POST /faceswap/single_face_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_face_swap:
    post:
      summary: Specific face swap in image
      description: >-
        Swaps faces in a single image by providing the initial image, target
        image, and reference image for specific face identification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpecificFaceSwapRequest'
      responses:
        '200':
          description: Face swap response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/SuccessFaceSwapResponse'
                  - $ref: '#/components/schemas/ProcessingFaceSwapResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SpecificFaceSwapRequest:
      type: object
      required:
        - key
        - init_image
        - target_image
        - reference_image
      properties:
        key:
          type: string
          description: Your API Key used for request authorization
        init_image:
          type: string
          format: uri
          description: The initial image containing the face to replace
        target_image:
          type: string
          format: uri
          description: The target image containing the face to be swapped
        reference_image:
          type: string
          format: uri
          description: >-
            A reference image containing the specific face to swap from the
            initial image
        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 image generation is
            complete
        base64:
          type: boolean
          default: false
          description: Input image is base64 format
        track_id:
          type: integer
          nullable: true
          description: An ID included in the webhook response to identify the request
    SuccessFaceSwapResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        generationTime:
          type: number
          description: Time taken to generate the result 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 images
        proxy_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of proxy URLs for the generated images
        meta:
          type: object
          description: Metadata about the generation process and parameters used
          properties:
            init_image:
              type: string
              format: uri
            target_image:
              type: string
              format: uri
            reference_image:
              type: string
              format: uri
            seed:
              type: integer
            temp:
              type: string
            file_prefix:
              type: string
            model_save_format:
              type: string
            watermark:
              type: string
            watermark_image:
              type: string
              nullable: true
    ProcessingFaceSwapResponse:
      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 generation process and parameters used
        future_links:
          type: array
          items:
            type: string
            format: uri
          description: >-
            Array of URLs where the files 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

````