Character Replace API Reference - Magic Hour Docs
What this API does
Create the same Character Replace you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.
Good for
- Automation and batch processing
- Adding character replace into apps, pipelines, or tools
How it works (3 steps)
- Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the
file_path. - Send a request to create a character replace job with the basic fields.
- Check the job status until it’s
complete, then download the result fromdownloads.
Key options
- Inputs: usually a file, sometimes a YouTube link, depending on project type
- Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes
- Extra fields: e.g.
face_swap_mode,start_seconds/end_seconds, or a text prompt
Cost
Credits are only charged for the frames that actually render. You’ll see an estimate when the job is queued, and the final total after it’s done.
For detailed examples, see the product page.
Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
Body
Body
End time of your clip (seconds). Must be greater than start_seconds.
x >= 0.115
Source video and reference character image for the job.
Give your video a custom name for easy identification.
"My Character Replace video"
Start time of your clip (seconds). Must be ≥ 0.
x >= 00
Output video resolution. Defaults to 480p, the lowest resolution available on your plan.
480p, 720p "720p"
Optional style controls for replace vs animate mode and subject selection.
Response
Success
Success
Unique ID of the video. Use it with the Get video Project API to fetch status and downloads.
"cuid-example"
The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video.
If video generation fails, credits will be refunded, and this field will be updated to include the refund.
450