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 credits on signup
Transparent per-credit pricing
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 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

Estimate Your API Costs

Build with model-specific APIs for video, image generation, and image editing. Compare inputs, examples, and capabilities across Magic Hour's supported models.
Seconds of Video Per Month
100 seconds
seconds
Recommended plan
Pro Annual
$300
/year
300,000 credits per year
Up to 3.5 hours of video
Up to 30,000 images
PRO ANNUAL covers your usage
Estimated usage
12,000credits / month
Included
25,000credits / month
Remaining headroom
13,000credits / month
TOTAL BILL
$300
/year

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.

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 starting at $15/month (Creator), $39/month (Pro), and $99/month (Business), each including a monthly credit allotment. Credits are consumed per generation based on output length and model. You can also contact us to set up usage-based (pay-as-you-go) pricing. A free tier with credits is available on signup — no credit card required.

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.

Sign up at magichour.ai/developer — no credit card required. You'll receive free credits and an API key immediately. The key works across all Magic Hour API endpoints including Face Swap. Start making API calls in minutes using our Python, Node.js, Go, or Rust SDKs.

Yes. Every new Magic Hour account gets free credits on signup that work across all API endpoints. No credit card is required to get started. Paid plans unlock higher credit limits, higher concurrency, and commercial use rights.

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.