Skip to content
Models

Face Swap Video API: Replace Up to Four People

A face swap video API: swap the people in a clip for the faces you send, with moves, lips, scene and sound kept. Requests, limits, consent and cost.

Updated 6 min read

A face swap video API takes a clip and a photo of a face, and returns the same clip with that face on the person in it. On Frameport that is Frameport Replace 1, our own clip editor: one request to POST /v1/videos/edits replaces up to four people with the faces you send, keeps their moves, lips, the scene and the sound, and costs $0.12 per second of clip at 768p, charged only if the edit succeeds.

This page covers what the edit changes, a first swap in curl, Python and Node, several faces in one clip, the limits a clip must meet, consent, and the cost.

What the edit changes, and what it keeps

ChangesThe face of each person you name, to the face in the picture you send
KeepsThe moves, the lips, the scene and the sound of the clip
ClothesThe clip's by default; with "keep_outfit": false, each person is dressed as in their picture
People per clip1 to 4, one picture each
Output768p or 1080p, a video file behind a signed link
Price$0.12 per second at 768p, $0.25 at 1080p

It works on a clip you already have: a recorded take, a generated clip, a scene from your own footage. It does not write a new scene from a prompt; for that, use a text to video model first and swap the face in afterwards.

Your first face swap video API request

Upload the clip and the face once, then send their ids. Public https URLs work too, and so do your own outputs by their file_… id.

# 1. Upload the clip and the face (or skip this and pass https URLs)
curl "https://frameport.ai/v1/uploads?filename=dance.mp4" \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: video/mp4" \
  --data-binary @dance.mp4
curl "https://frameport.ai/v1/uploads?filename=face.jpg" \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @face.jpg

# 2. Submit the edit with the two upload ids
curl https://frameport.ai/v1/videos/edits \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fp-replace-1",
    "video": "upl_7Rk2PqV9wXm4Tn8Lc1BdZe",
    "faces": ["upl_3Tn8Lc1BdZeR7Rk2PqV9wX"],
    "resolution": "768p"
  }'

# 3. Poll until "status" is "succeeded", then download outputs[0].url
curl https://frameport.ai/v1/videos/edits/$GENERATION_ID \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY"
202 Accepted, for a 6-second clip
{
  "id": "gen_6Pq3WnT8vXc1Lm5Rk9YbZs",
  "object": "generation",
  "type": "video",
  "model": "fp-replace-1",
  "status": "queued",
  "input": {
    "video": "upl_7Rk2PqV9wXm4Tn8Lc1BdZe",
    "resolution": "768p",
    "faces": 1,
    "keep_outfit": true,
    "duration": 6
  },
  "reserved_usd": 0.72,
  "cost_usd": null,
  "outputs": [{ "id": "file_3Vb8KqW2nTx7Lc5Rm1YdPs", "status": "queued" }],
  "error": null,
  "created_at": "2026-11-28T10:00:00.000Z",
  "completed_at": null
}

By the time the 202 comes back, the clip has been measured: duration is the seconds it bills, and reserved_usd is its price. The edits reference lists every field.

Faces, targets and keeping the outfit

With one person in the clip, one face is enough. With several, send one picture per person, left to right, and say in targets who each face replaces, in the same order:

POST /v1/videos/edits
{
  "model": "fp-replace-1",
  "video": "https://example.com/duet.mp4",
  "faces": ["https://example.com/ana.jpg", "https://example.com/ben.jpg"],
  "targets": ["the woman on the left", "the man on the right"],
  "keep_outfit": false,
  "resolution": "1080p"
}
  • faces: 1 to 4 pictures, PNG, JPEG or WebP, up to 10 MB each: an https URL, a base64 data URI, an image upload or one of your image outputs.
  • targets: required with two faces or more, one per face, up to 200 characters each. Describe each person as the clip shows them: their place, their clothes, what they do.
  • keep_outfit: true by default, and each person keeps the clothes of the clip. false dresses each one as in their picture, which turns a face swap into a character swap.
  • prompt: an optional note on the edit, up to 500 characters.

The price does not change with the number of faces: an edit is billed on the clip's seconds alone.

Clip limits

Frameport Replace 1
Length2 to 10 seconds
FileMP4 or MOV, up to 64 MB
Frame rate24 fps
Resolutions out768p and 1080p, 768p when left out
Where it comes fromA public https URL, a video upload (upl_…) or one of your video outputs (file_…)

A URL must be https on a public host name, with no IP address, no credentials and no private or local host; up to 3 redirects are followed. A clip off these limits is refused with 400 invalid_video when you send it, and the message says what to fix, for example "takes clips at 24 fps: convert the clip first". Nothing is charged. To bring a clip within them with ffmpeg, cut it to 10 seconds and convert it to 24 fps:

Prepare a clip
ffmpeg -i input.mp4 -t 10 -r 24 -c:v libx264 -crf 18 -c:a aac clip.mp4

For a longer scene, cut it into clips of up to 10 seconds, swap each, and join the results.

The acceptable use policy applies to every picture you send and every clip you get back:

  • Everything you make must be fiction.
  • Never anything involving minors.
  • Never a real, identifiable person without their consent, including faces from photos of private persons.
  • Never impersonation, fraud, harassment or anything illegal where you or your users are.

Use your own face, or the face of someone who has agreed to this use, or a character you generated. If your users send the pictures through your app, you answer for what they make with your keys: ask for consent in your product, and put in place the checks your audience calls for. A request that is refused answers 400 content_policy and costs nothing. The workspace's content filter, on by default, also reads the note and every target of an edit.

What a face swap costs, and when it is charged

An edit costs the clip's seconds times the rate at the resolution you ask for. Seconds are whole, rounded up, with 0.15 s of grace: a 6.1-second clip bills 6 seconds.

Clip768p1080p
2 s$0.24$0.50
6 s$0.72$1.50
10 s$1.20$2.50

When you submit, the price of the longest clip it takes, 10 seconds, is held first. Once the clip is measured, the hold comes down to your clip's price, which is the reserved_usd of the 202. It is charged when the edit succeeds, and a failed edit gives it all back. To know the price before you send anything, quote the edit with its length:

POST /v1/generations/quote · 200 OK
{
  "object": "quote",
  "model": "fp-replace-1",
  "type": "video",
  "mode": "edit",
  "price_usd": 0.72,
  "reserved_usd": 1.2,
  "breakdown": "6 s at 768p × $0.12/s",
  "available_usd": 42.5,
  "enough_balance": true
}

That answers a body of {"model": "fp-replace-1", "seconds": 6.1}. max_cost_usd on an edit caps the hold, which is the price of the longest clip. To sharpen the result further, send it to Frameport Upscale 1 by its file id: a 1080p swap upscales to 2K.

Good source clips and good face photos

  • A clear face photo: the face fills a good part of the frame, looks roughly toward the camera, in even light, with nothing over it. One person per picture.
  • Faces the clip shows: a person seen from far away or always turned from the camera gives the edit little to work with.
  • One take, steady framing: a clip with hard cuts between scenes is better split into one edit per shot.
  • Distinct targets: "the man in the red jacket" is easier to follow than "the man", when two people look alike.

Weighing face swap APIs against each other? The best face swap API for video lists what to check. For a script that cuts a long clip, swaps each piece and joins them, see how to swap faces in a video with Python. One master ad with a local presenter for each market is the subject of video ad localization. Getting the clip and the faces to the API is covered in upload files to an AI generation API.

FAQ

How many people can the face swap video API replace at once?

Up to 4 in one clip. Send one face per person, left to right, and with two or more, a targets entry for each saying who it replaces. The price is the same for one face or four.

Does the swap keep the voice and the sound?

Yes. The clip's sound is kept as it is, and so are the moves, the lips and the scene. Only the faces change, and the clothes too if you send "keep_outfit": false.

How much does a face swap cost per video?

It is billed per second of clip: $0.12 at 768p and $0.25 at 1080p, so a 6-second clip at 768p costs $0.72. Nothing is charged when an edit fails, and there is no subscription.

Can I use the API from Python?

Yes. The Python tab above uploads the files, submits the edit, polls it and saves the result with requests; any language that can send HTTPS requests works the same way.

Can I swap faces without writing code?

Yes: open Frameport Replace 1 in the Studio, add the clip and the faces, and start the edit from the same balance. The no-code guide walks through it.

Start building.

Your API key is free. Top up from $10 when you are ready.