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

# Head Swap API

> Swap a head between two photos with the GoEnhance Head Swap API. Keeps the pose and framing of the reference image, no prompt required.



## OpenAPI

````yaml api-reference/face-swap/openapi-head-swap.json POST /api/v1/head-swap
openapi: 3.1.0
info:
  title: GoEnhance API - Head Swap
  description: Head Swap
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/head-swap:
    post:
      tags:
        - FaceSwapAPI
      summary: Head Swap
      description: >-
        Puts the head from `source_img` onto the body in `reference_img`,
        keeping the reference image's pose and framing.


        This route is prompt-free: the instruction is fixed by the model, and no
        `prompt` or `ratio` field is accepted.


        **Pricing:** 1 token per image (= $0.02).


        Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use
        `custom_callback_url`) to get the generated image.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reference_img:
                  type: string
                  format: uri
                  minLength: 1
                  description: >-
                    Publicly accessible image URL. The body, pose and aspect
                    ratio of this image are kept.
                  example: https://cdn.goenhance.ai/images/static/demo/face-swap-1.jpg
                source_img:
                  type: string
                  format: uri
                  minLength: 1
                  description: >-
                    Publicly accessible image URL. The head is taken from this
                    image.
                  example: https://cdn.goenhance.ai/images/static/demo/face-swap-2.jpg
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - reference_img
                - source_img
            example:
              reference_img: https://cdn.goenhance.ai/images/static/demo/face-swap-1.jpg
              source_img: https://cdn.goenhance.ai/images/static/demo/face-swap-2.jpg
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                    required:
                      - img_uuid
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                '2':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````