Swap, detect, and enhance faces with AI precision
AI face swap API — Swap faces in images with deepfake precision. Face detection, face enhancement, and face restoration. Multiple face swapper for group photos — target specific faces by index. Enhance face quality, restore and upscale old photos. Single synchronous request, result in seconds.
See It in Action
Real examples generated by the API. See the quality for yourself.

Face Swap and Face Targeting — swap a single face or target a specific face by index in group photos
Features
Multi-Face Support
Swap or enhance up to 5 faces in group photos with the many_faces option in a single request.
Face Targeting
Detect faces first, then swap or enhance a specific face by index — perfect for group photos.
Face Enhancement
Standalone AI face restoration and 2x upscaling. Fix artifacts and improve face quality without swapping.
Face Detection
Detect all faces in an image and get their bounding box positions for precise targeting.
Flexible Input
Upload files via multipart, pass URLs via JSON, or use form-encoded data. Three content types supported.
Fast Processing
Single synchronous request — result in seconds. JSON response with CDN image URL, no polling required.
API Reference
5 endpoints, simple integration. Here's everything you need.
Supported Content Types
https://deepfake-face-swap-ai.p.rapidapi.com/swap-faceSwap the face from a source image onto a target image. Returns JSON with a CDN URL to the result image.
source_image / source_urlfile / stringrequiredSource face image. Upload file via multipart or pass a public URL via JSON/form-encoded.
target_image / target_urlfile / stringrequiredTarget image where the face will be placed. Upload file via multipart or pass a public URL via JSON/form-encoded.
many_facesbooleanSwap up to 5 faces in one request. Default: false
{
"image_url": "https://images.ai-engine.net/face-swap-ai/abc12345.jpg",
"width": 1024,
"height": 768,
"size_bytes": 245000
}https://deepfake-face-swap-ai.p.rapidapi.com/target-faceSwap a specific face in a group photo by index. Use /detect-faces first to get face indices. Only the targeted face is swapped. Returns JSON with a CDN URL to the result image.
source_image / source_urlfile / stringrequiredSource face image. Upload file via multipart or pass a public URL via JSON/form-encoded.
target_image / target_urlfile / stringrequiredTarget group photo. Upload file via multipart or pass a public URL via JSON/form-encoded.
face_indexintegerIndex of the face to swap (from /detect-faces). Default: 0
{
"image_url": "https://images.ai-engine.net/face-swap-ai/abc12345.jpg",
"width": 1024,
"height": 768,
"size_bytes": 245000
}https://deepfake-face-swap-ai.p.rapidapi.com/detect-facesDetect all faces in an image and return their positions. Use the returned face indices with /target-face or /target-enhance to target specific faces.
image / image_urlfile / stringrequiredImage to analyze. Upload file via multipart or pass a public URL via JSON/form-encoded.
{
"total_faces": 3,
"faces": [
{"index": 0, "bbox": {"x": 120, "y": 50, "width": 160, "height": 160}},
{"index": 1, "bbox": {"x": 400, "y": 80, "width": 120, "height": 120}},
{"index": 2, "bbox": {"x": 650, "y": 90, "width": 100, "height": 100}}
]
}https://deepfake-face-swap-ai.p.rapidapi.com/enhance-faceEnhance and restore faces in an image using AI upscaling. No face swap — just improve face quality, fix artifacts, and upscale details. Returns JSON with a CDN URL to the result image.
image / image_urlfile / stringrequiredImage containing faces to enhance. Upload file via multipart or pass a public URL via JSON/form-encoded.
many_facesbooleanEnhance up to 5 faces in one request. Default: false
{
"image_url": "https://images.ai-engine.net/face-swap-ai/abc12345.jpg",
"width": 2048,
"height": 1536,
"size_bytes": 520000
}https://deepfake-face-swap-ai.p.rapidapi.com/target-enhanceEnhance a specific face in a group photo by index. Use /detect-faces first to get face indices. Only the targeted face is enhanced. Returns JSON with a CDN URL to the result image.
image / image_urlfile / stringrequiredImage containing faces to enhance. Upload file via multipart or pass a public URL via JSON/form-encoded.
face_indexintegerIndex of the face to enhance (from /detect-faces). Default: 0
{
"image_url": "https://images.ai-engine.net/face-swap-ai/abc12345.jpg",
"width": 2048,
"height": 1536,
"size_bytes": 520000
}Response
All endpoints return JSON. Swap and enhance endpoints return a JSON object with image_url (CDN URL), width, height, and size_bytes. The detect-faces endpoint returns JSON with face positions and indices.
Limits
- Maximum image size: 10 MB per image
- Supported input formats: JPEG, PNG, WebP
- Output format: JPEG (quality 95), delivered via CDN URL in JSON response
- Swap output dimensions: same as target image (original resolution preserved)
- Enhance output dimensions: 2x upscaled from input
- URL download timeout: 10 seconds
- Face enhancement applied automatically to swap results
Quick Start
Copy-paste code to get started in seconds. Replace YOUR_API_KEY with your RapidAPI key.
# Swap face (file upload)
curl -X POST "https://deepfake-face-swap-ai.p.rapidapi.com/swap-face" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: deepfake-face-swap-ai.p.rapidapi.com" \
-F "source_image=@source.jpg" \
-F "target_image=@target.jpg"
# Swap face (JSON with URLs)
curl -X POST "https://deepfake-face-swap-ai.p.rapidapi.com/swap-face" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: deepfake-face-swap-ai.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{"source_url": "https://example.com/source.jpg", "target_url": "https://example.com/target.jpg"}'
# Detect faces
curl -X POST "https://deepfake-face-swap-ai.p.rapidapi.com/detect-faces" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: deepfake-face-swap-ai.p.rapidapi.com" \
-F "image=@group_photo.jpg"
# Enhance face
curl -X POST "https://deepfake-face-swap-ai.p.rapidapi.com/enhance-face" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: deepfake-face-swap-ai.p.rapidapi.com" \
-F "image=@photo.jpg"Pricing
Start free, scale as you grow. All plans include full API access with no credit card required for the free tier.
Basic
50 requests/mo
- Full API access
- All endpoints
- Standard support
Pro
8,000 requests/mo
- Full API access
- All endpoints
- Standard support
Ultra
40,000 requests/mo
- Full API access
- All endpoints
- Standard support
Mega
80,000 requests/mo
- Full API access
- All endpoints
- Standard support
Start Using Face Swap Today
Sign up on RapidAPI to get your API key. The free tier includes generous monthly requests — no credit card required.