Skip to main content
POST
/
api
/
open
/
v4
/
faceswap
/
faceswapByImage
Face Swap Pro - More Realistic, More Similar
curl --request POST \
  --url https://openapi.akool.com/api/open/v4/faceswap/faceswapByImage \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "targetImage": [
    {
      "path": "https://drz0f01yeq1cx.cloudfront.net/1756283639652-91bbc793c9a44830ba3dc5f4ae9d9793-12.png"
    }
  ],
  "sourceImage": [
    {
      "path": "https://d3fulx9g4ogwhk.cloudfront.net/canva_backend/255b106e-6629-4d64-a2ac-e54d905959ca.jpeg"
    }
  ],
  "model_name": "akool_faceswap_image_hq",
  "webhookUrl": "",
  "face_enhance": false
}'
{
  "code": 1000,
  "msg": "OK",
  "data": {
    "_id": "<string>",
    "url": "<string>",
    "job_id": "<string>"
  }
}
The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.
Single Face Only: This API is specifically designed for single face swapping scenarios. For multiple faces, please use the V3 Image Faceswap API.

Face Swap Pro - More Realistic, More Similar

Face Swap Pro (V4 API) delivers superior face swap results with exceptional quality:
  • 🎯 More Realistic: Advanced algorithm produces incredibly natural and lifelike face swaps
  • ✨ More Similar: Enhanced matching technology ensures the swapped face closely resembles the target
  • 🚀 Higher Accuracy: Superior facial feature alignment for better results
  • ⚡ Simplified Integration: No need for the opts parameter or face detection step

Important Notes

  • Single Face Limitation: The ‘akool_faceswap_image_hq’ model only supports single face swapping in an image
  • For images with multiple faces, use the V3 Image Faceswap API
  • This simplified API does not require the opts parameter, making it easier to use compared to V3
  • Face enhance must be a boolean value (true/false), default is false
  • Best suited for high-quality portrait images with clear facial features

Authorizations

x-api-key
string
header
required

Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded.

Body

application/json
targetImage
object[]
required

A collection of faces in the original image

sourceImage
object[]
required

Replacement target image information

model_name
enum<string>
required

The model name for Face Swap Pro. The 'akool_faceswap_image_hq' model delivers more realistic and more similar results. IMPORTANT - Only supports single face in an image. For multiple faces, use V3 Image Faceswap API.

Available options:
akool_faceswap_image_hq
webhookUrl
string

Callback url address based on HTTP request

face_enhance
boolean
default:false

Face enhance must be a boolean, default is false

Response

200 - application/json

Faceswap request submitted successfully

code
integer
required

Interface returns business status code (1000: success)

Example:

1000

msg
string
required

Interface returns status information

Example:

"OK"

data
object