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

# Create a Wan face swap task

> Create an asynchronous Wan face swap task from two source images.



## OpenAPI

````yaml openapi/wan-face-swap.yaml POST /wan-face-swaps/generations
openapi: 3.1.0
info:
  title: Wan face swap API
  version: 1.0.0
  description: Provider-specific GENGEN reference for asynchronous Wan face swap tasks.
servers:
  - url: https://gengen.farm/api/gengen/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /wan-face-swaps/generations:
    post:
      summary: Create a Wan face swap task
      description: >
        Transfer a source face to a target image while preserving the target
        pose,

        lighting, composition, and background. Submit only images you are
        authorized

        to use and obtain any required consent.
      operationId: createWanFaceSwapTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWanFaceSwapTaskRequest'
            example:
              model: wan-face-swap
              assets:
                targetImage: https://example.com/target-photo.png
                faceImage: https://example.com/source-face.png
              controls:
                seed: 42
      responses:
        '200':
          description: The task was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageTask'
              example:
                id: wanfaceswap:550e8400-e29b-41d4-a716-446655440000
                model: wan-face-swap
                status: pending
                outputs:
                  images: []
                createdAt: '2026-07-21T08:00:00.000Z'
                updatedAt: '2026-07-21T08:00:00.000Z'
                statusUpdateTime: '2026-07-21T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: bash
          label: Create task
          source: |
            curl --request POST \
              --url https://gengen.farm/api/gengen/v1/wan-face-swaps/generations \
              --header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
              --header 'Content-Type: application/json' \
              --data '{
                "model": "wan-face-swap",
                "assets": {
                  "targetImage": "https://example.com/target-photo.png",
                  "faceImage": "https://example.com/source-face.png"
                },
                "controls": {
                  "seed": 42
                }
              }'
components:
  schemas:
    CreateWanFaceSwapTaskRequest:
      type: object
      required:
        - model
        - assets
      properties:
        model:
          type: string
          const: wan-face-swap
          description: Use the `wan-face-swap` model.
        assets:
          $ref: '#/components/schemas/WanFaceSwapAssets'
        controls:
          $ref: '#/components/schemas/WanFaceSwapControls'
      additionalProperties: false
    ImageTask:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      properties:
        id:
          type: string
        model:
          type: string
        status:
          type: string
        outputs:
          $ref: '#/components/schemas/ImageOutputs'
        failureReason:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        statusUpdateTime:
          type: string
          format: date-time
      additionalProperties: true
    WanFaceSwapAssets:
      type: object
      required:
        - targetImage
        - faceImage
      properties:
        targetImage:
          type: string
          description: Target image whose face will be replaced.
        faceImage:
          type: string
          description: Source image containing the face identity to transfer.
      additionalProperties: false
    WanFaceSwapControls:
      type: object
      properties:
        seed:
          description: Pass `null`, `0`, or omit for provider-selected randomness.
          oneOf:
            - type: integer
            - type: 'null'
      additionalProperties: false
    ImageOutputs:
      type: object
      required:
        - images
      properties:
        images:
          type: array
          items:
            type: string
            format: uri
      additionalProperties: true
    Error:
      type: object
      properties:
        error_code:
          type: string
        error:
          type: string
        error_params:
          type: object
          additionalProperties: true
      additionalProperties: true
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: The workspace does not have enough available balance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The API key is not authorized for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnexpectedError:
      description: GENGEN or the Wan provider could not complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: GENGEN API key
      description: A workspace API key beginning with `gengen_live_`.

````