Experience our face swap technology in action by exploring our interactive demo on GitHub: AKool Face Swap Demo.
API Endpoints
Face Swap Operations
- Face Swap Plus - ⭐ Recommended Unified API for image and video face swap, supports multi-face
- Face Swap Pro - ⭐ Highest quality image face swap (single face)
- Image Faceswap - Swap faces in images with high quality (V3)
- Video Faceswap - Swap faces in videos with high quality (V3)
Result Management
- Get Faceswap Result List - Retrieve faceswap results by IDs
- Delete Faceswap Results - Delete faceswap results by IDs
Account Management
- Get User Credit Info - Get faceswap user credit information
Utilities
- Face Detect - Detect faces in images and get landmark information (required for v3 APIs)
Getting Started
Basic Workflow
-
For V3 APIs (Image/Video Faceswap):
- Use the Face Detect API to detect faces and get landmark data
- Use the
landmarks_strvalue from the response as theoptsparameter - Call the Image Faceswap or Video Faceswap API
-
For Face Swap Pro (V4 API) - More Realistic, More Similar:
- Directly call the Face Swap Pro API without face detection
- Delivers more realistic and more similar face swap results
- Only supports single face swapping
-
For Face Swap Plus (V4 API) - Recommended, supports image + video, supports multi-face:
- Call the Face Swap Plus API
- Supports both images and videos
- Supports multiple faces via
face_mapping - Supports single-face mode via
single_face_mode
-
Check Results:
- Use the Get Result API to check the status of your face swap job
- Download the result URL when the status is “Success” (status = 3)
Response Code Description
Please note that if the value of the response code is not equal to 1000, the request
has failed or encountered an error.
Face Swap Status Codes
When checking results, thefaceswap_status field indicates the current state:
Best Practices
Image Requirements
- Quality: Use high-resolution images for better results
- Face Visibility: Ensure faces are clearly visible and not obscured
- Lighting: Well-lit images produce better face swap results
- Angle: Frontal or slight angle faces work best
Video Requirements
- Duration: Keep videos under 60 seconds for optimal processing time
- Face Count: For best results, limit to 8 or fewer faces
- Resolution: Higher resolution videos may take longer to process
- Encoding: Use standard encoding formats (H.264 recommended)
API Usage Tips
- Webhook: Use the
webhookUrlparameter to receive notifications when processing is complete - Face Enhancement: Enable
face_enhancefor better quality results (may increase processing time) - Credit Management: Check your credit balance regularly using the Get Credit API
- Result Cleanup: Delete old results using the Delete Result API to keep your account organized
Common Use Cases
Face Swap Pro - Highest Quality (Image Only)
Use the Face Swap Pro API (POST /api/open/v4/faceswap/faceswapByImage) for the highest quality results:
Face Swap Plus - Multi-Face, Image + Video
Use the Face Swap Plus API (POST /api/open/v4/faceswap/faceswapPlusByImage) for multi-face or video face swap:
Multiple Face Swap (V3 Required)
Use the V3 Image Faceswap API when you need to swap multiple faces in one image:- Detect all faces using Face Detect API
- Provide the
optsparameter for each face - Ensure source and target arrays are properly aligned
Video Face Swap
We recommend using Face Swap Plus API - single face mode requires no pre-detection, multi-face mode uses Face Detection API for face info. If you need to use the V3 Video Faceswap API:- Detect faces in a representative frame
- Provide face landmarks for both source and target
- Monitor processing status as video face swaps take longer