Character Replace API for Developers

Character Replace & Animate API

Swap the person in a video with a reference character, or animate a still character from performance footage.

Free credits on signup
Transparent per-credit pricing
No watermarks on paid plans
Subscription or usage-based
Auto-scaling
Deadpool
Kratos
Chun-Li
Peter Griffin
Robot
Keanu Reeves
Elmo
Walter White
Stormtrooper
The Grinch

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 Character Replace & Animate

Character replacement and animation with auto detection, resolution controls, and trim windows.

Replace & Animate Modes
mode "replace" (default) swaps the subject; "animate" drives a character image from reference motion.
Auto Subject Detection
selection_mode "auto" finds the primary person; use "point" with pixel coordinates when needed.
480p & 720p Output
Pick resolution per job to balance quality and credit cost.
Trim Controls
Limit processing with start_seconds and end_seconds.

Integrate in 3 Steps

Ship character swap or animation in three steps.

1
Get Your API Key
Sign up free and generate an API key from the Developer dashboard. You get free credits to start.
2
Upload Video & Character Image
Upload assets, then POST to /v1/character-replace with mode, resolution, and optional selection_mode.
3
Get Results & Scale
Receive the output via response or webhook. Deploy to production — infrastructure scales automatically.
Get Started Free

Code Examples

Character Replace & Animate in a few lines of code. Install an SDK or use the REST API directly.

import os
import requests

response = requests.post(
    "https://api.magichour.ai/v1/character-replace",
    headers={
        "Authorization": f"Bearer {os.environ['MAGIC_HOUR_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "name": "Character replace",
        "start_seconds": 0,
        "end_seconds": 5,
        "resolution": "480p",
        "assets": {
            "video_file_path": "api-assets/id/1234.mp4",
            "image_file_path": "api-assets/id/5678.png",
        },
        "style": {"mode": "replace", "selection_mode": "auto"},
    },
)
res = response.json()
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
24,000credits / month
Included
25,000credits / month
Remaining headroom
1,000credits / month
TOTAL BILL
$300
/year

Character Replace & Animate 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 Character Replace & Animate API to power real products.

Creator Apps
Swap users into clips or drive avatars from reference performances.
Marketing
Test mascots and spokesperson swaps without reshoots.
Avatars
Transfer motion from performers onto stylized character art.
Try before integrating

Try Character Replace & Animate 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.

Character Replace API Frequently Asked Questions

Replace (default) swaps the primary subject while keeping scene motion. Animate drives a still character from the reference video performance.

selection_mode defaults to "auto". Set "point" and pass points with position_x, position_y, and time_seconds.

position_x and position_y are pixel coordinates in the source frame. time_seconds uses the same clock as start_seconds and end_seconds.

Output duration at 24fps, scaled by resolution (480p or 720p). See billing docs for per-second rates.

docs.magichour.ai/api-reference/video-projects/character-replace

Start Building with the Magic Hour Character Replace API

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