Face Swap API
  1. Face Swap APIs
Face Swap API
  • Start Your Face Swap
  • Pricing
  • Face Swap APIs
    • Get Face Swap Task Info by ID
      POST
    • Create Face Swap Task
      POST
    • Cancel Face Swap Task (if still pending)
      POST
  • Other APIs
    • Face detection from image/video URL
      POST
    • Get video info from url
      POST
  1. Face Swap APIs

Create Face Swap Task

POST
/create-face-swap-task
Last modified:2025-06-04 16:26:28
Maintainer:Not configured
⚠️ Notes:
• 🎞️ Video Format Support: Common formats like .mp4, .mov, and others are supported.
• 🗓️ Storage Policy: All generated content is stored for 7 days only and will be permanently deleted after that.
• 📐 Output Resolution Rule: If the selected output resolution exceeds the source resolution, the output will default to the source resolution — but pricing will still be based on the requested resolution.
• 💧 Watermark Placement: A watermark will appear in the bottom-right corner of all face-swapped media.
• 🔄 Targeted Face Swap Limitation: When swapping specific faces in videos, rapid facial expression changes may cause flickering or inconsistent results. Choosing to swap all detected faces can significantly reduce this issue.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/create-face-swap-task' \
--header 'x-api-key: dfed35b0-350c-11f0-9d91-1607289bbab1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "video",
    "media_url": "https://facemint.io/media.mp4",
    "start_time": 0,
    "end_time": 4,
    "resolution": 2,
    "enhance": 1,
    "nsfw_check": 0,
    "watermark": "MyFaceAI",
    "callback_url": "https://your-site/cb?id=121233",
    "swap_list": [
        {
            "from_face": "https://facemint.io/face1.png",
            "to_face": "https://facemint.io/to1.png"
        },
        {
            "from_face": "https://facemint.io/face1.png",
            "to_face": "https://facemint.io/to1.png"
        },
        {
            "from_face": "https://facemint.io/face1.png",
            "to_face": "https://facemint.io/to1.png"
        }
    ]
}'
Response Response Example
{
    "code": 0,
    "info": "ok",
    "data": {
        "taskId": "683b82962ea80a690d299a7c",
        "price": 2000
    }
}

Request

Header Params
x-api-key
string 
optional
Example:
dfed35b0-350c-11f0-9d91-1607289bbab1
Body Params application/json
type
string 
required
“image” / “gif” / “video”
media_url
string 
required
Maximum file size: 2GB for all media types.
start_time
integer 
required
Start time in seconds (type == video)
end_time
integer 
required
End time in seconds (type == video)
resolution
integer 
required
1=480p, 2=720p, 3=1080p, 4=2K, 5=4K, 6=8K
enhance
integer 
required
Whether to enable face enhancement.
1 = on, 0 = off.
nsfw_check
number 
required
Whether to enable NSFW content detection.
1 = on, 0 = off.
watermark
string 
required
Optional watermark text
callback_url
string 
required
Optional callback URL. The system will send a POST request to this URL with the task result once processing is complete. The callback parameters follow the same structure as defined in the /get-task-info API.
swap_list
array [object {2}] 
required
from_face
string 
required
from_face (optional): URL of the source face image. If omitted, all faces in the media will be replaced with the to_face. Recommended size: 128×128, PNG format.
to_face
string 
required
to_face: URL of the target face image. PNG file with resolution less than 1080×1080.
Examples

Responses

🟢201OK
application/json
Body
code
integer 
required
info
string 
required
data
object 
required
taskId
string 
required
price
integer 
required
Previous
Get Face Swap Task Info by ID
Next
Cancel Face Swap Task (if still pending)
Built with