Simple HTTP endpoint to generate a face-swapped video.
The Face Swap API lets you generate AI face swap videos with a single HTTP request. Send a source face image, a target video URL, and the desired duration, and our service returns a deepfake-style video face swap URL.
This face swap video API is built for apps, SaaS tools, meme generators, and content platforms that want to offer AI face swap videos without running their own GPU infrastructure. Start with free trial credits, then pay per minute of generated video.
curl -s -X POST https://www.face-swap.co/api/generate \
-H 'Content-Type: application/json' \
-d '{
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120,
"gender": "all"
}'
import requests
url = "https://www.face-swap.co/api/generate"
payload = {
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120, # required: 4 | 60 | 120 | 180 (use 4 for trial credits)
"gender": "all", # optional: all | female | male (default: all)
}
r = requests.post(url, json=payload, timeout=60)
r.raise_for_status()
print(r.json())
Endpoint: POST https://www.face-swap.co/api/generate
1 credit = 1 minute of video
1 trail credit = 4 seconds of video
Open the Google Colab notebook
Create a face-swapped video job.
key (string, required) – your API key.input_image_url (string, required) – public URL to a face image.input_video_url (string, required) – public URL to a target video.duration (int, required) – allowed values: 4, 60, 120, 180 seconds. Use 4 for trial credits.gender (string, optional) – all | female | male. Default all.curl -s -X POST https://www.face-swap.co/api/generate \
-H 'Content-Type: application/json' \
-d '{
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120,
"gender": "all"
}'
import requests
url = "https://www.face-swap.co/api/generate"
payload = {
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120, # required: 4|60|120|180 (use 4 for trial credits)
"gender": "all", # optional: all|female|male (default: all)
}
r = requests.post(url, json=payload, timeout=60)
r.raise_for_status()
print(r.json())
Check the status of a job.
curl -s https://www.face-swap.co/api/status/0c1449fc0e764b5ebdfe24a52bd8f8fa
import requests
job_id = "0c1449fc0e764b5ebdfe24a52bd8f8fa"
r = requests.get(f"https://www.face-swap.co/api/status/{job_id}", timeout=30)
r.raise_for_status()
print(r.json())
View remaining credits for your API key.
curl -s https://www.face-swap.co/api/credits/YOUR_API_KEY
import requests
api_key = "YOUR_API_KEY"
r = requests.get(f"https://www.face-swap.co/api/credits/{api_key}", timeout=30)
r.raise_for_status()
print(r.json())
List recent jobs for your API key.
curl -s https://www.face-swap.co/api/jobs/YOUR_API_KEY
import requests
api_key = "YOUR_API_KEY"
r = requests.get(f"https://www.face-swap.co/api/jobs/{api_key}", timeout=30)
r.raise_for_status()
print(r.json())
Questions? Email face.swapper.app@gmail.com