Face Swap API for Developers

Face Swap API

Integrate AI face swap into your app in minutes. Swap faces in photos, videos, and GIFs with a simple REST API. SDKs for Python, Node.js, Go, and Rust.

Free to start
No watermarks on paid plans
Subscription or usage-based
Auto-scaling
Iron Man
Film Noir
Home Drama
Action Thriller
Sunset Romance
Horror Moment
Office Western

Trusted by teams at

meta
nba
loreal
puma
cisco
deel
shopify
decathlon
dallas-mavericks
pittsburgh-pirates
tala
dyson
dazn
wsc-sports

Everything You Need to Ship Face Swap

One API for photos, videos, and GIFs. Fully managed infrastructure, multi-language SDKs, and commercial-ready outputs.

Photo Face Swap
Swap faces in any photo with a single API call. Supports JPG, PNG, and WebP with automatic face detection and natural blending.
Video Face Swap
Process full videos frame-by-frame. Handles motion, angles, and lighting changes. Trim to specific segments with start/end timestamps.
Multi-Face Swap
Detect and swap multiple faces in one request. Map each face to a different identity or apply the same face to all.
Fast Processing
Photos in 1–5 seconds. Videos optimized for speed with async processing and webhook notifications on completion.
Auto-Scaling Infrastructure
Scales compute to match demand — handles traffic spikes automatically. Scales to zero when idle. No GPU provisioning.
Commercial-Ready
Paid plans support non-watermarked outputs with commercial licensing. Suitable for marketing, SaaS products, entertainment apps, and client work.

Integrate in 3 Steps

From zero to face-swapping in production — no GPU setup; no model deployment; no infrastructure headaches.

1
Get Your API Key
Sign up free and generate an API key from the Developer dashboard. You get free credits to start.
2
Make Your First Request
Install an SDK or call the REST API directly. Send a face image and target photo/video to the face swap endpoint.
3
Get Results & Scale
Receive the swapped output via response or webhook. Deploy to production — infrastructure scales automatically.
Get Started Free

Code Examples

Face Swap in a few lines of code. Install an SDK or use the REST API directly.

from magic_hour import Client
from os import getenv

client = Client(token=getenv("MAGIC_HOUR_API_KEY"))

# Photo face swap
res = client.v1.face_swap_photo.generate(
    assets={
        "image_file_path": "/path/to/target.jpg",
        "face_file_path": "/path/to/face.jpg",
    },
)

# Video face swap
res = client.v1.face_swap.generate(
    assets={
        "image_file_path": "/path/to/face.png",
        "video_source": "file",
        "video_file_path": "/path/to/video.mp4",
    },
    start_seconds=0,
    end_seconds=15,
)
API Docs

Face Swap API Pricing

Subscription plans for standard usage.

Prefer usage-based pricing?

Email us or message us in Intercom and we will set up your usage-based pricing.

API Calculator
Use our calculator to estimate your API costs.
Tier
Estimated monthly cost

$1.73

Based on 24 FPS

Built for Builders

See how developers use the Face Swap API to power real products.

Social & Entertainment Apps
Add face swap features to social platforms, meme generators, dating apps, and entertainment products. Drive engagement and virality with personalized content.
E-Commerce & Virtual Try-On
Let customers see themselves wearing products. Swap faces onto model photos for personalized shopping experiences that increase conversion.
Marketing & Ad Personalization
Create localized ad variations at scale. Swap talent faces for different markets, generate UGC-style content, and A/B test creative without reshoots.
Content Creation Platforms
Power video editing tools, thumbnail generators, and content automation workflows. Let creators produce more variants without manual editing.
Gaming & Avatars
Generate personalized game characters, avatars, and in-game content by swapping player faces onto character models.
Education & Training
Create personalized training videos, educational content with character customization, and interactive learning materials.
Try before integrating

Try Face Swap Free — No Code Required

Test quality first with the free tool, then plug the same output quality into your app with the API when you are ready.

Face Swap API — Frequently Asked Questions

Magic Hour's Face Swap API is a RESTful API that lets developers integrate AI-powered face swapping into any application. It supports photo, video, and GIF face swaps with realistic results. You authenticate with an API key and make simple HTTP requests — or use our official SDKs for Python, Node.js, Go, and Rust.

The Face Swap API supports photos (JPG, PNG, WebP), videos (MP4, MOV), and GIFs. For video, you can specify start and end timestamps to process specific segments. Multi-face detection and swapping is supported across all formats.

Sign up at magichour.ai, navigate to the Developer page to generate your API key, and start making requests. You get free credits on signup to test the API. Install an SDK (pip install magic-hour, npm install magic-hour, etc.) or call the REST endpoints directly. Full documentation and code examples are available at docs.magichour.ai.

Magic Hour offers subscription plans for predictable monthly usage, plus usage-based pricing for higher-volume teams with custom needs. Photo face swaps are priced per image and video swaps by duration/model usage. Use the calculator on this page for estimates, then choose the plan model that fits your workload.

Magic Hour provides official SDKs for Python, Node.js (TypeScript), Go, and Rust. All SDKs are open source on GitHub and support the full API surface including face swap, image-to-video, text-to-video, animation, and more. You can also call the REST API directly from any language that supports HTTP.

Yes. The API automatically detects all faces in the source media. You can swap one, several, or all faces in a single API call. Each face can be mapped to a different target identity for precise control over multi-face swaps.

Photo face swaps typically complete in 1–5 seconds. Video processing time depends on duration and resolution but is optimized for speed. The API is asynchronous for video — you submit a job and poll for completion or receive a webhook callback when done.

Yes. Magic Hour's infrastructure scales compute up automatically to handle demand spikes with no rate limits on concurrent requests for paid plans. When you have zero traffic, it scales to zero — so you're never paying for idle GPUs.

Paid API plans support non-watermarked outputs. Free or trial usage may include watermarks depending on plan settings, so teams usually upgrade to a paid plan for production and commercial delivery.

Generated outputs are temporarily stored for download and then automatically deleted. Input files are not retained after processing. Magic Hour does not use your data to train models.

Yes. Magic Hour offers a free face swap tool at magichour.ai/products/face-swap where you can test the quality with your own photos and videos — no sign-up required. Once you're satisfied with the results, integrate the same technology via the API.

Magic Hour is the only face swap API backed by a full consumer product with millions of users, proving the technology works at scale. Key differentiators: (1) free try-before-you-buy via the web tool, (2) SDKs in 4 languages, (3) photo + video + GIF in one API, (4) fully managed infrastructure with auto-scaling, (5) Y Combinator-backed company with dedicated support.

Start Building with the Magic Hour Face Swap API

Free credits on signup. SDKs for Python, Node.js, Go, and Rust. Production-ready in minutes.